[DocumentConverter] DOC to DOCX Conversion

Example requests & Code samples for GdPicture Toolkits.
Post Reply
Elodie
Posts: 33
Joined: Fri Sep 03, 2010 10:50 am

[DocumentConverter] DOC to DOCX Conversion

Post by Elodie » Fri Nov 13, 2020 11:56 am

Hello!

We have published a new article with a code sample to convert a DOC file to DOCX with the GdPicture.NET Document Converter:
https://www.gdpicture.com/blog/doc-docx-conversion

Here is the sample in C#:

Code: Select all

GdPictureStatus status;
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{ 
    status = gdpictureDocumentConverter.LoadFromFile("input.doc");
    if (status == GdPictureStatus.OK)
    {
         status = gdpictureDocumentConverter.SaveAsDOCX("output.docx");
         if (status == GdPictureStatus.OK)
         {
               System.Windows.MessageBox.Show("The file has been saved successfully.", "GdPicture");
         }
         else
         {
               System.Windows.MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "GdPicture");
         }
     }                      
     else
     {
          System.Windows.MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "GdPicture");
     }
}
You will find the documentation for the Document Converter here:
https://guides.gdpicture.com/content/Gd ... erter.html

Regards,

Elodie

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests