I want to insert blank page at end of the digitally PDF using itext library.and my confusion is adding pages will invalidate the existing signatures?
Thank you.
To put Joeri's answer into context, have a look at the Adobe technical white paper Adobe Acrobat 9 Digital Signatures, Changes and Improvements, especially its section "Allowed and disallowed changes." Here Adobe clarifies the allowed changes (as seen by Acrobat 9 and up) that can be made to a certified or signed document without invalidating the signatures applied to the document.
Allowed actions for certified documents
Certified with no changes allowed
Allowed
No changes allowed
Disallowed
Digitally signing
Supplying form field values
Adding or editing annotations
Adding form fields
Changing page content
Certified with form fill-in and digital signatures allowed
Allowed
Supplying form field values
Digitally signing
Disallowed
Adding or editing annotations
Adding form fields
Changing page content
Certified with annotations, form fill-in, and digital signatures, allowed
Allowed
Adding or editing annotations
Supplying form field values
Digitally signing
Disallowed
Adding form fields
Changing page content
Allowed actions for signed but uncertified documents
Allowed
Adding signature fields (see Limitations on adding signature fields to signed but uncertified documents)
Adding or editing annotations
Supplying form field values
Digitally signing
Disallowed
Adding form fields other than signature fields
Changing page content
As you see "Changing page content" always is in the "Disallowed" category. As adding a page changes page content — afterwards there is at least a white page where there used to be nothing —, this is not allowed.
(Even though not explicitly mentioned here, instantiating page templates most likely also is allowed whenever form fill-ins are allowed as that would conform to the PDF standard, cf. ISO 32000-1 section 12.8.2.2.2. But making use of such page templates would at least require the document to be specially prepared before signing, and your question sounds like the documents are already signed without any such preparation...)
PS: Obviously even these allowed changes need to be added in append mode aka incremental updates. Anything else will break the signature for good. For some backgrounds see this answer.
Yes it will. The signature is based on the content that is signed, so if you change the content, the signature is no longer valid.
If you're the signer, you can just sign the document again.
Whether the pages you add are blank is irrelevant.
Related
The extended features of a pdf file, like filling out the fields or a dropdown field do not work, after adding a new page to a pdf document.
The file is opened in append mode to preserve Reader enabling:
PdfDocument pdfDoc =
new PdfDocument(pdfReader, new PdfWriter(outputStream), new StampingProperties().useAppendMode());
Filling out the form fields does not break the signature, but after adding a new page to attach images to the file, the extended features are no longer available.
A new page is added with:
PdfPage page = pdfDoc.getPage(1);
pdfDoc.addNewPage(pdfDoc.getNumberOfPages() + 1, new PageSize(page.getPageSize()));
Is it possible to add pages and attach images to the file without breaking the signature?
The option removing the usage right is not applicable, since we want to be able to fill out and save the form.
Adobe "Reader Enabling" works by adding a specific kind of signature, a usage rights signature, to the document. Such a usage rights signature has a set of UR transform parameters that define the additional rights granted to a Adobe Acrobat Reader user when opening the document in question, see ISO 32000-2, Table 258 — Entries in the UR transform parameters dictionary.
Adobe Reader apparently not only offers its users only the additional rights from those parameters, it also checks whether some other software applied other manipulations and rejects the document if it detects such changes. Or at least it checks whether any applied changes would have been allowed for PDFs with arbitrary approval signatures, see this answer.
This actually is very understandable. Otherwise one would only need to grab a single Reader Enabled PDF to create arbitrary Reader Enabled PDFs by simply adding an incremental update removing all existing content and adding the desired content. This of course is not what Adobe wants...
I have a pdf document with multiple signature fields. The first field is signed with a certification signature. Whenever an approval signature is added to my document, a new revision is created and it is possible to view this specific revision in acrobat.
Is it also possible to view the original/initial version of the document? I cannot find this option in acrobat reader.
Edit: #mkl showed me the solution. I didn't find this option before, because I always used a rather old sample pdf from adobe (see screenshot).
For some reason the 'View signed version' option is not available there
[For] an approval signature [...] it is possible to view this specific revision in acrobat.
Is it also possible to view the original/initial version of the document? I cannot find this option in acrobat reader.
In your screen shot you show that the option to view the signed revision is immediately accessible from the signature panel for approval signatures but not for certification signatures.
If you right-click a signature there, though, to get its context menu, you'll find that option there for certification signatures, too:
PS: In English speaking forums it may be better to switch the language of a program to English before making a screen shot.
In a comment you say about that option that
for the sample doc I always used for evaluating, it is not available (see my edit). Do you have any idea what's different?
Your example file is not a "normal" PDF, it merely serves as a container for transporting a XFA form definition. (These piggyback XFA definitions have been deprecated in ISO 32000-2.)
When Adobe Reader (or an other XFA aware PDF viewer; there are not many) displays such a PDF, it ignores regular PDF contents completely and instead draws a form based on the attached XFA XML file.
Apparently Adobe's signature panel does not support the same features for such XFA PDFs as it does for "normal" PDFs.
We want to do the following:
1) upload 2 to 100 or so PDFs per day
2) have two people digitally sign each individual PDF
2a) The first signature needs to be a "certifying signature" - with certifying rights allowing one additional signature in the pdf
From a simple test of the system, it appears the process is - via the UI:
1) Upload the pdfs via the browser
1a) with the browser UI "place" signatures (Position etc.) in the PDFs (can be 100)
2a) First Person Signs the Batch of PDFs and sends the Batch to a recipient.
2b) The recipient signs and "sends them back"
Manually putting in signature fields in 100 PDF documents per day is quite a Task. Out PDFs can be generated with Signature form fields.
Can the Docusign System find specific form fields and use those for specific users - to fill in a digital signature?
Is this possible/and better done with the API? Is there a example or document that describes this somewhere?
I'm new to this System, so this/these question(s) might be completely naive.
Same underlying document is being sent (eg an order form)
If the pdfs are different versions of the same form or document then you use a template. Eg, if the documents are contracts being sent for approval to different people, then they are all the same underlying "contract document," but with different values for customer, dates, etc.
Easiest is to first "tag" the document using a template via the web interface, then use the same template for the subsequent documents. When you upload a new document, DocuSign will also automatically suggest which of your template matches the new document, saving additional steps.
If you have just a couple of different underlying documents then you'd create a matching set of templates. Since a matching template is suggested when the user uploads a doc, it means that the end users only have to tag ad hoc documents that they are sending or when a document format changes.
Documents that vary
For these cases, using a template with Anchor Text Tabs works well. An Anchor Text Tab tells the tab (eg a "Signature" tab) that, rather than being placed at a specific page and x/y co-ordinates, the tab should instead look for specific text in the document. So you create a template with an Anchor Text Tab that will look for the string "Sign here:" the tab will then place itself nearby (you can give the x and y offsets from the text.)
Anchor Text Tabs can also look for text that is "invisible" on the page (same color as the background). So you can change your docs to include invisible strings which will enable the Anchor Text Tabs to find their correct locations on the pages.
API All of the above can be done via the API. Since templates are often just created when a new document is set up, you may want to create the template using the web UI. Then, using the API, select which specific template should be applied to the doc that you've uploaded with the API.
We sign PDF documents by ELDOS.SecureBlackBox library which can place visible signature everywhere in document, but if we generate PDF dynamically by HtmlToPdf, right place for visible signature is various. This problem can be solved by adding signature field to PDF document and SecureBlackBox shows signature on this place. But the question is, how can I add a signature field with HtmlToPdf.
Using Acrobat 9, if I sign a PDF using a self-signed certificate and then edit the PDF after I sign it, Acrobat will inform me that there is a valid signature on the document but that the document also has unsigned changes. If I then sign the PDF again and look in the signature panel, it will show the first signed revision with a valid signature, notate that changes were made after the first revision was signed and then show a second signed revision with a valid signature.
I am trying to duplicate that behavior using iTextSharp. In code, I create a PDF and sign it. Then, I edit the PDF and sign it again. When I open the document in Acrobat, it shows both revisions but marks the first revision as an invalid signature because the document was altered. From what I can gather, I think iTextSharp is signing the entire document rather than just the first revision inside that document. I have set the Append parameter to true in both the PdfStamper and PdfSignatureAppearance constructors, but it does not seem to have any effect.
Since I can get the desired result using Acrobat, I am assuming I am just not using iTextSharp correctly. Can anyone shed some light on this?
You have to update the existing PDF instead of rewriting it entirely. Set the following attributes to true to enable updating.
PdfReader reader;
...
reader.Appendable = true;
Adobe does this with layers I suppose. Each revision of the PDF is probably placed in a different layer and then signed. If iText supports layers, you may be able to do it in a similar way.