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

Free Support Forum - aspose.com

Replace text where replacement includes new line

Hello,

We are editing a PDF with Apose.PDF for .NET and running into an issue. When trying to replace text the new line isn’t getting inserted. Is there a way to insert a new line when replacing text?

Here’s the code I am using:
https://gist.github.com/dannycabrera/ffd642817184d2291ce36939d6f2e4d6

C# method call:

ReplaceText(@“C:\LoremIpsum3Paragraphs.pdf”, @“C:\LoremEdited.pdf”, “Vestibulum quis euismod justo, in ornare metus”, “Vestibulum quis euismod justo, in ornare metus\rThis is my new line”);

Here’s the output: https://www.dropbox.com/s/l6t9q7amv51x90r/AsposePDF.png?dl=0

Sample PDF: https://www.dropbox.com/s/hf7jsofehdbmi5r/LoremIpsum3Paragraphs.pdf?dl=0

@MDnetwork

Thanks for contacting support.

We were able to replicate the issue in our environment and logged it as PDFNET-44971 in our issue tracking system. We will further look into details of the issue and keep you updated with the status of its rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.

Thanks. Any known workaround for this?

@MDnetwork

As the issue has recently been logged in our issue tracking system, it is pending for investigation. I am afraid we cannot offer any workaround for now. However, as soon as we have some significant updates regarding issue investigation, we will let you know. We are sorry for the inconvenience.