| Author |
PDFBox printing issue
|
Stan F Smith
Greenhorn
Joined: Jun 28, 2011
Posts: 20
|
|
Hello,
We are trying to use PDFBox to open a print dialog box using a stream. I works, however the dialog box that opens is actually on the server.
Has anyone used this before and managed to get it to work?
Thanks
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
Well of course it's going to open on the server, that's where the software is running.
If you want users to be able to get the file on their own systems you'll need to stream the PDF as a response to a request.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Stan F Smith
Greenhorn
Joined: Jun 28, 2011
Posts: 20
|
|
Thanks Bear,
I dont suppose you could point me to an example?
Thanks
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
The servlets forum likely has many examples of streaming binary data.
Essentially, you will set the content headers (content-type and content-disposition) and then write the bytes out to the response output stream.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Here's an example from the Ranch's FAQ: http://www.coderanch.com/how-to/java/ImageServlet. It looks like it's talking about images but if you scroll down a bit you'll see how it can be used to stream any file to the browser. (Including PDF of course.)
It doesn't tell you how to write that PDF so that it pops up a print dialog when it opens in the browser, but maybe that's already been done. And I don't know if that was your question anyway.
|
 |
Stan F Smith
Greenhorn
Joined: Jun 28, 2011
Posts: 20
|
|
Thanks,
That URL example doesn't seem to open.
I am using wicket not servlets, would it work the same way?
Thanks again
|
 |
 |
|
|
subject: PDFBox printing issue
|
|
|