I haven't read the 2nd edition and it's been a while since the first, so I
can't comment on the book. I will, however, comment on PDF (and Acrobat).
PDF supports two forms technologies
* AcroForms - classic PDF forms technology available since PDF 1.2
* XFA - XML-based forms technology introduced in PDF 1.5
These can occur in a PDF in three different ways
* AcroForms only
* Static XFA - XFA for forms logic + AcroForms for presentation so
that content does NOT flow from page to page
* Dynamic XFA - XFA only (for both logic & presentation) and allows
flow from page to page.
All of this is fully documented and described in ISO 32000-1 and associated
documents and has been this way for many years.
If you wish to have a form that "return xml type data, allow local saving of
forms, but be able to add contentUnder()" - that would be option #2, Static
XFA. HOWEVER, in order to do what you want, you would need to apply the "local
saving rights" AFTER you did the "add contentUnder()", since the rights don't
include modifying the page content. But if you modified first and then
applied the rights, it works great. There are numerous people/organizations
around the world that have systems in place and doing this.
Leonard
From: John Renfrew [mailto:[email protected]]
Sent: Friday, June 04, 2010 12:45 AM
To: [email protected]
Subject: Re: [iText-questions] AcroForm learning
It does. Thank you.
In the book though it refers a lot to Acroforms which have an XFA counterpart.
Is this to suggest that there is some form of hybrid document or is this
ultimately a bit misleading. And presumably if there are both and I amend
something then it is also 'broken' in Adobe land.
As you are working on the next generation of Acrobat should it not make sense
to simplify this whole area so that we can return xml type data, allow local
saving of forms, but be able to add contentUnder() - which is not playing with
the fields at all etc etc???
>> AcroForms FULLY supports a comb field type and also provides a rich
>> JavaScript DOM for date validation (and many other things).
I am sure it does, BUT Livecycle does that for me. I am NOT a Java programmer,
and nor do most people posses the skills to pick this up quickly enough to make
AcroPro respond like it.
Maybe it would be helpful in the book to have some simplified notation that
indicates which parts of code work in which flavours. I struggled at first with
the syntax between writer and stamper for the very same reason. While there is
help here, it usually involves 'read the book' which is OK if it were not
therefore a self-help exercise. Notation that indicates that this code works in
XFA and this in Acro after the clearer explanation you have given could lead to
better learning.
john renfrew
Right Way Up
Office +44 1675 475341
Fax +44 1675 475342
Mobile +44 7767 443992
From: Leonard Rosenthol [mailto:[email protected]]
Sent: 04 June 2010 04:49
To: [email protected]; Post all your questions about iText here
Subject: RE: [iText-questions] AcroForm learning
I think you are getting a bunch of things mixed up here. The issues with
Reader Extensions have NOTHING to do with forms - they have to do with the
rights that you've been granted on the file. The rights are limited and they
do NOT include modifying the page contents (aka stamping & flattening). Even
though you made the changes outside of the "Adobe workflow" (which is perfectly
fine), Reader doesn't know that (of course) and so it thinks you violated your
rights and so it reports the breakage.
Now on to forms....
AcroForms FULLY supports a comb field type and also provides a rich JavaScript
DOM for date validation (and many other things).
However, to your question - YES - if you work with XFA, then you work with XFA.
If you work with AcroForms, you work with AcroForms. You can't "cross the
streams'.
Does that help!?!?
Leonard
From: John Renfrew [mailto:[email protected]]
Sent: Thursday, June 03, 2010 11:46 AM
To: [email protected]
Subject: Re: [iText-questions] AcroForm learning
So...
If I do any design in LiveCycle at all I am unable to setFieldProperties(), as
my form has XFA in it, even if it is a static PDF. But the tools in Acrobat Pro
are quite limited in comparison i.e. comb of characters or validation of dates.
Is there a way to remove the XFA BEFORE I set extended privileges in Acrobat?
If I extend Reader in AcrobatPro I am unable to do anything other than fill in
the fields without breaking the document (in the sense that I am unable to
programmatically edit a blank template PDF from a database and send it to a
student for them to fill and save)
I get the Reader thing a bit, BUT if I have set extended privileges first then
I have paid the money to Adobe so surely this is not the same thing as creating
a reader enabled form from scratch somewhere else???
Am I therefore COMPLETELY unable to either stamp text under content OR
partially flatten my form is there is ANY xfa in it at all???
john renfrew
Right Way Up
Office +44 1675 475341
Fax +44 1675 475342
Mobile +44 7767 443992
From: John Renfrew [mailto:[email protected]]
Sent: 03 June 2010 17:21
To: [email protected]
Subject: Re: [iText-questions] AcroForm learning
Mark
Thanks for the input... Some helpful pointers
The problem with an infinite library is not that the information is not there,
it is knowing what to search for to yield profitable results...
Some evening reading is in order.
john renfrew
Right Way Up
Office +44 1675 475341
Fax +44 1675 475342
Mobile +44 7767 443992
From: Mark Storer [mailto:[email protected]]
Sent: 03 June 2010 17:02
To: [email protected]; Post all your questions about iText here
Subject: RE: [iText-questions] AcroForm learning
A: As Bill mentioned, partial form flattening.
http://api.itextpdf.com/com/itextpdf/text/pdf/PdfStamper.html#partialFormFlattening(java.lang.String)
String names[] = {...}
for(String name : names) {
myStamper.partialFormFlattening(name);
}
Only those fields passed to partialFormFlattening will be flattened.
Alternatively, you can set the fields to read-only rather than flattening them:
for(String name : names) {
myAcroFields.setFieldProperty(name, "setfflags", PdfFormField.FF_READ_ONLY,
null);
}
B: There have been several questions regarding the preservation of Extended
Rights on the list. I suggest scanning one of the archives scattered around
the web. Google sees all, knows all.
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
________________________________
From: John Renfrew [mailto:[email protected]]
Sent: Thursday, June 03, 2010 5:17 AM
To: [email protected]
Subject: [iText-questions] AcroForm learning
I have successfully inserted database fields into a form with Acrofields using
the form.setField() method
I have a separate snippet which uses the contentByte method to add some text
with setMatrix(), and a barcode as a cell in a table and then uses write
selectedRows method to add this to the cb
Of course if I do the second to a form where I have done the first it then
tells me extended features are no longer available.
Hmm. Could you point to the bits of the second book I need to read next??
Or
Is it possible to selectively lock (flatten) fields on a form - so say the
surname is fixed, but someone could edit/enter the first name??
john renfrew
Right Way Up
Office +44 1675 475341
Fax +44 1675 475342
Mobile +44 7767 443992
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.829 / Virus Database: 271.1.1/2913 - Release Date: 06/02/10
23:25:00
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/