I need to append a pdf file to a digital signed pdf file, keeping valid the signature ...maybe using revision? ...using iTextSharp? How can I do it?
Please help me with some sample.
You can use Increment Update to do that, as long as the original signature allows you.
Take look at the document:
http://learn.adobe.com/wiki/download/attachments/52658564/Acrobat_DigitalSignatures_in_PDF.pdf?version=1&modificationDate=1269905473000
on Page 8 you will find what you want.
You can't as that invalidates the whole point of digital signatures, namely to detect when something exactly as you describe occurs and therefore ensure the validity of the original document. To do as you want, you will need to add the extra PDF to the unsigned original PDF and then resign the new conglomerate PDF.
Related
I can generate the MathML to PDF out using the jEuclid ("mml2xxx.bat") but what I get is a PDF with a size A4
What I need is, I want the PDF size exactly as per the equation in the PDF document
What I got now :
What I need :
What is the intended destination of the PDF equation/expression? The reason I ask is that some applications are smart enough to know not to use the whole A4 size, and display just the math part. If you're using InDesign, for example, and you use the Place command to place this PDF into a document, it should appear at the proper size, and likely even with the correct baseline adjustment.
If I apply a digital signature on a PDF file which contains another PDF files attached on it, does the signature apply to the whole document including attachments, or only to the "main" PDF ?
The goal is to detect any modification on any part of the document itself and all the files attached.
The signature on the parent document will calculate it's checksum based on all the bytes in the file. If any of the attachments are modified and saved back to the parent file, you will be able to detect that the entire package has changed but unless you also sign the child documents, you may not be able to tell which of the children was changed.
You may also want to invest in a certificate that is already on the Adobe Approved Trust List so that the document will appear valid when first opened and the use won't need to install your specific certificate. You can read more about this at the URL below.
http://helpx.adobe.com/acrobat/kb/approved-trust-list2.html
Assume, you have a PDF with attached files. From the point of view of PDF structure and PDF syntax, these attachments are represented by embedding some "standard" PDF objects including "streams".
When you digitally sign this PDF file, the signature is valid for the complete PDF file, consisting of all PDF objects (thusly including the attachments).
Should someone extract a copy of the attached files, modify them and then re-attach these, it will change the contents of the PDF. Hence the signature will become invalid by this change, which leads to the detection of the modification.
What you cannot detect:
if a copy of the attachment has been extracted (leaving the original PDF un-modified)
Once after completion of digital signature for PDF using DocuSign, How to read value of the fields in PDF using field ID/Name (using PDF Box API)? I am not able get the field ids of Digitally Signed PDF.
The sample PDF showed that the fields in PDF are not PDF form fields after all, neither Acrofornm nor XFA, they merely are texts with some lines around them. (They may once have been PDF form fields which were flattened, or they may never have been PDF form fields to start with.)
Thus, your only option left is text extraction. PDFBox has a quite elaborate text extraction engine. Have a look at PDFTextStripper. You can try and use this class as is, looking in the extracted string for the field labels and extract the following text until the end-of-line; or if you have the time, you can try to make use of the internal PDF structure where the field contents are in a separate Xobject.
I am using FOP to generate the PDF from XSL:FO and iText to apply the digital signature and signed date field in the PDF.
Problem is i am using co ordinates to apply the signature and date in the generated PDF.
The PDF are large, dynamic and changing always based on content. therefore the signature and date fields were not positioned Properly by the co-ordinates specified.
I googled to find solution for a long days. But i didnt get any solutions.
Can u please any one suggest me to create the PDF form fields in the PDF using FOP?
Then i can apply signature and date fields by using iText.
Please tell me any other technology to try to solve this problem?
The problem is that FOP doesn't create signature fields whereas iText needs a page number and coordinates (either defined by you or by a signature field).
Where do you want the signature to be placed?
Is it always on the first page? Always on the last page?
Can you put some unique text at the location where you want the document to be signed?
I'm asking this because you could put words like SIGN HERE on the last page, and then use TextRenderInfo to retrieve the coordinates of those words. See http://itextpdf.com/examples/iia.php?id=275 in combination with http://itextpdf.com/examples/iia.php?id=282
The TextRenderInfo class has methods such as getBaseLine(), getDescentLine(),... who give you LineSegment object which reveal the coordinates of each snippet of text in your PDF.
There are plenty of caveats: FOP could cut the words SIGN HERE in different snippets, such as "SIG", "N", "HE", "RE" which would make it difficult to recognize the unique string, but it's worth investigating.
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.