Hi,

Albie Janse van Rensburg schrieb:
> Hi
> 
> I am trying to write a PDF printer applet.  The applet is fed a URL of
> the PDF, which it must query for the document, and then I want it to
> print to a selected printer (drop-down list of
> PrintServiceLookup.lookupPrintServices).  My applet's jar (and the
> pdfbox jar) are signed, which got me around some initial permission issues.
> 
> I have used the PDDocument object's load(url) method to get the file. 
> When I call PDDocument.print(), I get a popup dialog to select a
> printer, but when I click the Print button, a whole lot of nothing
> happens!  That's right - nothing.  No printer job queued, no error, the
> dialog disappears, and that is all she wrote.
> 
> My code:
> 
> ====code====
>     private PDDocument pdfDocument;
>     private String url = "http://localhost/test.pdf";;
> ... (snip) ...
> 
>                     if (pdfLoaded == false) {
>                         pdfDocument = new PDDocument ();
>                         pdfDocument.load(new URL (url));
>                         pdfLoaded = true;
>                     }
>                     pdfDocument.print();
> ====code====
> 
> Is there something obvious I'm missing here?
The load-method is static and delivers the document you have to use for
further usage. Try sometjing like this:

PDDocument pdfDocument = PDDocument.load(new URL (url));
pdfDocument.print();


BR
Andreas Lehmkühler

Reply via email to