> Actually I have XFA form which are designed in Adobe designer
> 7.0 and these pdf are enabled with Adobe LiveCycle Reader
> extension, therfore user can can fill, sign and save
> information on this pdf for Adobe Reader.
> Now I want to used iText for getting data into this pdf to be
> filled automatically from the database and produce thousands of pdfs.
> I have also prepared the test code to do this stuff (taken
> help from Paulo), to check whether I can do this stuff.
If all you want to do is fill in form data, may I suggest you store the data in
an FDF or XDP rather than in seperate PDFs. These files allow you to specify
field/value pairs, and a reference to the form (a URL).
If you're worried about loosing the original, an XDP can also contain a full
copy of the form, plus a 'data set'. 6.0 and later versions of Adobe's viewers
(Reader, Acrobat [Pro]) can open these XDPs. In fact, 6.0 may not be able to
open an XDP using a URL instead of a copy of the PDF (I haven't tested it).
> The problem now I m facing is, when I fill the data into this
> pdf, the resulting pdf is showing the error : "This document
> contained certain rights to enable special features in adobe
> reader.The document has been changed since it was created and
> these right are no longer valid" before opening
The only thing I can think of that MIGHT save you is to change your
PdfStamper's constructor call like this:
PdfStamper stamp = new PdfStamper(reader,new FileOutputStream(
"C://stamped.pdf"), true);
By setting the output method to "append", you just might preserve the
'Reader-enabled-ness' of the PDF... but probably not.
You can also drop the "PdfCopy" altogether... You don't do anything with it
before it goes out of scope (in this snippet anyway).
> the pdf
> has lost its original features like now I cannot enter the
> the data anymore in the fields which are left vacant for
> other employees to fill in and even the other buttons like
> drop down buttons have gone, they no more visible.
>
That's because you're flattening the PDF. Once flattened, it's not a form any
more, it just looks like one. iText's flattening also has issues (or at least
did) with button-based fields (push bottons, check boxes, and so forth). If
you want it to still be a form when you're done, remove the following:
stamp.setFormFlattening(true); // DELETE ME
If Paulo knew your form was reader-enabled, I suspect he had you add this line
because he knew this process would break it.
Reader just might be smart enough to leave the PDF "reader enabled" if all you
change are some field values, but I wouldn't count on it.
I STRONGLY recommend that you stick with an FDF or XDP... Keep your data
outside the PDF. Have a look at iText's FdfWriter class... Remeber to use the
full field name
("MCD[0].RoHSpage1[0].RequestInformation[0].RequestContactName[0]").
An XdpWriter shouldn't be too hard to build, though I'm not volunteering. ;)
--Mark Storer
Senior Software Engineer
Cardiff.com
#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions