Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active January 19, 2024 10:46
Show Gist options
  • Save aspose-com-gists/93780c7f5b81c1798d952f8a2cef61f9 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/93780c7f5b81c1798d952f8a2cef61f9 to your computer and use it in GitHub Desktop.
Convert Picture to Word in C# | C# Photo to Word Converter
// This code example demonstrates how to convert a picture to a Word document!
using Aspose.Words;
// create new document
Document doc = new Document();
// create and initialize document builder
DocumentBuilder builder = new DocumentBuilder(doc);
// insert picture to the document
builder.InsertImage("C:\\Files\\tower.jpg");
// save the document
doc.Save("C:\\Files\\Output.docx");
// This code example demonstrates how to insert a picture into a Word document!
using Aspose.Words;
// create new document
Document doc = new Document("C:\\Files\\Document.docx");
// create and initialize document builder
DocumentBuilder builder = new DocumentBuilder(doc);
// move to the end of the document
builder.MoveToDocumentEnd();
// insert a new page
builder.InsertBreak(BreakType.PageBreak);
// insert picture to document
builder.InsertImage("C:\\Files\\tower.jpg");
// save the document
doc.Save("C:\\Files\\Output_1.docx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment