GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureDocumentConverter Class / LoadFromFile Method
The file path of the source document.
A member of the DocumentFormat enumeration. Specifies a file format of the input document. Supported input document formats are listed here .

You can use a value of GdPicture14.DocumentFormat.DocumentFormatUNKNOWN if you are not sure about the document's format.

Example





In This Topic
LoadFromFile Method (GdPictureDocumentConverter)
In This Topic
This method loads the source document according to a file path you have specified.
Syntax
'Declaration
 
Public Function LoadFromFile( _
   ByVal FilePath As String, _
   Optional ByVal DocumentFormat As DocumentFormat _
) As GdPictureStatus
public GdPictureStatus LoadFromFile( 
   string FilePath,
   DocumentFormat DocumentFormat
)
public function LoadFromFile( 
    FilePath: String;
    DocumentFormat: DocumentFormat
): GdPictureStatus; 
public function LoadFromFile( 
   FilePath : String,
   DocumentFormat : DocumentFormat
) : GdPictureStatus;
public: GdPictureStatus LoadFromFile( 
   string* FilePath,
   DocumentFormat DocumentFormat
) 
public:
GdPictureStatus LoadFromFile( 
   String^ FilePath,
   DocumentFormat DocumentFormat
) 

Parameters

FilePath
The file path of the source document.
DocumentFormat
A member of the DocumentFormat enumeration. Specifies a file format of the input document. Supported input document formats are listed here .

You can use a value of GdPicture14.DocumentFormat.DocumentFormatUNKNOWN if you are not sure about the document's format.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
Remarks
The document's first page is automatically set as the current page after loading.
Example
Saving the source DOCX document as the resulting PDF document.
Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
    ' Loading the source document.
    gdpictureDocumentConverter.LoadFromFile("input.docx", GdPicture14.DocumentFormat.DocumentFormatDOCX)
    ' Saving as the PDF document.
    gdpictureDocumentConverter.SaveAsPDF("output.pdf", PdfConformance.PDF1_5)
End Using
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
    // Loading the source document.
    gdpictureDocumentConverter.LoadFromFile("input.docx", GdPicture14.DocumentFormat.DocumentFormatDOCX);
    // Saving as the PDF document.
    gdpictureDocumentConverter.SaveAsPDF("output.pdf", PdfConformance.PDF1_5);
}
See Also