if(all(file.exists(Sys.which(c("pdfinfo", "pdftotext"))))) {
uri <- system.file(file.path("doc", "tm.pdf"), package = "tm")
pdf <- readPDF(PdftotextOptions = "-layout")(elem = list(uri = uri),
language = "en",
id = "id1")
pdf[1:13]
}
Run the code above in your browser using DataLab