I'm trying to convert a series of scanned PDF into searchable PDF using the tesseract
and pdftools
packages. I've accomplished two steps. Now I need to write back to a searchable pdf.
- Read scanned PDF
- Run OCR
- Write back to a searcheable PDF
eg <- download.file("https://www.fujitsu.com/global/Images/sv600_c_automatic.pdf", "example.pdf", mode = "wb")
results <- tesseract::ocr_data("example.pdf", engine = "eng")
R> results
# A tibble: 406 x 3
word confidence bbox
<chr> <dbl> <chr>
1 PFU 96.9 228,181,404,249
2 Business 96.2 459,180,847,249
3 report 96.2 895,182,1145,259
4 | 52.5 3980,215,3984,222
5 No.068 91.0 4439,163,4754,237
6 New 96.0 493,503,1005,687
7 customer's 94.6 1069,484,2231,683
8 development 96.5 2304,483,3714,732
9 di 90.4 767,763,1009,959
10 ing 96.3 1754,773,1786,807
# ... with 396 more rows
Alternatively, is there another package or command-line tool I can invoke in R for Windows?