You have a broken PDF. I'm quite sure that your PDF doesn't have the
AcroForm dictionary. Acrobat manages to reconstruct it from the page
field annotations but iText can't do it.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Robert Esterer
> Sent: Tuesday, November 07, 2006 3:12 PM
> To: [email protected]
> Subject: [iText-questions] NeedAppearances & Fields
>
> Hello,
> It's me again with more problems regarding NeedAppearances.
> Yesterday I thought removing it would solve my problem (thanks to Mark
> Storer for the code and the warning about it being
> document-level) and it
> indeed makes the new signature visible but it also makes all the empty
> fields invisble in the "Signatures" tab (Acrobat).
> I've spent some time looking at what the Acrobat does and
> what iText does
> and just wanted to check if I understood it right.
>
> I have a PDF with 2+ empty signature fields. The PDF was
> created by adding
> eps files with pdfmarks code in an office document and
> converting them with
> distiller/ghostscript. The resulting PDF contains empty
> signature fields.
>
> BUT the PDF also contains the NeedAppearances flag. This
> causes the Acrobat
> to ask me if I want to save the document whenever I close it
> (even if I do
> nothing). Doing so causes the Acrobat to rebuild all
> signature fields. The
> resulting PDF looks identical to the old one but a) doesn't
> contain the
> NeedApperances Flag and b) now contains "real" objects (whatever that
> means).
> The saved document works fine with iText.
>
> BUT the unsaved (= newly created) PDF doesn't work with itext.
> One problem is that I can't seem to find any form fields
> (.getFields() and
> .getBlankSignatureNames() are epmty).
> Once I add an empty object using:
> PdfFormField field = PdfFormField.createEmpty(stp.getWriter());
> stp.addAnnotation(field, 1);
> stp.close();
> I can find all fields just fine.
> The other problem is that once I fill one field I have two
> possible outcomes
> (both of which are bad):
> a) I remove the NeedAppearance flag -> the new signature is
> visible, all
> other dissapear
> B) I leave the NeedAppearance and have an "invisible" signature.
>
> So, in order to make it work with iText I have to iterate
> through all fields
> and rebuild them into "real" objects before I save sign the
> PDF for the
> first time!?
> For now I can probably do this by reading the old signature fields
> properties, deleting it and creating a new one with the old
> ones properties
> (haven't tried it yet).
> But this won't cover other types of fiels. So the million
> dollar question
> is:
> Is there a way to tell iText to rebuild the appearance for
> all objects like
> the Acrobat does when you save it?
>
> Sorry for all the long text but this problem really got me
> worked up :(
>
> Any tips would be appreciated,
> -Robert
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions