Pdftools 2.0: powerful pdf text extraction tools

pdf_data expects a file path or raw vector. It looks like you probably passed in a character string instead, that is, your variable pdf is probably a string, correct? try passing a file path instead