Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken when parsing PDF with empty object #217

Open
sh-miyoshi opened this issue Jun 7, 2022 · 0 comments
Open

Broken when parsing PDF with empty object #217

sh-miyoshi opened this issue Jun 7, 2022 · 0 comments

Comments

@sh-miyoshi
Copy link

Hi there, I found an error while parsing PDF.

When parsing a PDF file containing an empty object like following,

14 0 obj
<<
>>
endobj

...
/Resources 14 0 R

I got /Resources 0 0 R.
PDF file does not contain 0 0 obj, so the PDF is broken.
I suspect a bug in this method.
https://github.com/boazsegev/combine_pdf/blob/master/lib/combine_pdf/renderer.rb#L92

Steps to reproduce

  1. Create pdf with empty object
  • I created pdf file by [Microsoft Print to PDF] in windows 10
  1. Run pdf_data = ::CombinePDF.parse(File.read(pdf_file)).to_pdf
  2. insert something to pdf_data

After this, I opened pdf by Acrobat Reader, and I found an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant