I am trying to replace a text string in a PDF file but I'm finding that the output has scrambled text. I have attached the output PDF and the code is below.
I would appreciate any thoughts on how to resolve this one.
Thanks,
Scott.
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
Aspose.Pdf.Kit.PdfContentEditor editor = new Aspose.Pdf.Kit.PdfContentEditor();
editor.BindPdf(openFileDialog1.FileName);
editor.ReplaceText("replace", "jkl123 here is the new text");
I have tested this with my PDF and could not reproduce the error. Can you also provide us with your input file that you are having problems with. Also tell us how you created the input PDF.
I'm able to reproduce the error and have logged this as PdfKitNet-4848 in our issue tracking system. It is a known issue that the feature of replacing text is not quite stable in our product, so we need more time than general issues to solve the problem, and your patience will be appreciated.