Insert pdf document into word document

Can we insert / append a PDF document into a Word (.docx, or .odt) document with Aspose.Words assembly?
If so can you give a simple example.
Otherwise can you mention a close alternative to the scenario, such as extracting pdf data into a new doc…

Thanks in advance,
Remus

@Remus87 Aspose.Words for .NET supports loading PDF documents. So you can simply use the following code to append PDF document content to MS Word document:

Document doc1 = new Document(@"C:\Temp\1.docx");
Document doc2 = new Document(@"C:\Temp\2.pdf");
doc1.AppendDocument(doc2, ImportFormatMode.KeepSourceFormatting);
doc1.Save(@"C:\Temp\out.docx");

But 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.

Works fine, thanks.
Yes, expected to be some minor formatting adjustments.

1 Like