boazsegev / combine_pdf

A Pure ruby library to merge PDF files, number pages and maybe more...
MIT License
734 stars 155 forks source link

Page content is overridden by next page value #152

Closed bsanjaasuren closed 5 years ago

bsanjaasuren commented 5 years ago

Hi, I'm using prawn pdf and I have two PDF pages generated by using combine pdf. And showing user_id, username on each page. But in a very rare occurrence, user_id is overridden by next page user_id in the output. The version I am using is 0.2.5, I cannot figure out this issue because it is very rare. please help

Rails code:

pdf = CombinePDF.new
pdf << CombinePDF.new(pdf_page_1)
pdf << CombinePDF.new(pdf_page_2)
send_data(pdf.to_pdf...)

PDF outputs:

correct information is: 
page1: #1 user1
page2: #2 user2

wrong information:
page1: #2 user1
page2: #2 user2

My question is:

  1. Is it possible on combine_pdf gem?
  2. Do I have to update combine_pdf version?
boazsegev commented 5 years ago

Hello @bsanjaasuren ,

Thank you for opening this issue.

Sadly, I can't help you without more information and a way for me to reproduce the issue.

However, the issue might have been solved already, so maybe consider updating the gem.

Does the issue occur when using the latest version (1.0.15)?

As for your questions:

  1. Is it possible on combine_pdf gem?

Mostly it should be possible, however, this depends on the format of the PDF and there are some limitations.

Please read the Known Limitations in the README. Especially notice that when the PDFs use the same field names, data might be lost, corrupted or unified (first 2 bullet points)..

  1. Do I have to update combine_pdf version?

It might solve your issue and it's also recommended for issues you might not be aware of (see CHANGELOG.

Kindly, Bo.

bsanjaasuren commented 5 years ago

Thanks for your quick response @boazsegev. I will update my gem 👍☺️ .

bsanjaasuren commented 5 years ago

@boazsegev sorry I have edited my issue. And I guess it is very similar to issue #109. We are both using prawn pdf, so I hope it is fixed by 1.0.1 verison of CombinePDF.