<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sohail</title>
    <description>The latest articles on DEV Community by Sohail (@sohailaspose).</description>
    <link>https://dev.to/sohailaspose</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F220360%2F1ec0e61c-5b08-435f-868b-98c806542e4f.jpeg</url>
      <title>DEV Community: Sohail</title>
      <link>https://dev.to/sohailaspose</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sohailaspose"/>
    <language>en</language>
    <item>
      <title>Convert Microsoft Word Document to Other Formats in C++</title>
      <dc:creator>Sohail</dc:creator>
      <pubDate>Thu, 21 Nov 2019 10:51:43 +0000</pubDate>
      <link>https://dev.to/sohailaspose/convert-microsoft-word-document-to-other-formats-in-c-3gm7</link>
      <guid>https://dev.to/sohailaspose/convert-microsoft-word-document-to-other-formats-in-c-3gm7</guid>
      <description>&lt;p&gt;Sometimes we need to programmatically convert Microsoft Word Document to PDF, HTML, EPUB or various other formats. But, most of the existing libraries require us to write a humungous amount of code. Moreover, complex documents are not converted correctly, either content is disturbed of the resulting document, fonts are missing, tables and lists are rendered incorrectly. &lt;/p&gt;

&lt;p&gt;Fortunately, &lt;a href="https://products.aspose.com/words/cpp"&gt;Aspose.Words for C++&lt;/a&gt;, a native class library, let us easily and reliably converts documents from one format to another. It just requires two lines of code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load a document into a &lt;em&gt;Document&lt;/em&gt; object using one of its constructors. By default, Aspose.Words will even auto-detect the file format for us.&lt;/li&gt;
&lt;li&gt;Invoke one of the &lt;em&gt;Document.Save&lt;/em&gt; methods on the &lt;em&gt;Document&lt;/em&gt; object and specify the desired output format.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Convert a Word Document to PDF
&lt;/h3&gt;

&lt;p&gt;To convert a Microsoft Word document to PDF simply invoke the &lt;em&gt;Document.Save&lt;/em&gt; method and specify a file name with the “.pdf” extension. The code sample below converts a whole document from DOC to PDF using default options.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Convert a Word Document to HTML
&lt;/h3&gt;

&lt;p&gt;To convert a Microsoft Word document to HTML simply invoke the &lt;em&gt;Document.Save&lt;/em&gt; method and specify a file name with the “.html” extension.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Export Fonts to HTML in Base64 Encoding
&lt;/h3&gt;

&lt;p&gt;Using Aspose.Words, we can check whether font resources should be embedded to HTML in base 64 encodings. By default, the value is false and fonts are written to separate files. If this option is set to true, fonts will be embedded into the document's CSS in Base64 encoding. The property affects only HTML format and doesn't affect EPUB and MHTML. This is an extension to &lt;em&gt;saveOptions-&amp;gt;set_ExportFontResources&lt;/em&gt; option and &lt;em&gt;ExportFontsAsBase64&lt;/em&gt; will work only if this property set to true. Below example shows how to export fonts to HTML in Base64 encoding.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;For more HtmlSaveOptions, please check the &lt;a href="https://docs.aspose.com/display/wordscpp/Converting+a+Document"&gt;documentation&lt;/a&gt; and &lt;a href="https://apireference.aspose.com/cpp/words/class/aspose.words.saving.html_save_options/"&gt;API Reference&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Convert a Document to EPUB
&lt;/h3&gt;

&lt;p&gt;The electronic publication (an EPUB) document is an HTML-based format commonly used for electronic book distribution. This format is fully supported in Aspose.Words for exporting electronic books compatible with the majority of devices used for reading. This code sample shows how to convert simple MS Word document to EPUB with a few lines of code.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;You may be wondering how to install Aspose.Words for C++ library. Please check &lt;a href="https://docs.aspose.com/display/wordscpp/Installation"&gt;this article&lt;/a&gt;, it provides step by step instructions to install the library.&lt;/p&gt;

&lt;p&gt;Conversion is just one feature of Aspose.Words for C++, please check the &lt;a href="https://docs.aspose.com/display/wordscpp/Home"&gt;Documentation&lt;/a&gt; to know about a number of other features.&lt;/p&gt;

&lt;p&gt;If you need any assistance regarding Aspose.Words for C++, please visit &lt;a href="https://forum.aspose.com/c/words"&gt;Aspose.Forums&lt;/a&gt;. You can create a new topic over Aspose.Words for C++ forums and your post will be answered within a few hours.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>api</category>
      <category>fileformat</category>
      <category>word</category>
    </item>
  </channel>
</rss>
