Answered by:
metro style device app for printer

Question
-
I have a few questions regarding Metro style device app for printers.
1. In order to get Print Notifications from a printer to a metro style device app, is it enough to specify a background task and specify that in the device meta data?. Or should the app also handle Advanced Print Task settings also , in order to receive Print notifications?
I created a sample metro style device app for a v4 printer .The app is listing associated devices. The app has opted into the Background Tasks contract for Print Notification but the app is not receiving any notifications from the printer. I am trying to display a toast notification but no toast, not even the default toast is displayed when the printer reaches states like Paper out etc. The app has not handled Advance Print Settings. The app is toast-capable. I tried the trouble shooting section of the Concerned section in "Developing Windows Store apps for Printers " doc .The conditions mentioned there are correct. What could be wring?
2. Can we receive Print Notifications via background task to the associated Metro style app when printing from desktop apps like Word, Notepas etc.? Or are only Metro style device apps that support printing capable of raising such notifications?
3. Is Bidi communication in USB based on MS-PAN protocol? Is Bidi communication possible in printers added via netwok (Add Printer wizard)?
Wednesday, June 19, 2013 6:59 PM
Answers
-
Hi James, thank you a lot for replying. In fact, I have the app working now . So points 1 and 2 are OK for me. It is working now. I had to do a device app myself with inputs from the device app for printer sample and got it working. I am now able to receive notifications from printer via toast and on clicking the toast, the app is launching. The toast message is the Async UI notifications as mentioned in http://msdn.microsoft.com/en-us/library/cc746159.aspx. I am able to get toast notifications for conditions like "Paper out". I think we need not spend time on this..
I understand that the app only need to register for Background task notification in order to receive print notifications.
It is also seen that the same Async UI toast notifications can be raised by printing from desktop apps like Notepad. So much is OK.
What I really wanted to know if we can get the offline status of a printer from a metro style device app. The scenario is I am setting the printer offline by going to control panel->Devices and Printers->Right click the printer and select See what's printing option->Select Printer menu->Use printer offline.
Then I try to print to that device . My app which is registered for Print Notification is supposed to receive a toast notification indicating the offline status.( refer string resource keys 2602 or 115 in the attached in the link I have given above. This is for getting the offline status of a printer ). But the app is not receiving the toast notification for this. What could be wrong? Is there something more to be done for this? Can you please treat this in high priority and reply?
When the Print Window is displayed from Devices charm, when printing from a metro style device app that supports printing, the installed printers are displayed on the Print Window. If a particular printer is offline , then that status is displayed along with the device name. It would also be sufficient if it could be explained how this status is obtained.- Edited by its_me_here Friday, June 28, 2013 6:33 AM add more content
- Marked as answer by Jamles HezModerator Friday, July 12, 2013 1:24 AM
Friday, June 28, 2013 6:23 AM -
Windows exposes online/offline device status using the System.Devices.Connected property, which can be retrieved using the PnpObject classes. This property will reflect changes in the online/offline status of plug and play devices (eg those using WSD or USB), but it will not reflect the online/offline status of printers which are placed into the "Use printer offline" state that you tested.
For your question on printer notifications, we do not support showing a notification which indicates that a printer is offline. When a printer is offline, the Bidi status which we use for all apps and services is based on the last cached value; the offline status is not pushed into the Bidi data.
Thanks
Justin
- Edited by Justin Hutchings [MSFT] Thursday, July 11, 2013 9:33 PM Fixed an error
- Marked as answer by Jamles HezModerator Friday, July 12, 2013 1:25 AM
Thursday, July 11, 2013 8:24 PM
All replies
-
Hi its me here,
I tried to find some experienced engineers to help you, it may take some time, and hope you can be patient.
Best Wishes,
James He
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Friday, June 28, 2013 3:01 AMModerator -
Hi James, thank you a lot for replying. In fact, I have the app working now . So points 1 and 2 are OK for me. It is working now. I had to do a device app myself with inputs from the device app for printer sample and got it working. I am now able to receive notifications from printer via toast and on clicking the toast, the app is launching. The toast message is the Async UI notifications as mentioned in http://msdn.microsoft.com/en-us/library/cc746159.aspx. I am able to get toast notifications for conditions like "Paper out". I think we need not spend time on this..
I understand that the app only need to register for Background task notification in order to receive print notifications.
It is also seen that the same Async UI toast notifications can be raised by printing from desktop apps like Notepad. So much is OK.
What I really wanted to know if we can get the offline status of a printer from a metro style device app. The scenario is I am setting the printer offline by going to control panel->Devices and Printers->Right click the printer and select See what's printing option->Select Printer menu->Use printer offline.
Then I try to print to that device . My app which is registered for Print Notification is supposed to receive a toast notification indicating the offline status.( refer string resource keys 2602 or 115 in the attached in the link I have given above. This is for getting the offline status of a printer ). But the app is not receiving the toast notification for this. What could be wrong? Is there something more to be done for this? Can you please treat this in high priority and reply?
When the Print Window is displayed from Devices charm, when printing from a metro style device app that supports printing, the installed printers are displayed on the Print Window. If a particular printer is offline , then that status is displayed along with the device name. It would also be sufficient if it could be explained how this status is obtained.- Edited by its_me_here Friday, June 28, 2013 6:33 AM add more content
- Marked as answer by Jamles HezModerator Friday, July 12, 2013 1:24 AM
Friday, June 28, 2013 6:23 AM -
Windows exposes online/offline device status using the System.Devices.Connected property, which can be retrieved using the PnpObject classes. This property will reflect changes in the online/offline status of plug and play devices (eg those using WSD or USB), but it will not reflect the online/offline status of printers which are placed into the "Use printer offline" state that you tested.
For your question on printer notifications, we do not support showing a notification which indicates that a printer is offline. When a printer is offline, the Bidi status which we use for all apps and services is based on the last cached value; the offline status is not pushed into the Bidi data.
Thanks
Justin
- Edited by Justin Hutchings [MSFT] Thursday, July 11, 2013 9:33 PM Fixed an error
- Marked as answer by Jamles HezModerator Friday, July 12, 2013 1:25 AM
Thursday, July 11, 2013 8:24 PM -
Thank you Justin for your reply. But I would like to point out two things:
1 ) When we explicitly set a Printer offline using the "Use printer offline" option, Offline status will be displayed for that printer in the Devices charm when we try to print from a Metro app that supports printing. Please see the screen shot( I have edited the Printer name in the screenshot. Shown is not the real printer name). How is this status taken? it done? Isnt' Devices charm a Metro UI? This status will be displayed for usb as well as Network added printers. I need to get the same status from my Store app and not via charm.
2) The string resource table for AsyncUI String resources mentions Offline status . Please see the link http://msdn.microsoft.com/en-us/library/cc746159.aspx and the item with resource id 2602 in the table. Is it actually the "Use Offlline" status? I am not able to get the status from my Store app as Toast notification when I try to print. But I am able to get status like Paper out (resource id 103 )
I would like to get info on these two points, especially item 1.
Friday, July 12, 2013 4:49 AM -
While the items you point out are true, it doesn't change my previous answer that we don't support your scenario in Windows 8.1. I certainly understand your confusion and frustration.
- In your screenshot, the OS is retrieving that data using Win32 APIs which are unavailable to Windows Store apps.
- It's true AsyncUI includes a string for Offline. These resources were designed during Windows Vista, so don't assume that the presence of a string means that our DriverEvent system will detect that state for you.
Thanks!
Justin
- Proposed as answer by Justin Hutchings [MSFT] Monday, July 15, 2013 11:51 PM
Monday, July 15, 2013 11:51 PM