Although iText does have all the necessary pieces to make it work...no one has 
written the code (yet).

Leonard

-----Original Message-----
From: Mark Storer [mailto:[email protected]] 
Sent: Monday, February 21, 2011 1:11 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Itext 5.0.6- Set richtext field with format e.g 
<Strong>Binod</Strong>

You cannot flatten rich text and expect it to appear, UNLESS THE
APPEARANCE IS ALREADY THERE.

The only way for that to happen is to open and save the PDF in Acrobat
(unless the form is Reader Enabled, in which case Reader will work).

There is no way to get field rich text values to work within iText
alone.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 

> -----Original Message-----
> From: aswartha.rupa [mailto:[email protected]] 
> Sent: Monday, February 21, 2011 3:11 AM
> To: [email protected]
> Subject: Re: [iText-questions] Itext 5.0.6- Set richtext 
> field with format e.g <Strong>Binod</Strong>
> 
> 
> Thank you, Mark.
> 
> I tried setting the acroFields.setGenerateAppearances(false) 
> resulting nothing being displayed on the form.
> 
> Please find the code snippet below ( you may please refer to 
> one of the examples available @ 
> http://itextpdf.com/examples/iia.php?id=157)
> 
>  public void manipulatePdf(String src, String dest) throws 
> IOException, DocumentException {
>         PdfReader reader = new PdfReader(src);
>         PdfStamper stamper = new PdfStamper(reader, new 
> FileOutputStream(dest));
>         stamper.setFormFlattening(true);
>         
>         
>         AcroFields form = stamper.getAcroFields();
>         form.setGenerateAppearances(false);
>         
>         form.setField("text_1", "<strong>Bruno Lowagie</strong>");
>         
>         form.setFieldProperty("text_2", "bordercolor", 
> BaseColor.RED, null);
>         form.setField("text_2", "bruno");
>         
>         stamper.close();
>    }
> 
> My understanding is that just setting the GenerateAppearances 
> to false is throwing away the field appearances. 
> 
> > 2a. That means you cannot flatten a rich value within iText without 
> > opening AND SAVING the PDF in acrobat (or reader if its been Reader
> > Enabled) first.
> 
> Can you please elaborate a bit more on this.
> 
> Thanks,
> Aswartha
> 
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/Itext-5-0-6-Set-ric
htext-field-with-format-e-g-Strong-Binod-Strong-> tp3310378p3317169.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --------------------------------------------------------------
> ----------------
> The ultimate all-in-one performance toolkit: Intel(R) 
> Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Many questions posted to this list can (and will) be answered 
> with a reference to the iText book: 
> http://www.itextpdf.com/book/ Please check the keywords list 
> before you ask for examples: http://itextpdf.com/themes/keywords.php
> 
> 

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to