Hello,
Thanks for your help! I've attached a sample application (VS 2008, .NET Framework 3.5 SP1, Aspose.Pdf.Kit 3.4.0.0). I've a pdf document (pdfDoc.pdf) in this application that I created with Adobe Acrobat 8.1. This document has two form fields: one that allows rich text format values and another that doesn't. You can open the document and see that in the form field that allows rich text format values I've a text with bold, underline and others format options enabled. The other field has a normal text value.
You can run the sample web application and browse to Default.aspx. You will have three choices (links):
1) . Read rich text field value with Aspose.Pdf.Kit
2) . Write rich text value with Aspose.Pdf.Kit
3) . Open the pdf document to submit
The first option read the document with Aspose.Pdf.Kit and tries to get the rich text value with a call to the method GetValue(). After that, the value is showed. Here I've my first problem: I can't get the rich text value from the field (I only get the normal, unformatted string).
The second option opens the document with Aspose.Pdf.Kit and tries to write a rich text value (XML) to the form field with a call to the method FillField(). After that, the resulting document is showed. My second problem: My rich text value is showed as a normal string, and not considered as a true rich value. But if you click inside the form field, the formatted string will show correctly!! And if you click outside, the XML string will appear again! That's weird! If you click inside and edit the value (add a space or something like that), it will remain as a true rich text value.
The third option shows the pdf document. Here I'd like to show that when clicking in the submit button of the document you will get the XML string for the form field that allows rich text format. Entering something like that in the form field
Rich Text
will allow me to get the following XML string after a submit:
<body xfa:APIVersion="Acroform:2.7.0.0" xfa:spec="2.1" xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><p dir="ltr" style="margin-top:0pt;margin-bottom:0pt;font-family:Helvetica;font-size:12pt;font-weight:bold">Rich Text</p></body>
So, my requirement is: I'd like to take the text entered in a form field that allows rich text format to save it in a database. So I must save the original XML string generated by Adobe. And I must also read the value from my database and show it in the pdf document with the original format. With Aspose.Pdf.Kit I can't read the rich text value from a form field (the XML string). And to write the value to a form field with the FillField() method, that's seems unsupported because the XML string is written as a normal text and Adobe doesn't appears to accept it very well as the sample application shows.
In short, are there any means with Aspose.Pdf.Kit to read and write rich text values to and from a form field?
If you need more information just let me know, ok?
Thank you very much for your time.
Regards,
André Machado