You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Siemon Geeroms <si...@globis.be> on 2017/01/10 10:20:48 UTC
PDF printing not always correct
Hi,
We are using pdfbox (latest version 1.8.13) to print pdfs that are generated from another plugin (jasperreports). however, sometimes the orientation of the document changes during printing (see included examples). If we print the PDF with a pdf viewer (fox it reader) the orientation is correct
Can somebody explain me why this happens and how we can prevent this?
I've included some example code and a test pdf we are trying to print as well as the current result when using a pdf printer.
Thanks in advanced for a quick response.
Kind regards,
Siemon Geeroms
Re: PDF printing not always correct
Posted by Tilman Hausherr <TH...@t-online.de>.
See also
https://issues.apache.org/jira/browse/PDFBOX-3117
at the end there is a workaround I tried for the file PDFBOX-3117
<https://issues.apache.org/jira/browse/PDFBOX-3117>-1468001565.pdf in
the issue. You'd have to write your own PDFPageable.java as a copy of
ours and then use it like in Printing.java
Re: PDF printing not always correct
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 10.01.2017 um 11:20 schrieb Siemon Geeroms:
>
> Hi,
>
> We are using pdfbox (latest version 1.8.13) to print pdfs that are
> generated from another plugin (jasperreports). however, sometimes the
> orientation of the document changes during printing (see included
> examples). If we print the PDF with a pdf viewer (fox it reader) the
> orientation is correct
>
Please try the 2.0 version, printing was changed. Although there might
still be problems with label printing. Java sometimes does things on its
own.
If you don't want to code, you can also try the command line PrintPDF
utility, it has several options.
https://pdfbox.apache.org/2.0/commandline.html#printpdf
additional to these it has also
-printerName <name> : Print to specific printer
-orientation auto|portrait|landscape : Print using orientation
(default: auto)
Tilman