Я не могу повторить вашу проблему.Используя ваш документ, я получаю 12 страниц, читая текст в обоих направлениях.Проверка их идентичности также приводит к истине.
tm с читателем pdftools:
library(tm)
read <- readPDF(engine = "pdftools", control = list(text = "-layout"))
document <- Corpus(URISource("396797318-123.pdf"), readerControl = list(reader = read))
с использованием pdftools напрямую:
library(pdftools)
text <- pdf_text("396797318-123.pdf")
Проверьте, идентичны ли они:
tm_text <- as.vector(sapply(document, as.character))
identical(text, tm_text)
[1] TRUE
str(document)
List of 1
$ 396797318-123.pdf:List of 2
..$ content: chr [1:12] " Training and Development Policy\r\n Contents\r\"| __truncated__ "1.2 As a guiding principle, all staff must be offered appropriate and relevant\r\n development opportunitie"| __truncated__ " • Short Term Externally Provided Training (e.g. one or two day external\r\n courses)\r\n • Longer Term"| __truncated__ " are at no cost) together with periodic training bulletins informing employees of\r\n impending courses"| __truncated__ ...
..$ meta :List of 7
.. ..$ author : chr "leanne.cutts"
.. ..$ datetimestamp: POSIXct[1:1], format: "2014-02-28 17:57:34"
.. ..$ description : chr ""
.. ..$ heading : chr "Training and Development Policy"
.. ..$ id : chr "396797318-123.pdf"
.. ..$ language : chr "en"
.. ..$ origin : chr "PDFCreator Version 1.4.3"
.. ..- attr(*, "class")= chr "TextDocumentMeta"
..- attr(*, "class")= chr [1:2] "PlainTextDocument" "TextDocument"
- attr(*, "class")= chr [1:2] "VCorpus" "Corpus"