lebebr01/pdfsearch

pdf search error "Bad annotation"

Closed this issue · 3 comments

Hi,

I am new to R and R studio so sorry if this is a slightly dumb question but when I try to run the code below, I get most of my results but also a bunch of errors "PDF error : Bad annotation destintation".

What is it due to? How can I fix this?

My code :
library(pdfsearch)
library(dplyr)
library(writexl)

dest <- "C:/Users/me/Documents/2019/"

result_table <- data.frame(keyword_directory(dest,
keyword = c("informatique"),
surround_lines = 1, full_names = TRUE))

result_clean <- result_table %>% select(ID, pdf_name, keyword, line_text)

write_xlsx(x = result_clean, path = "C:/Users/me/Documents/2019/rod_2019.xlsx", col_names = TRUE)

Thank you

Hello!

Thanks for your interest in the package. I don't see anything with your code that jumps out at me as causing the issue. Are you still getting output that you are able to save or no output ultimately (ie. is this a warning or error)?

Ultimately this sounds like it is a problem with the PDF, perhaps it is a scanned PDF that doesn't have the text scanned using OCR? Can you share the PDFs or happen to know which PDF is causing the warning/error? Either of those would help me to troubleshoot.

Best!

Currently no, not without a pattern in the filenames. Perhaps you could adapt your code using some form of try() which could allow you to collect the error message and then filter those errors out upon successfully running through all of your files.

Best.