i am trying to merge two PDF documents. when i looking for sample codes, some of those contain GetPageRotation() function. what is meant by GetPageRotation() function or what action is take place when we call this function?
-
Please remove the pdfbox label, as this question isn't about pdfbox. – Tilman Hausherr Jun 14 '17 at 15:36
2 Answers
The page size is defined in user units. For instance: an A4 page measures 595 x 842 user units. There are different ways to define the orientation. If you want to change a portrait page to a landscape page, you could switch the width and the height: 842 x 595. However, that's not very elegant. It's much better to set the page rotation. As defined in ISO-32000, there are 4 possible values for the page rotation: 0, 90, 180, 270. See also: iTextSharp how to rotate/switch page from landscape to portrait
However, if you want to merge two document, you shouldn't worry about the page rotation. The PdfCopy
and PdfSmartCopy
class takes care of getting the page rotation correctly. If you really need GetPageRotation()
to merge two PDF files, then you are doing it wrong. See How to merge documents correctly?

- 75,994
- 9
- 109
- 165
getPageRotation(int index)
It gets the page rotation.
I have find all methods & Description of itextpdf.text.pdf on itextsupport.com

- 861
- 2
- 7
- 13