PDF Citation Cover Page not always working

22 views
Skip to first unread message

Jose Blanco

unread,
Mar 21, 2022, 5:45:11 PM3/21/22
to DSpace Technical Support
We had a situation where we had a pdf where all the cover pages were in landscape mode and when the PDF was rendered with the citation page added, it was cutting off the pages that were in landscape. To fix this, I changed this line of code in 6.3


To be this:
       if (isCitationFirstPage()) {
            PDRectangle rectangle = new PDRectangle();

            //citation as cover page
            document.addPage(coverPage);
            for (PDPage sourcePage : sourcePageList) {
                rectangle.setUpperRightY(sourcePage.getCropBox().getUpperRightY());                rectangle.setLowerLeftY(sourcePage.getCropBox().getLowerLeftY()); 
              rectangle.setUpperRightX(sourcePage.getCropBox().getUpperRightX());
                rectangle.setLowerLeftX(sourcePage.getCropBox().getLowerLeftX());

                sourcePage.setCropBox(rectangle);
                document.addPage(sourcePage);
            }

        } else {

This took care of the problem.  But now, a user has pointed out that for one of our pdfs the pages are being cut off.  So this change I have placed does not work for all PDFs.  I wonder if anyone has come across this issue, and if there is a better way to solve this problem. 

Thank you!
-Jose


Reply all
Reply to author
Forward
0 new messages