Gesendet: Fr, 16. Okt 2009 Von: Albie Janse van Rensburg<albie....@gmail.com> > Andreas Lehmkühler wrote on 15/10/2009 10:00 PM: > > Hi, > > > > Albie Janse van Rensburg schrieb: > > > >> 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(); > > Great, thanks! I had to add the fontbox jar to get around an error, and > now I have made a printout. > > Problem: instead of letters, I only see little blocks! I would guess > there's an encoding of some sort needed. That issue is probably related to [1], if your document uses a embedded subset as font. Check the font properties of your pdf with another pdf reader like acrobat, kpdf, ... If not, it could be an also known issue with the encoding.
[1] https://issues.apache.org/jira/browse/PDFBOX-490 > I've attached a PDF copy of the printout. As attachements are limited your printout didn't make it. > Is there a guide for me to refer to? The documentation seems sparse - I > am basically reading source + comments for help at the moment. I'm afraid that's all so far. Feel free to ask your questions on the pdfbox-related mailing lists. BR Andreas Lehmkühler