Height; if pdfImportedPage. GetPageN documentPage ; pageDict. Put PdfName. The included PDFs rotated to portrait orientation if needed. The PDF prints correctly on my local printer.
|Published (Last):||13 December 2007|
|PDF File Size:||9.90 Mb|
|ePub File Size:||15.39 Mb|
|Price:||Free* [*Free Regsitration Required]|
Height; if pdfImportedPage. GetPageN documentPage ; pageDict. Put PdfName. The included PDFs rotated to portrait orientation if needed. The PDF prints correctly on my local printer. This file is sent to a fulfillment house, and unfortunately, the landscape included files do not print properly when going through their printer and rasterization process. They use Kodak Creo NexRip Best How To : First let me assure you that changing the rotation in the page dictionary is the correct procedure to achieve what you want.
You are doing the right thing. Unfortunately, you are faced with a third party product over which you have no control that is not doing the right thing. How to solve this? I have written an example called IncorrectExample. You can safely ignore all the warnings I added: they are not meant for you. This example is very specific to your problem. In my example, I am using the classes Document and PdfWriter to create a copy of the original document.
This is wrong in general because it throws away all interaction. With Document, I create new pages using a new Rectangle that uses the lowest value of the dimensions of the existing page as the width and the highest value as the height. This way, the page will always be in portrait. Note that I use the method getPageSizeWithRotation to make sure I get the correct width and height, taking into account any possible rotation.
I then add a PdfImportedPage to the direct content of the writer. I use the isPortrait method to find out if I need to rotate the page or not. Observe that the isPortrait method looks at the page size without taking into account the rotation.
iTextSharp rotated PDF page reverts orientation when file is rasterized at print house
In this chapter, we will see how to insert an image in a PDF document and how to rotate that image, using the functions available in the iText library. While instantiating this class, you need to pass a PdfDocument object as a parameter to its constructor. To add image to the PDF, create an object of the image that is required to be added and add it using the add method of the Document class. You can rotate an image using the setRotationAngle method.
iText - PDF rotates 90 degrees