Input PDF:
input.pdf
Undesired result:
output.pdf
When signing the document twice (so user can see multiple signature boxes on different pages) the result is that the only the last created signature box is valid. The first one has message "Document has been altered or corrupted since it was signed.".
Note that the input.pdf contains unsigned signature boxes, and it has been made using phpunite.
Code:
$document = PDFDoc::from_string($content);
$document->sign_document($certfile);
$content = $document->to_pdf_file_s();
$document = PDFDoc::from_string($content);
$document->sign_document($certfile);
$content = $document->to_pdf_file_s();
file_put_contents('output.pdf', $content);
Input PDF:
input.pdf
Undesired result:
output.pdf
When signing the document twice (so user can see multiple signature boxes on different pages) the result is that the only the last created signature box is valid. The first one has message "Document has been altered or corrupted since it was signed.".
Note that the input.pdf contains unsigned signature boxes, and it has been made using phpunite.
Code: