GdPicture.NET.14
GdPicture14 Namespace / GdPictureDocumentConverter Class / SaveAsDOCX Method / SaveAsDOCX(String) Method
The file path where the converted file will be saved. If the specified file already exists, it will be overwritten.
Example





In This Topic
SaveAsDOCX(String) Method
In This Topic
This method converts the currently loaded document to DOCX and saves it to a specified file path.
Syntax
'Declaration
 
Public Overloads Function SaveAsDOCX( _
   ByVal FilePath As String _
) As GdPictureStatus
public GdPictureStatus SaveAsDOCX( 
   string FilePath
)
public function SaveAsDOCX( 
    FilePath: String
): GdPictureStatus; 
public function SaveAsDOCX( 
   FilePath : String
) : GdPictureStatus;
public: GdPictureStatus SaveAsDOCX( 
   string* FilePath
) 
public:
GdPictureStatus SaveAsDOCX( 
   String^ FilePath
) 

Parameters

FilePath
The file path where the converted file will be saved. If the specified file already exists, it will be overwritten.

Return Value

A member of the GdPictureStatus enumeration. If processing is successful, then the return value is GdPictureStatus.OK.
Remarks
You have to specify a full file path, including the file extension (.docx).
Example
Converting and saving a PDF document to a DOCX file.
Using gdpictureDocumentConverter As New GdPictureDocumentConverter()
    Dim status As GdPictureStatus = gdpictureDocumentConverter.LoadFromFile("input.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF)
    If status = GdPictureStatus.OK Then
        gdpictureDocumentConverter.DocxImageQuality = 80
        status = gdpictureDocumentConverter.SaveAsDOCX("output.docx")
        If status = GdPictureStatus.OK Then
            MessageBox.Show("The file has been saved successfully.", "GdPicture")
        Else
            MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "GdPicture")
        End If
    Else
        MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "GdPicture")
    End If
End Using
using GdPicture14;
            
using GdPictureDocumentConverter converter = new();
GdPictureStatus status = converter.LoadFromFile("input.pdf");
if (status != GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}
            
status = converter.SaveAsDOCX("output.docx");
if (status != GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}
            
Console.WriteLine("The input document has been converted to a docx file");
See Also