0
votes

I have a pdf with 10 pages i want to read all data. i worked on below code but it gives me only first page of data

library(pdftools)
library(tidyverse)
library(tm)

path<-"C:/mydf.pdf"

PDF <- pdf_text(path) %>%readr::read_lines()
1

1 Answers

0
votes

I just tested your code and it worked fine for me. I give you a simpler way that you may like more.

library(pdftools)

  PDF <- pdf_text("C:/mydf.pdf")
 
 # first page text
 cat(PDF[1])
 
 # all page text
 cat(PDF)