Load any file for conversion in C#

More...

To load and convert any file from your local storage to a different file type, use the LoadFromFile method from the GdPictureDocumentConverter class. This method requires the following parameters:

  • FilePath — The path to the file to convert.
  • DocumentFormat — The file format represented as a member of the DocumentFormat enumeration.

The list of supported files is available on the Supported File Types page.

To load and convert an Excel file from your local storage, use the following code:

using GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter();
// Specify the file format.
GdPicture14.DocumentFormat format = GdPicture14.DocumentFormat.DocumentFormatXLSX;
// Load an Excel file from a file.
gdpictureDocumentConverter.LoadFromFile(@"C:\temp\source.xlsx", format);
gdpictureDocumentConverter.SaveAsPDF(@"C:\temp\output.pdf");