In the web application i am working on, i need to print a pdf file to the local printer of the user. When i execute the code the print dialog box appears on the server system instead of the client. Can anyone assist me on how to print the file to a local printer of the user.
I'm confused - you're posting this in the Applet forum, so I'm guessing the code runs as part of an applet? If so, then it's not possible that the GUI would be shown on the server.
If, on the other hand, the code currently is part of a web app, then it would make sense that the print dialog is shown on the server (and thus useless). In that case, why not stream the PDF to the client, and let the user decide what to do with it - open it, save it, print it, whatever?
Joined: Apr 07, 2009
Thanks for your immediate response
As you have said, currently my code is part of the web application.
My project requirement is that whenever a product comes to the warehouse, i have to generate a barcode and show a print dialog box to the user so he can select which printer to print to.
I have generated the barcodes in a PDF File. I have initially coded to stream the PDF file to the GUI but the client has told me not to display the contents of the PDF file in the GUI to the user, they just want me to show a print dialog box.
In the forum i read that using applets we can do this, but it was not clear. Is there any other way of achieving this.
Joined: Mar 22, 2005
Well, a web app can't initiate action on the client, so whatever you end up doing will have to wait until the client next accesses the server.