[ https://issues.apache.org/jira/browse/PDFBOX-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682470#action_12682470 ]
Peter Thorson commented on PDFBOX-152: -------------------------------------- Andreas, sorry, I know that this project was just recently moved, and I have not been following too closely. The 3 lines of code were all that I needed to add to the code to fix the issue I was having: newPage.setCropBox( page.findCropBox() ); newPage.setMediaBox( page.findMediaBox() ); newPage.setRotation( page.findRotation() ); These were actually just copied from a similar function in another part of the code base. As the description notes, the issue was with 0.7.3 of the code and fix was located in PDFMergerUtility::appendDocument at line 315 (the section creating the new pages). Anyway, I was consulted about recommending a library for merging PDF documents and recommending PDF Box is difficult given the open merge issues. > Merge Landscape and Portrait PDFs does not keep orientation > ----------------------------------------------------------- > > Key: PDFBOX-152 > URL: https://issues.apache.org/jira/browse/PDFBOX-152 > Project: PDFBox > Issue Type: Bug > > [imported from SourceForge] > http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1470014 > Originally submitted by pthorson on 2006-04-13 11:51. > When I merge a Landscape PDF with a Portrait PDF the > orientation of all the pages in the result is the same > as whichever PDF was first. For instance, > PDFMerger landscape.pdf portrait.pdf test.pdf > results in all pages in test.pdf in landscape format. > > I used the daily build of 0.7.3 but also tried > AppendDoc in 0.7.2 and got the same results. > Result attached. > Source files sent to FTP site. > [attachment on SourceForge] > http://sourceforge.net/tracker/download.php?group_id=78314&atid=552832&aid=1470014&file_id=174500 > landscape.pdf (application/pdf), 18124 bytes > Landscape source PDF > [attachment on SourceForge] > http://sourceforge.net/tracker/download.php?group_id=78314&atid=552832&aid=1470014&file_id=174499 > portrait.pdf (application/pdf), 34376 bytes > Portrait source PDF (firewall is preventing me access to FTP) > [attachment on SourceForge] > http://sourceforge.net/tracker/download.php?group_id=78314&atid=552832&aid=1470014&file_id=174497 > merged.pdf (application/pdf), 51432 bytes > Result of merging Landscape with Portrait PDF > [comment on SourceForge] > Originally sent by pthorson. > Logged In: YES > user_id=1501547 > I note that if I add the following lines to v1.1 of > PDFMergerUtility::appendDocument at line 315 (the section > creating the new pages), the orientation seems to be > corrected: > newPage.setCropBox( page.findCropBox() ); > newPage.setMediaBox( page.findMediaBox() ); > newPage.setRotation( page.findRotation() ); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.