AcroFields.SetFieldRichValue Question

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

AcroFields.SetFieldRichValue Question

Abronits Péter

Dear Support,


We are loooking for a solution for generating PDF documents using predesigned PDF forms (04_Form.pdf).

We tried to insert some rich-text, but plain text displayed in PDF reader.


PDF field settings in Adobe Acrobat DC application (04_Form.pdf):





Rich-Text (src: reqgen.Destination):

<?xml version="1.0"?><body xmlns=""


xfa:contentType="text/html" xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.4">

    <p style="text-align:left">



                Here is some bold italic text




    <p style= "font-size:10pt">

        This text uses default text state parameters but changes the font size to 16.



Here is some bold italic text

This text uses default text state parameters but changes the font size to 16.


Result (131012226107252443.pdf):


Source code:

using (PdfReader pdf = new PdfReader(ApplicationState.Templates["04_Form"]))

using (MemoryStream ms = new MemoryStream())


    using (PdfStamper stamper = new PdfStamper(pdf, ms))


         //stamper.AcroFields.GenerateAppearances = false;

         stamper.AcroFields.SetFieldRichValue("Destination", reqgen.Destination);

         stamper.FormFlattening = true;






After setting the GenerateAppearances property to false

stamper.AcroFields.GenerateAppearances = false;


text doesn’t apperar:



Abronits, Péter

Technikai projektvezető / Technical Team Lead


Grape Solutions Zrt.

Telefon / Phone: +36 1 880 9200 | Fax: +36 1 880 9201

Cím / Address: H-1034 Budapest, Bécsi út 58 I. em. | Web:


Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
iText-questions mailing list
[hidden email]

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book:
Please check the keywords list before you ask for examples:

131012226107252443.pdf (1M) Download Attachment
04_Form.pdf (1M) Download Attachment