-------------- Original message ----------------------
From: Peter Demling <[EMAIL PROTECTED]>
>
> Thanks very much for the replies, Bill & Bruno (I'm not above
> doubling-down on the ice-cream offer!).
> 
> Bruno, your suggestion of removing the XFA before filling the form (with the
> questions.forms.RemoveXfa code) is a good one: unfortunately, our workflow
> requires that the form is user-enabled before it's populated by iText.  I just
> ran RemoveXfa to confirmed the expected behavior: removing the XFA breaks
> pre-existing user-enabling (because the PDFStamper constructor does not 
> append); but removing the XFA with append=true in the PDFStamper constructor
> prevents any value from being set.
> 

Peter, I think the way to do this is to remove the XFA before using Acrobat to 
Reader-Enable the form, i.e. Reader-Enabling the form must be the last step 
after all other changes to the form. You shold then be able to use PdfStamper 
to populate the fields, with append parameter = true. Please try this and let 
us know what happens.

> FYI, user-enabling the form before pre-filling is required because our 
> workflow
> goes something like this:
> 

I don't have a copy of Acrobat Pro 8 with which to Reader-Enable forms. I do, 
however, have a couple of Reader-Enabled AcroForms, one of which is The Rotary 
Foundation's Global Contribution Form, a copy of which I can provide for your 
experimentation (and use to make a contibution, if you wish).

>  1. User requests download of user-enabled pdf form
>  2. Servlet pre-populates form with some of the values (header-type info)
>  3. Servlet downloads pre-populated, user-enabled form to user
>  4. User edits and saves, edits and saves offline (<500 users)
>  5. User uploads form to processing servlet
> 

The other AcroForm that I had mentioned previously is in a sandbox on my Tripod 
site. I can move a copy of it into the directory there for you, temporarily, if 
you'd like to see how the use of it online or offline does not break the 
Reader-Enabled feature.

Neither of the above-cited PDFs started out as an XFA form, IIRC.

> So since this is an on-demand servlet download, we can't stop between steps 2
> and 3 to add user rights to the form.  As to the other options:
> 

IMO, you shouldn't have to do this if the AcroForm (with XFA removed) is 
Reader-Enabled before you deploy it.

>  - I looked at LiveCycle ES, but it's not implementable for us at this late 
> date;
> 
>  - A different PDF client that can read and save forms locally is something I
> hadn't thought of.  From this suggestion, I just saw a list of these options 
> at
> http://en.wikipedia.org/wiki/List_of_PDF_software .  Realistically though, 
> Adobe
> Reader is the universal cross-OS pdf client on our intranet devices, so at 
> this
> date, I'm more inclined to pursue some flavor of the following:
> 

A while back, I built a demo that worked with the AcroForm displayed in one 
frame in the browser, an automatically-generated HTML form alongside that was 
equivalent to the AcroForm, and a third frame on the bottom to display the 
FDF/XFDF generated by a server-side script. It worked like a charm, but would 
not be practicable, IMO, because of the restrictions of the Reader EULA. Note: 
my demo used Reader 4, which did not have the same EULA as more recent versions.

> - Generate a non-XFA, pure AcroForm instead.  To skip to the end of the 
> story, a
> couple of the old XFA->Acro conversion hacks no longer work in Acrobat 8, but 
> I
> did achieve partial success last night: if you do a File->Print of the XFA 
> Form
> and send it to AdobePDF (which is available as a "Printer" when you install
> AcrobatPro), it will create a flattened PDF file that looks exactly like the 
> old
> XFA form (come to think of it, I could have just used iText to flatten it,
> eh?).
> 

Yes.

> From there, I used the tools at "Tools->Forms" to manually add an input text
> Field, 

then Reader-Enabled the AcroForm,

> and presto: pure AcroForm that works with multiple offline saves.  Now
> all I have to do is sit with my designer co-worker and re-create all of the 
> form
> fields in this way (I really must be missing something in the tool though,
> because I'm finding this manner of Acrobat form creation to be quite crude – 
> did
> people really used to design forms this way?).
> 

It seems Acrobat 8 Pro might have a rudimentary tool for automating the 
generation of form fields, as the Reader-Enabled PDF form at 
http://www.sar.org/membership/application.html appears to have been done with 
this tool. The staff person who generated the AcroForm, for some reason, didn't 
want anyone to know who actually Reader-Enabled the AcroForm, but I do know 
that the blank PDF form starts with the master that is used by the Society's 
commercial printer for the printing of pre-printed paper application forms.

The one that you see that has my name attached to it has not been 
Reader-Enabled, although if you were to do that for me and send it to me as an 
attachment to a private email, I would be grateful.

> So I'm also going to try and quickly evaluate the
> JPedal/Scribus/RenderX/Open Office tools you mentioned to make this conversion
> easier.  I also read a claim last night that Acrobat9 can do XFA->Acro
> conversion, but this is yet to be confirmed (Bill, it sounded like you create
> AcroForms directly - any suggestions?).
> 

Yes, in some cases. In the case of the NSSAR application form on my Tripod 
site, http://segraves.tripod.com, I built the entire AcroForm with a modified 
version of the TextFields example from the book, using a build-a-little, 
test-a-little, incremental process. I used Acrobat 3 as the viewer and gVim 
(with the Pdftk plugin), as both an inspector and as the editor. I can give you 
the userpw, if it would be helpful for you to get a look at it. Just fill out 
the registration form on my Tripod site, submit it, and send me the FDF (as an 
email attachment) that is generated by the server-side script.

BTW, it would be interesting to see if the password-protected AcroForm could be 
successfully Reader-Enabled with Acrobat 8. I expect it can, as the AcroForm 
that I did for the General Society of the War of 1812 was successfully 
Reader-Enabled after I did my modifications to give it "actions".

> Thanks you again for your assistance.  I'll post a follow-up if I'm able to
> successfully complete the XFA form conversion to Acro
> (or if I'm not successful!).
> 
> Regards,
> -Peter Demling
>  Lexington, MA

You're very welcome. I hope you are able to get past the problems you're having 
with your PDF form.

Best regards,
Bill Segraves


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to