Convenience wrapper that returns the document's text content
one string per page, matching the shape of
pdftools::pdf_doc_text(). Each element is the concatenated text
of every text run on the corresponding page, joined with "\n"
between runs.
Arguments
- doc
A
pdfium_docfrompdf_doc_open(), or a character path.- password
Optional password for encrypted PDFs when
docis a path. Ignored whendocis already an openpdfium_doc.
Details
Internally walks the document with pdf_text_runs() to reuse
the batched text-page load.
See also
pdf_text_runs() for run-level structure (font,
bounding box).
Examples
fixture <- system.file("extdata", "fixtures", "shapes.pdf",
package = "pdfium"
)
if (nzchar(fixture)) pdf_doc_text(fixture)
#> [1] "Hello"