pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain <alain...@yahoo.com>
Subject Printing a PDF doc with images
Date Tue, 05 Feb 2013 20:39:03 GMT

Using the following code in an applet to print a PDF directly to a printer defined on the
client machine.

DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PAGEABLE;
PrintRequestAttributeSet patts = new HashPrintRequestAttributeSet();
PrintService[] ps = PrintServiceLookup.lookupPrintServices(flavor, patts);
if (ps.length == 0) {
    throw new IllegalStateException("No Printer found");
PrinterJob job = PrinterJob.getPrinterJob();
PDFParser parser = new PDFParser(new ByteArrayInputStream(pdfDoc));

My problem is that scanned page's in the document do not print correctly.

First was experiencing a page printed in a gray shade. Removed the compression from the scanner
and now the pages are completely blank.

All other pages generated with itext print fine, the pages that are generated via a scanner
do not.

Can anyone shed some light on what i am doing wrong?

Just started using PDFBox and trying to move forward.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message