Convert Word Doc to Other Formats in NPOI
Microsoft Word - Conversion to Other Formats
Documents can be converted to other formats using Save As option in File menu.
Aspose.Words - Convert Word Doc to Other Formats
To convert a document to other formats using Aspose.Words, simply invoke the save() method of Document class and specify a file name with the desired and supported extension.
Aspose.Words allows exporting or converting word documents to PDF, XPS, XamlFixed, XamlFlow, XamlFlowPack, EPUB, HTML, HtmlFixed, OpenXPS, PostScript, TXT and popular image/multimedia file formats including TIFF, JPG, PNG, BMP, SVG, SVG and SWF.
Converts a whole document from DOC to other formats using default options.
C#
Document wordDocument = new Document("Convert Word Doc to Other Formats.doc");
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.docx", SaveFormat.Docx);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.bmp", SaveFormat.Bmp);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.html", SaveFormat.Html);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.pdf", SaveFormat.Pdf);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.text", SaveFormat.Text);
NPOI HWPF XWPF - Convert Word Doc to Other Formats
C#
XWPFDocument wordDocument = new XWPFDocument( new FileStream("Convert Word Doc to Other Formats.doc", FileMode.Open));
using (FileStream sw = File.Create("data/Convert Word Doc to Other Formatsblank.docx"))
{
wordDocument.Write(sw);
}
Download Running Code
Download Convert Word Doc to Other Formats from any of the below mentioned social coding sites:
Download Sample Code
Download Convert Word Doc to Other Formats from any of the below mentioned social coding sites: