pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: PDF printing - page size problem
Date Mon, 14 Apr 2014 21:18:10 GMT
Hello Norbert,

I think the best would be to open a JIRA issue and include your PDF. You 
generate it yourself, so you can remove anything that is confidential .


Am 14.04.2014 21:07, schrieb Norbert Sándor:
> Hello,
> I use FOP to generate PDFs, and PDFBOX to print them.
> Recently I switched to the trunk version, mainly because of these 
> issues in the current stable version:
>  * https://issues.apache.org/jira/browse/PDFBOX-1452
>  * https://issues.apache.org/jira/browse/PDFBOX-1776
>  * https://issues.apache.org/jira/browse/PDFBOX-1776
> The trunk version fixed the above issues but has a new one: when I 
> print a PDF with an unusual page size, the printed page size is 
> incorrect.
> 1. PDF is generated using FOP, page size is 2,76x23,62 (correct)
> 2. I load the PDF using PDDocument.load() then immediately save() it,
>    the resulting PDF has page size of 2,76x23,62 (correct)
> 3. pdfDocument.getPage(0).findMediaBox() returns
>    [0.0,0.0,198.425,1700.787] (correct)
> 4. But when I try to print it using /new PDFPrinter(pdfDocument,
>    printJob).silentPrint()/ to a virtual PdfCreator printer, then the
>    resulting PDF has page size of 8,26x11,69 and the content is
>    horizontally centered on the page. I tried physical printers as well
>    with the same result, the output always seems to have A4 size...
> Do you have any idea how can I change the page size for printing?
> Thanks for your help in advance!
> Best regards:
> Norbert Sándor

View raw message