You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2021/05/31 15:45:00 UTC

[jira] [Commented] (PDFBOX-5202) PDPageable Landscape document rotated 270°

    [ https://issues.apache.org/jira/browse/PDFBOX-5202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17354523#comment-17354523 ] 

Tilman Hausherr commented on PDFBOX-5202:
-----------------------------------------

I think this is related to PDFBOX-3117. Try creating a copy of PDFPageable, replace {{if (mediaBox.getWidth() > mediaBox.getHeight())}} with {{if (false)}} and then try to print with Auto orientation or with different orientations.

> PDPageable Landscape document rotated 270°
> ------------------------------------------
>
>                 Key: PDFBOX-5202
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5202
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.23, 3.0.0 JBIG2
>         Environment: Windows 10, Windows Server 16, OpenJDK 11.0.11
>            Reporter: Benjamin Judas
>            Priority: Major
>         Attachments: 10_5_Q.pdf, 10_5_Q_Printout.TIF
>
>
> When printing a PDF in landscape orientation, the document is rotated 270° clockwise. Printing a document in portrait orientation works fine.
> I already tried a few workarounds (as found here in this tracker and on stackoverflow) but none helped: setting rotation, setting orientation depending on rotation and edge length, etc.
> What I found out by adding excessive logging with diagnostic data to a quick and dirty diagnostic application is that the Page format and orientation of the document are recognized correctly (for example 100mm x 50mm, landscape) but the assigned Paper-Object gets (50mm x 100mm):
> {noformat}
> C:\Users\BJudas\Downloads\ph>java -jar PrintingHub-2020.12.7.jar print com.zellner.printinghub.doclocation.RemotePDF http://dvzsvmintra/10_5_Q.pdf "ELOTiffDrucker"
> Mai 31, 2021 11:24:53 VORM. com.zellner.printinghub.doclocation.RemotePDF loadRemoteDocument
> INFORMATION: Page: 0: 100mm x 50.0mm, Rotation 0
> Mai 31, 2021 11:24:53 VORM. com.zellner.printinghub.PrintingHub printDocument
> INFORMATION: Page Format 100mm x 50.0mm, Landscape, Paper: Size: 50.0mm x 100mm, Imageable is 50.0mm x 100mm @ (0mm, 0mm){noformat}
> I can reproduce this problem with a physical printer (CAB-Label-Printer) and a Software-TIFF-Printer with various PDF-Files generated by different applications/systems/libraries.
> This is basically the code used to create the Pageable and to print it:
> {code:java}
> byte[] rawData; // PDF-data read via HttpClient from a URL somewhere in the company network
> String printService = "ELOTiffDrucker";
> PDDocument pddoc = Loader.loadPDF(rawData);
> Pageable pageable = new PDFPageable(pddoc);
> PrinterJob job = PrinterJob.getPrinterJob();
> job.setPageable(pageable);
> job.setPrintService(printService);
> job.setJobName("Print Job");
> job.print();
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org