views:

569

answers:

1

I need to add some formatted text to a PDF form field using iTextSharp and I can't seem to figure it out. This is how I'm currently setting the fields, but certain portions of the inserted text will need to be bold or have other formatting.

stamper.AcroFields.SetField("fieldName", "fieldValue")
stamper.FormFlattening = True

I've seen elsewhere that I should be able to insert some xml that includes formatting information instead, but I have no idea what this xml should look like.

Here's the section from that page that leads me to believe that what I want is possible:

It still stamps the actual XML code onto the field and the Reader will not render it as rich text in the stamped PDF.

And the working response to this:

For that to work you'll have to call AcroFields.setGenerateAppearances(false). Note that older Reader versions don't generate appearances.

What should this xml look like, or is there another way to accomplish this?

A: 

I want to solve the problem too, Do you have the way to slolve it? if you have,please sent email to me:[email protected] I am chinese, my english is poor, thank you very much!

wind