pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregor Kova─Ź <kov...@gmail.com>
Subject Bad quality when printing
Date Wed, 20 May 2015 14:05:09 GMT
Hi!

I'm using PDFBOX 2.0 (updated subversion today) and this code to print:

private static void printWithPDFBox2(File pdfFile, int copies) {
        PDDocument document = null;

        try {
            document = PDDocument.load(pdfFile);

            PrinterJob printJob = PrinterJob.getPrinterJob();
            printJob.setJobName(pdfFile.getName());
            printJob.setPrintService(PrintServiceLookup.lookupDefaultPrintService());

            printJob.setCopies(copies);
            HashPrintRequestAttributeSet printRequestAttributeSet =
new HashPrintRequestAttributeSet();
            printRequestAttributeSet.add(new Copies(copies));
            printRequestAttributeSet.add(SheetCollate.COLLATED);
            PDFPrinter printer = new PDFPrinter(document,
Scaling.ACTUAL_SIZE, Orientation.PORTRAIT);
            printer.print(printJob, printRequestAttributeSet);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (document != null) {
                try {
                    document.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

Original PDF is located at:
https://drive.google.com/open?id=0B-qoYfDTAZ8QNkpINC1oZjFvbDg&authuser=0
What gets printed out is located at:
https://drive.google.com/open?id=0B-qoYfDTAZ8QdmFlOVg0M2NFam8&authuser=0

Why this quality degradation (as if fonts are not antialiased)? Even
setting dpi to 500 doesn't make it better.

Best regards,
    Kovi

-- 
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

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