I've been able to temporarily get around the problem I sent in yesterday
(see below). By adding the TextFields to the document just before I
closed it, the blank pages disappeared and the hidden fields were
retained in the document. I was able to display the hidden field names
and getField values with another java class.
However, I'd like to keep this issue open because someone may wish to
attach a hidden field anyplace in a document without creating blank
pages.
INITIAL MESSAGE:
From: Mike Buchanan <mbuchanan <at> coastdist.com>
Subject: More hidden fields
<http://news.gmane.org/find-root.php?message_id=%3c3CD540B04D9E034BAB55F
25D053CEB2D026F739A%40COAST%2dEXCHANGE.coastdist.com%3e>
Newsgroups: gmane.comp.java.lib.itext.general
<http://news.gmane.org/gmane.comp.java.lib.itext.general>
Date: 2007-03-14 21:52:11 GMT (17 hours and 34 minutes ago)
OK, the checkboxes work great. Thanks Bruno. Now I have a form that
the users can easily update. My next idea is to load the form with some
hidden fields that contain critical information about the form that the
users can not see or change but will be retained with the document so it
can be read when the document is returned. I did some studying and saw
that you had changed the table on page 499 to use a TextField and
setVisibility(TextField.HIDDEN). I did this and I can read the hidden
field with code like on page 503 and it looks exactly like I want it to
look except now I get a blank empty page at the begging of the document.
The field does stay hidden but it is generating an extra page break.
// Create a hidden TextField with the Customer Number
TextField custText = new TextField(pdfWriter, new Rectangle(50, 50, 50,
50), null);
custText.setVisibility(TextField.HIDDEN);
PdfFormField custField = custText.getTextField();;
custField.setFieldName("CustomerNumber");
custField.setValueAsString(CUST_NBR);
pdfWriter.addAnnotation(custField);
-------------------------------------------------------------------------
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
Buy the iText book: http://itext.ugent.be/itext-in-action/