vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
688 stars 175 forks source link

Page format change after generate signature #157

Closed cassiobt closed 2 years ago

cassiobt commented 2 years ago

I'm trying to generate a PDF with A5 format, but after sign de PDF it changes to A4 format with the content in A5, making a white space like in the image below:

espaço em branco

vbuch commented 2 years ago

Just linking it as it is probably the same issue as #108 and #125

cassiobt commented 2 years ago

Just linking it as it is probably the same issue as #108 and #125

Thank you for linking this similars issues. I think they can complement each other. As none of those issues are solved, I'll keep this opened.

cassiobt commented 2 years ago

I was using https://github.com/marcbachmann/node-html-pdf to generate the PDF. So I change tohttps://github.com/mrafiqk/html-pdf-node and now it works like a charm

vbuch commented 2 years ago

I'd say this is rather random. There are cases where we are losing metadata. I'd keep the issue open. Would be nice if you attach a failing file (generated with node-html-pdf)

cassiobt commented 2 years ago

@vbuch issue-github-a5-a4.pdf

vbuch commented 2 years ago

I know the reason for this falure. Your original PDF's /Annots is not an array. This is probably fine, but obviously we don't deal with it very well in createBufferPageWithAnnotation.

vbuch commented 2 years ago

@cassiobt you have provided an already broken file. Could you provide one befre you have tried to apply a signature/placeholder?

cassiobt commented 2 years ago

Hi, Sorry about the delay. Here is the file before sign. before-sign.pdf

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity in the past 90 days. It will be closed if no further activity occurs. Thank you for your contributions.