boazsegev / combine_pdf

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

Documents not being combined... #119

Open cwilliamsnh opened 7 years ago

cwilliamsnh commented 7 years ago

I have two documents, one that was created in an app with Prawn and one that contains only an e-signature block. I'm trying to combine the signature block with the first page of the generated document.

Signature block: purchase_request_signature_block_only.pdf

Generated document: purchase_request_anixter.pdf

I'm trying to combine them with this code: signature_block = CombinePDF.load("#{Rails.root}/app/assets/pages/purchase_request_signature_block_only.pdf").pages[0] pdf = CombinePDF.load filename page = pdf.pages(false).first page << signature_block pdf.save "signature_#{filename}"

I get the saved file, but it doesn't have the signature block visible at all.

Am I missing something or am I trying to do something that is not supported?

Thank you in advance, Chuck

boazsegev commented 7 years ago

Hi Chuck,

Thank you for opening the issue and posting the details.

I downloaded the purchase_request_signature_block_only.pdf PDF, but I can't see the signature block...

I didn't try anything with CombinePDF yet, I just tried to open the PDF in Preview (on my Mac), and it shows a white page.

Could the signature be some sort of Adobe extension?

Kindly, Bo.

cwilliamsnh commented 7 years ago

You can't open it with Preview. You need to use Adobe Reader AC. Are you on a Mac or Windows box?

Thank you, Chuck

On Jul 31, 2017, 11:42 PM -0400, Bo notifications@github.com, wrote:

Hi Chuck, Thank you for opening the issue and posting the details. I downloaded the purchase_request_signature_block_only.pdf PDF, but I can't see the signature block... I didn't try anything with CombinePDF yet, I just tried to open the PDF in Preview (on my Mac), and it shows a white page. Could the signature be some sort of Adobe extension? Kindly, Bo. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

boazsegev commented 7 years ago

You can't open it with Preview. You need to use Adobe Reader AC.

If I understand this comment correctly, your signature file isn't a Standard compliant PDF, but it includes an Adobe extension that is only supported when using Adobe software.

CombinePDF doesn't support these extensions, which are both proprietary and mostly unpublished.

Since this seems to be the case, I recommend that you consider using a different solution for your signature stamp.

Good Luck! B.

cwilliamsnh commented 7 years ago

Bo,

Seems the unmaintained prawn-template gem did the trick. I was able to use Prawn to create a new PDF using the signature block file as a template!

Chuck

On Aug 1, 2017, 1:08 AM -0400, Bo notifications@github.com, wrote:

You can't open it with Preview. You need to use Adobe Reader AC. If I understand this comment correctly, your signature file isn't a Standard compliant PDF, but it includes an Adobe extension that is only supported when using Adobe software. CombinePDF doesn't support these extensions, which are both proprietary and mostly unpublished. Since this seems to be the case, I recommend that you consider using a different solution for your signature stamp. Good Luck! B. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

boazsegev commented 7 years ago

Wow, I wonder how that came to be.

I'm happy you found a tool that does the job.

I wish I knew what's going on with this, but I can't even see the PDF on a normal PDF viewer.

cwilliamsnh commented 7 years ago

Bo,

The old prawn-template gem didn't work after all. Seems rendering the document mangled the e-signature field.

The screen shot below shows what the signature only block is supposed to look like.

screenshot 2017-08-02 07 53 59

This screen shot shows what the finished document should look like (note that trying to insert the e-signature causes an error.)

screenshot 2017-08-02 07 55 47