Learn how to convert a picture to a Word document in C#.
https://blog.aspose.com/words/convert-picture-to-word-in-csharp/
This article covers the following topics:
Learn how to convert a picture to a Word document in C#.
https://blog.aspose.com/words/convert-picture-to-word-in-csharp/
This article covers the following topics:
| // 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"); |