[
https://issues.apache.org/jira/browse/PDFBOX-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14367295#comment-14367295
]
Fabian Zeindl commented on PDFBOX-2119:
---------------------------------------
I think i'm hit by this issue.
I create PDFs in A4 from FOP. I used pdfbox 1.8.4 through 1.8.8 to print them
fine.
Since the old pdfbox had an issues with loading fonts I switched to
2.0.0-20150317.130031-1178.jar.
No matter how I try to print my PDF (to XPS or a real a4-printer), the margins
end up different than in the loaded PDF.
First problem was that the printout was smaller and centered on the page. This
was my code:
PDDocument pdfDoc = PDDocument.load(pdfFile.toFile())) {
PrinterJob pjob = PrinterJob.getPrinterJob();
pjob.setJobName(jobTitle);
pjob.setCopies(count);
new PDFPrinter(pdfDoc, pjob).silentPrint();
Now I've changed it to this:
PDDocument pdfDoc = PDDocument.load(pdfFile.toFile())) {
PrinterJob pjob = PrinterJob.getPrinterJob();
pjob.setJobName(jobTitle);
pjob.setCopies(count);
new PDFPrinter(pdfDoc, Scaling.ACTUAL_SIZE, Orientation.AUTO).silentPrint(pjob);
The printout is now almost it's correct size, but all side-margins are smaller
than in the PDF.
Is there any documentation on how to print a pdf as-is?
> Possible printing bug for V2.00
> -------------------------------
>
> Key: PDFBOX-2119
> URL: https://issues.apache.org/jira/browse/PDFBOX-2119
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.0
> Environment: Window 7 Professional SP1, JRE 8.
> Reporter: You Liang
> Labels: pdfbox, printer, printing
>
> Printing seems to be using the window default printer paper size instead of
> selected printService papersize.
> Etc my default Printer is an A4 Printer, and the printer that i had choosen
> to print is a receipt printer.
> When i print to the receipt printer, it will print out a blown up version of
> the original pdf, and when i change my default printer to the receipt
> printer.. everything work fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]