AcroFields.SetFieldRichValue Question

Previous Topic Next Topic
 
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):

cid:image001.png@01D172F5.277C5A30

 

cid:image002.png@01D172F5.277C5A30

 

Rich-Text (src: reqgen.Destination):

<?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xtml"

xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"

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

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

        <b>

            <i>

                Here is some bold italic text

            </i>

        </b>

    </p>

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

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

    </p>

</body>

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;

         stamper.Close();

         pdf.Close();

    }

}

 

After setting the GenerateAppearances property to false

stamper.AcroFields.GenerateAppearances = false;

 

text doesn’t apperar:

 

Thanks,

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: www.grape.hu

 


------------------------------------------------------------------------------
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!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

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: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php

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