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

Free Support Forum - aspose.com

Adding content to an existing DOC and saving as a PDF

I am working on an application that uses a starter Word document with existing content and appends dynamically generated content to it. Attached is the Word document. My app is supposed to add content right below the existing content (mainly just a text outline) found on this attachment. I tried several ways in your Programmer’s reference and API and so far I have not been able to find sample code to append new content to existing content found on a starter document. Please help!
Ivan

Hi
Thanks for your inquiry. You can try using the following code to achieve this.

Document doc = new Document("in.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
//move to end of document
builder.MoveToDocumentEnd();
//write text
builder.Write("Some content");
doc.Save("out.doc");

You can insert content into the document using MS Words and attach the created document here. Then I will help you to do this programmatically.
Best regards.

Thank you very much for your help. Your suggestion worked. If I encounter problems writing content to the starter template, I will certainly ask you. But my question does have two parts. The part I need to find out still is how I can save the completed document as a PDF file instead of a .DOC file.
Thanks!
Ivan

Hi
Thank you for your inquiry. You should use Aspose.Words and Aspose.Pdf assemblies to save document as PDF. See the following link for more information.
https://docs.aspose.com/words/net/convert-a-document-to-pdf/
Best regards.