I have been trying to accomplish this but no success
till now. Can you please help me in
1. Changing the font size to 6 for all the fields
2. Making all the fields as read only..
3. What parameter to pass for PdfReader, please see my
code below.
4. Is it simple to change the font size of the entire
table or to use AcroFields instead. Can you or someone
also look for this thread with subject" Font size for
entire table" I am really getting confused
Here are the parts of my code..Please let me know
where I am going wrong.
******************************************************
Document doc=new Document(PageSize.LEGAL.rotate...)
ByteArrayOutputStream baosPDF = new
ByteArrayOutputStream();
ByteArrayOutputStream completedPDF = new
ByteArrayOutputStream();
PdfWriter docWriter = null;
docWriter = PdfWriter.getInstance(doc, baosPDF);
PdfPTable datatable = new PdfPTable(21);
//Create the table ......
doc.add(datatable);
Now since my table is huge(spans many columns, I am
trying to make the font size to be small + I have to
make this as a readonly file. I have already posted a
question( for font size) but did not get an answer so
far, so I tried using AcroFields( both for font size
and for readonly).
PdfReader reader = new PdfReader(??);
PdfStamper stamper = new PdfStamper(reader,
completedPDF);
AcroFields form = stamper.getAcroFields();
HashMap formFields = form.getFields();
Set formFieldNames = formFields.keySet();
Iterator nameIterator = formFieldNames.iterator();
while (nameIterator.hasNext()) {
String fieldName = (String) nameIterator.next();
String fieldStringValue= form.getField(fieldName);
form.setFieldProperty(fieldName, "textsize",new
Float(6), null) ;
form.setFieldProperty(fieldName,"setfflags",PdfFormField.FF_READ_ONLY,
null) ;
form.setField(fieldName, fieldStringValue);
}
stamper.setFormFlattening(true);
stamper.close();
document.close();
docWriter.close();
return completedPDF;// this is then to outputstream.
Thanks
Ekta
--- Paulo Soares <[EMAIL PROTECTED]> wrote:
> Do it for all the fields.
>
> ----- Original Message -----
> From: "Ekta Ojha" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Thursday, June 30, 2005 6:02 PM
> Subject: RE: [iText-questions] setting fields to
> read-only
>
>
> What if I need to have my entire pdf file as read
> only
> ?
> Do i need to iterate over all the field names ?
>
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions