combine_pdf
combine_pdf copied to clipboard
Broken when parsing PDF with empty object
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
- Create pdf with empty object
- I created pdf file by [Microsoft Print to PDF] in windows 10
- Run
pdf_data = ::CombinePDF.parse(File.read(pdf_file)).to_pdf
- insert something to pdf_data
After this, I opened pdf by Acrobat Reader, and I found an error.