pdftools: PDF utilities

Description Usage Arguments Details See Also Examples

Description

Utilities based on libpoppler for extracting text, fonts, attachments and metadata from a pdf file.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pdf_info(pdf, opw = "", upw = "")

pdf_text(pdf, opw = "", upw = "")

pdf_data(pdf, opw = "", upw = "")

pdf_fonts(pdf, opw = "", upw = "")

pdf_attachments(pdf, opw = "", upw = "")

pdf_toc(pdf, opw = "", upw = "")

Arguments

pdf

file path or raw vector with pdf data

opw

string with owner password to open pdf

upw

string with user password to open pdf

Details

Poppler is pretty verbose when encountering minor errors in PDF files, in especially pdf_text. These messages are usually safe to ignore, use suppressMessages to hide them altogether.

See Also

Other pdftools: pdf_render_page

Examples

1
2
3
4
5
6
# Just a random pdf file
pdf_file <- file.path(R.home("doc"), "NEWS.pdf")
info <- pdf_info(pdf_file)
text <- pdf_text(pdf_file)
fonts <- pdf_fonts(pdf_file)
files <- pdf_attachments(pdf_file)

ropensci/pdftools documentation built on Dec. 13, 2018, 5:22 p.m.