Hi everybody,
thanks for all the contribution, but:
1 - yes, I am really sure that I need something like in file
http://itext-general.2136553.n4.nabble.com/file/n4237594/2274_2007_H_PROVISIONAL_-_multifield_-_Adobe.pdf.
This is a specific prerequisite for our client
2 - thanks for the legal contributions, I philosophically agree, but
unfortunately I have to do this job (we are in Italy......)
3 - there is no iText low-level functions for do this?
I try with something like this:
PdfReader reader = new PdfReader("source.pdf"), null);
PdfStamper stp = PdfStamper.createSignature(reader, new
FileOutputStream("destination.pdf"), '\0', null, true);
X509Certificate certificate = getX509Certificate(idKey);
Certificate[] chain = { certificate };
Calendar signDate = new GregorianCalendar();
String fieldName = this.getCertificateLabel(idKey) + "_" +
signDate.getTimeInMillis();
PdfSignatureAppearance sap = stp.getSignatureAppearance();
sap.setSignDate(signDate);
sap.setCrypto(null, chain, null, null);
sap.setLocation("Italy");
sap.setAcro6Layers(true);
PdfSignature dic = new PdfSignature(PdfName.ADOBE_PPKLITE,
PdfName.ADBE_PKCS7_DETACHED);
String x509Name =
PdfPKCS7.getSubjectFields(certificate).getField("CN");
dic.setName(x509Name);
dic.setLocation(sap.getLocation());
dic.setDate(new PdfDate(sap.getSignDate()));
sap.setCryptoDictionary(dic);
//*****************here is the problem**********************
if (rectangle != null){
PdfWriter pdfWriter = stp.getWriter();
PdfFormField fieldSign = PdfFormField.createSignature(pdfWriter);
fieldSign.setValue(dic);
fieldSign.setFieldName(fieldName);
fieldSign.setWidget(rectangle, PdfAnnotation.HIGHLIGHT_NONE);
fieldSign.setFieldFlags(PdfAnnotation.FLAGS_READONLY);
stp.addAnnotation(fieldSign, 1);
stp.addAnnotation(fieldSign, 2);
}
sap.preClose(exc);
...
...
...
-----Messaggio originale-----
Da: mkl [mailto:m...@wir-sind-cool.org]
Inviato: martedì 13 agosto 2013 09:50
A: itext-questions@lists.sourceforge.net
Oggetto: [iText-questions] [SPAM] Re: display Signature info on EVERY page
Knezevich Marco,
Knezevich Marco wrote
> I am new in itext. After applying digital signature, I need to display
> a text with signature information on EVERY page and not only in one.
>
> I found the post in:
>
> http://itext-general.2136553.n4.nabble.com/display-Signature-in-Footer
> -of-every-page-td4237064.html
>
> where was written "It is possible to have widgets on multiple pages
> referring to the same signature field ......."
>
> Can someone tell me how can I do this?
Being the one who created that sample back then, I feel tempted to also throw
in my 2 cents...
First of all: Are you really sure you want to do it like it is done in the
sample provided in the thread you refered to
(http://itext-general.2136553.n4.nabble.com/file/n4237594/2274_2007_H_PROVISIONAL_-_multifield_-_Adobe.pdf)?
I ask because while it certainly looks good, at least if all those
visualizations were in some header or footer of the document with some
dedicated signature area, the legal value of such signatures may be
*diminished* by these multiple visualizations! (Depending on the legal system
of course) a paper signature may only sign everything "above" it, which
requires a single position, and such rules may be applied in parallel for these
digital signature visualizations.
Adobe expressed comparable concern in their *Adobe Acrobat SDK* document
*Digital Signature Appearances*:
> The location of a signature within a document can have a bearing on
> its legal meaning. For this reason, signature fields [created by Adobe
> software] never refer to more than one annotation. If more than one
> location is associated with a signature, the meaning may become ambiguous.
This might even be taken as a hint that Adobe reserve for themselves the option
to start showing a warning when displaying a PDF with such a multi-widget
signature or even a validation error due to the possible ambiguities; after
all, they have a history of becoming stricter in their signature validation
criteria.
On the other hand that document now is some five years old and nothing like
that had happened, and furthermore Leonard surely would have hinted at that
himself if such a change was imminent...
Now PDF-2 is approaching and most likely will explicitly restrict signature
fields to have a single visualization only.
This obviously can make Adobe use the option mentioned above and reject all
multi-widget signatures, even in PDF-1 documents.
...
If in spite of all these possible issues, you still are interested in creating
such signatures:
At the time I created that sample I merely did it on a prove-of-concept scale,
and I did not do it using iText alone. Actually I used iText only to add an
empty multi-widget signature field to some regular PDF stamper (I believe based
on a version 4.2 iText compilation):
PdfFormField addMultiAnnotationSignatureField(PdfStamper pdfStamper, String
name, float llx, float lly, float urx, float ury)
{
PdfWriter pdfStamperImp = pdfStamper.getWriter();
PdfAcroForm acroForm = pdfStamperImp.getAcroForm();
PdfFormField signature =
PdfFormField.createSignature(pdfStamperImp);
signature.setFieldName(name);
for (int page = pdfStamper.getReader().getNumberOfPages(); page > 0 ;
page--)
{
PdfFormField annotation = createAnnotation(pdfStamperImp);
acroForm.setSignatureParams(annotation, null, llx, lly, urx, ury);
acroForm.drawSignatureAppearences(annotation, llx, lly, urx, ury);
annotation.setPlaceInPage(page);
annotation.setPage(page);
annotation.remove(PdfName.FT);
signature.addKid(annotation);
llx += page * 5;
lly += page * 5;
urx += page * 10;
ury += page * 10;
}
pdfStamper.addAnnotation(signature, 1);
return signature;
}
and then signed using Adobe Acrobat (that's why Adobe appears in the file
name). This sufficed for a POC.
The iText signature API is not immediately able to sign such multi-annotation
signature fields, it assumes a single annotation which is merged into the
signature form field. This is where the actual work would start.
Due to the possible legal problems mentioned above, we didn't continue
developing this feature for our software here.
Regards, Michael
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/display-Signature-info-on-EVERY-page-tp4658892p4658901.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net<mailto:iText-questions@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/ Please check the keywords list
before you ask for examples: http://itextpdf.com/themes/keywords.php
AVVISO DI RISERVATEZZA Informazioni riservate possono essere contenute nel
messaggio o nei suoi allegati. Se non siete i destinatari indicati nel
messaggio, o responsabili per la sua consegna alla persona, o se avete ricevuto
il messaggio per errore, siete pregati di non trascriverlo, copiarlo o inviarlo
a nessuno. In tal caso vi invitiamo a cancellare il messaggio ed i suoi
allegati. Grazie. CONFIDENTIALITY NOTICE Confidential information may be
contained in this message or in its attachments. If you are not the addressee
indicated in this message, or responsible for message delivering to that
person, or if you have received this message in error, you may not transcribe,
copy or deliver this message to anyone. In that case, you should delete this
message and its attachments. Thank you.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php