You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well my goal was rather limited. I was only parsing the PDF to check if it was protected or not.
I ended up adding a rescue for this exception and parsing the file with CombinePDF.
Something like this:
rescue ::PDF::Reader::MalformedPDFError=>erroriferror.message.match(/xref table not found at offset/).present?pdf=CombinePDF::PDFParser.new(value.read,allow_optional_content: true)pdf.parseifpdf.root_object[:Encrypt].present?record.errors.add(...)
I am getting an error parsing this file.
The xref table does exists. Maybe there are less strict rules to reaching it.
The error is:
PDF::Reader::MalformedPDFError Exception: xref table not found at offset ...
fail_to_parse.pdf
The text was updated successfully, but these errors were encountered: