views:

90

answers:

2

Hi folks,

I need to print PDF's generated in an asp.net application using crystal reports. Upon printing, a database table gets updated with the status 'printed'. How do we handle situation where let's say, the printer runs out of paper?

I know this is on client-side, so what's the right way to handle issues like this?

TIA

+2  A: 

The printing is done client side and handled by the users machine, you will NOT have access to this information.

Expanded Answer

To expand upon the comments. The process flow that happens for this type of thing is as follows.

  1. ASP.NET Sends the file to the client (You control)
  2. The browser opens the file with the client's default application (Browser Controls)
  3. The default application displays the file (Application controls)
  4. The user opts to print the document, maybe now, maybe 3 days from now (Application Controls)
  5. The application sends the request to the printer and is done (Application Functionality)
  6. The printing systems actually print the document, if a failure IT notifies the user (Printing system control)

So, as you can see, not only are you once disconnected from your ASP.NET application you are actually outside of Acrobat if you want to get a "True" did it print result. For example if you print a document in Microsoft Word and the printer runs out of paper, who notifies you? Not Microsoft Word but the print spooler system.

Mitchel Sellers
@Mitchel Sellers - so, what's the workaround?
SoftwareGeek
It is not possible to know what a client does with a PDF they receive via a webrequest. You can only document in the database that the PDF was *most likely* *delivered* to them. Most likely because they might have started downloading the PDF and maybe closed the browser.
Raj Kaimal
@bhejaFry - There is NO way at all possible for ASP.NET to get this information, there is no workaround. James' solution MAY get you part way there, but even then, it is just an opening notice not printing, and sure isn't successful printing. As even applications like word don't know if it is printed successfully.
Mitchel Sellers
@Mitchel - Understood but then how would you design/implement a solution to this business workflow?
SoftwareGeek
I wouldn't, there is no way to do this
Mitchel Sellers
A: 

If you're in a trusted environment and can work out privacy issues, your pdf document could be designed to interact with your asp.net app or a web service when it's opened to incremement a counter or set a flag.

There's a company that offers this service, but you could probably come up with your own solution with other PDF rendering tools.

http://www.readnotify.com/readnotify/pmdoctrack.asp

Additonal information in the Adobe Acrobat SDK

James H
I am curious to know how this works. In Adobe Acrobat, I have "Unless explicitly permitted, PDF files cannot send information to the internet" by default.
Raj Kaimal