Gmane
Favicon Gravatar
From: Bruno Lowagie <bruno <at> lowagie.com>
Subject: Re: Making fields in a form read only
Newsgroups: gmane.comp.java.lib.itext.general
Date: 2006-01-06 12:54:43 GMT (3 years, 25 weeks, 4 days, 11 hours and 2 minutes ago)
Nitin Tomer wrote:

> Hi,
>
> I am using PDf forms for mapping a process in our organization. The
> first user in the process fills up the form and submits it and we
> initiate a work-flow. Now the requirements is that the second user in
> the work-flow must get a pre-populated form (from the data of the
> first user) so that he can edit the data. But some fields filled by
> the first user must be made un-editable (read only). 

Look for the methods setFormFlattening and setPartialFormFlattening.

For instance:
form = stamper.getAcroFields();
form.setField("field1", value1);
form.setField('field2", value2);
stamper.setFormFlattening(true);
stamper.setPartialFormFlattening("field2");

field1 will be editable.
field2 will be read only.

br,
Bruno

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click