Rich Text fields in PDF Forms

Does Aspose.PDF support filling of rich text fields in PDF Forms?

I tried setting the RValue on RichTextBoxField. I get nothing visible in the field when using RichTextBoxField, but I suspect I might have to set a flag and / or fiddle with the appearance.

Thanks,

Robin

Hi Robin,

Thanks for using our products.

I tested the scenario with below mentioned source code using Aspose.Pdf for .NET v6.8 and unable to find any issue in filling the RichTextBoxField. Resultant PDF document is attached for your reference. Kindly use the below code and check if it fits your need, if you still face any problem, kindly share the template document you are using with us. This will help us to identify the issue and reply back to you soon.

[C#]

Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form(@"d:\pdffiles\test.pdf", @"d:\pdffiles\output.pdf");
pdfForm.FillField("multilinetextfield", "A quick brown fox jumps over the lazy dog.");
pdfForm.Save();

For more details about working with forms, please visit the following documentation links:

Working with Forms

Working with Forms (Facades)

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

Your example works great, however I need to fill the rich text box with rich text. The rich text is in the form of html. If I set Value in the RichTextBoxField or use FillField, it just appears as html. If I set the RValue (as I do in this example), nothing appears in the field.

Thanks,Robin

Here is my example test

string htmlText = "" + "

" + "It is hereby understood and agreed that the Insured Name is amended to read as follows:" + "

";

var pdf = new Document("Common Policy Declarations with field.pdf");

var richTBF = pdf.Form["big_html_formatted_field"] as RichTextBoxField;

richTBF.RValue = htmlText;

pdf.Save("aspose rtf filled.pdf");

I see from this old post that setting the rich text value was not supported. Is it fixed now?

<a href="https://forum.aspose.com/t/121413</a></p>

Hi Robin,

Thanks for your feedback, the issue mentioned in your post has been fixed and this issue will be a part of Aspose.Pdf for .NET v6.9 (to be released in April as per our monthly release plan) after following the complete testing and release cycle. I have linked this forum thread with the appropriate issue and we will notify you once the version is available for download.

We apologize for your inconvenience.

Thanks & Regards,

The issues you have found earlier (filed as PDFNEWNET-9261) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

I have just created a rich text field in pdf, i wanna copy it with another rich-text in another pdf document. Does this change effect of texfield data… ?

<div><br></div><div><a href="http://www.sampleforms.org">forms</a></div>

Hi Williams,

Thanks for your interest in our products.

I tried to replicate the scenario using below source code with Aspose.Pdf for .NET v6.9 and unable to notice any problem while coping the text from one PDF field to another PDF field. Documents are attached for your reference. Kindly use the below code and check if it fits your need. If you still face any problem, kindly share the template documents and sample source code you are using with us. This will help us to identify the issue and reply back to you soon. We apologize for your inconvenience.

[C#]

Document pdfDocument = new Document(@"d:\pdffiles\test.pdf");<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

TextBoxField textBoxField = pdfDocument.Form["multilinetextfield"] as TextBoxField;

Document pdfDocument1 = new Document(@"d:\pdffiles\ToChange.pdf");

TextBoxField textBoxFieldChanged = pdfDocument1.Form["multilinetextfield"] as TextBoxField;

textBoxFieldChanged.Value = textBoxField.Value;

pdfDocument1.Save(@"d:\pdffiles\output.pdf");

Thanks & Regards,