We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How do you manage a carriage return?

Here is a sample code:

Document pdfDocument = new Document(fileName);

PdfForms.Field formField = pdfDocument.Form[fieldName] as PdfForms.Field;

PdfForms.TextBoxField textBoxField = formField as PdfForms.TextBoxField;

textBoxField.Value = value;

Value is of type string and contains a carriage return (\r\n).
The problem is that the result doesn’t show the carriage return.
I have also tried to replace \r\n by just \r, not better.

Please let me know how I should handle this.

Thanks.

Hello

				<span id="ctl00_bcr_up___TextboxFirstName">Jean-Christophe,<br><br>Thanks for using our products.<br><br>In order to add carriage return, simply use \n but ensure that the target field is Multiline enabled. In case you still face any problem, can you please share the source PDF and the code snippet so that we can test the scenario at our end. We apologize for your inconvenience.<br></span>

I have attached a PDF form. The field is "Applicant" and it is a multi-line text field

Here is the sample code:

Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form("pf0177.pdf", "test.pdf");
pdfForm.FillField("Applicant", "This is a multiline\naddress\ntest");
pdfForm.Save();

Please let me know why the two \n are not displayed correctly.

Thanks.

Hello

				<span id="ctl00_bcr_up___TextboxFirstName">Jean-Christophe,</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br><br>I

have tested the scenario and I have observed that carriage return \n is causing an issue with new Aspose.Pdf for .NET 6.1.0. However it seems to be properly working with Aspose.Pdf.Kit 5.7.0. As per my understanding, the problem seems to be introduced during products merging. For the
sake of correction, I have logged it in our issue tracking system as <span style=“font-family:“Arial”,“sans-serif””>PDFNEWNET-30016. We
will investigate this issue in details and will keep you updated on the status
of a correction.<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA”>We apologize for your inconvenience.

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


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