[ https://issues.apache.org/jira/browse/PDFBOX-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14620185#comment-14620185 ]
John Hewson edited comment on PDFBOX-2844 at 7/9/15 9:33 AM: ------------------------------------------------------------- Those methods are fundamentally broken in 1.8 (they only use the default printer and ignore any settings changed in the print dialog), and we've already removed both print() and silentPrint() from PDDocument, so I'm not worried about 1.8 compatibility, because it's already gone. Printing in 2.0 currently uses this highly non-standard and opaque code: {code} PDFPrinter printer = new PDFPrinter(document); printer.print(); {code} I'd like to replace it with this, completely standard Java printing API code: {code} PrinterJob job = PrinterJob.getPrinterJob(); job.setPageable(new PDFPageable(document)); job.print(); {code} So our print() method saves one line of code, while creating endless confusion. Not a net win. was (Author: jahewson): Those methods are fundamentally broken in 1.8 (they only use the default printer and ignore any settings changed in the print dialog), and we've already removed both print() and silentPrint() from PDDocument, so I'm not worried about 1.8 compatibility, because it's already gone. Printing in 2.0 currently uses this highly non-standard and opaque code: {code} PDFPrinter printer = new PDFPrinter(document); printer.print(); {code} I'd like to replace it with this, completely standard Java printing API code: {code} PrinterJob job = PrinterJob.getPrinterJob(); job.setPageable(new PDFPageable(document)); job.print(); {code} > Printing has bigger margins than expected > ----------------------------------------- > > Key: PDFBOX-2844 > URL: https://issues.apache.org/jira/browse/PDFBOX-2844 > Project: PDFBox > Issue Type: Bug > Components: Rendering > Affects Versions: 2.0.0 > Reporter: Tilman Hausherr > Attachments: PDFBOX-2844.pdf > > > Printing the attached file from PDFReader brings larger margins than > expected, and larger than with Adobe Reader. Doing the same with 1.8 has the > expected margins (but bad fonts). > From Александр Свиридов / Alex Sviridov in the mailing list: > {quote} > I printed this pdf file with Adobe Reader in mode 100%. And as expected left > and right margins are about 2cm. In comparison when I print using pdfbox left > margin is 4.5cm, right about 3.5cm. > The code I use : > {code} > PrinterJob job = PrinterJob.getPrinterJob(); > Paper paper=new Paper(); > paper.setSize(72d*8.267d, 72d*11.692); > PDFPrinter pDFPrinter=new PDFPrinter(document,Scaling.SCALE_TO_FIT, > Orientation.PORTRAIT,paper); > pDFPrinter.silentPrint(job); > {code} > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org