Returns the width and height of page in PDF points (1 point = 1/72 inch).
Accepts either a pdfium_page (preferred when you already have one) or
a (doc, page) pair (convenience for one-shot inspection).
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
The returned dimensions are media-box dimensions in the page's
default (un-rotated) orientation. If the page has a non-zero
rotation (via the PDF /Rotate attribute or PDFium's runtime
rotation), pdf_page_size() does not swap width and height. Query
the rotation separately with pdf_page_rotation() if you need to
know the on-screen orientation.
See also
pdf_page_rotation() for the rotation angle in degrees.
Examples
fixture <- system.file("extdata", "fixtures", "minimal.pdf",
package = "pdfium"
)
if (nzchar(fixture)) {
doc <- pdf_doc_open(fixture)
pdf_page_size(doc, 1)
pdf_doc_close(doc)
}