Edit of PDF disturbing layout

Hello Team,

We are trying to edit pdf with one simple text, however the final output is not with proper layout.

Please find attached Test.pdf and the output file TestOutput.pdf. We have just wrote one line on top and the output file is not same as the original one.

testoutput.pdf (162.2 KB)
test.pdf (84.3 KB)

Please find below code.

string sourceFile = "test.pdf";
Aspose.Words.Document doc = new Aspose.Words.Document(sourceFile);
var builder2 = new DocumentBuilder(doc);

// Insert text at the beginning of the document.
builder2.MoveToDocumentStart();
builder2.Write("Morbi enim nunc faucibus a.");
doc.UpdatePageLayout();
doc.Save("testoutput.pdf"), Aspose.Words.SaveFormat.Pdf);

Thanks
Hardik

@hardikshah_cfirst Your colleague already reported a problem with this document while converting it to DOC in this thread.

Also, please note, Aspose.Words is designed to work with MS Word documents. MS Word documents are flow documents and they have structure very similar to Aspose.Words Document Object Model. On the other hand PDF documents are fixed page format documents . While loading PDF document, Aspose.Words converts Fixed Page Document structure into the Flow Document Object Model. Unfortunately, such conversion does not guaranty 100% fidelity.

If your goal is processing PDF documents, Aspose.PDF is the right product, since it is designed to work with PDF documents.