Returns the page's rotation as 0, 90, 180, or 270 degrees.
PDFium reports the rotation stored in the page's /Rotate entry
combined with any runtime rotation applied via the editing API.
Arguments
- page
A
pdfium_pagefrompdf_page_load(), or apdfium_doc.- page_num
One-based page index. Only used when
pageis apdfium_doc. Ignored otherwise.
Details
A non-zero rotation means pdf_page_size()'s width and height
refer to the page's pre-rotation media box, not the on-screen
dimensions a viewer would display. For an "as-displayed" size, swap
width and height when rotation is 90 or 270.
See also
pdf_page_size() for the un-rotated dimensions.
Examples
fixture <- system.file("extdata", "fixtures", "minimal.pdf",
package = "pdfium"
)
if (nzchar(fixture)) {
doc <- pdf_doc_open(fixture)
pdf_page_rotation(doc, 1)
pdf_doc_close(doc)
}