Load any file for conversion from a remote URL in C#

More...

To load and convert any file from a remote URL, use the LoadFromHttp method from the GdPictureDocumentConverter class. This method requires the following parameters:

  • HttpUri — A Uri variable pointing to any file.
  • DocumentFormat — The file format represented as a member of the DocumentFormat enumeration.

To load and convert an Excel file from a remote URL, use the following code:

using GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter();
// Create a `Uri` variable.
Uri fileUri = new Uri("https://pspdfkit.com/downloads/load-a-file/source.xlsx");
// Specify the file format.
GdPicture14.DocumentFormat format = GdPicture14.DocumentFormat.DocumentFormatXLSX;
// Load an Excel file from a URL.
gdpictureDocumentConverter.LoadFromHttp(fileUri, format);
// Save to a PDF document.
gdpictureDocumentConverter.SaveAsPDF(@"C:\temp\output.pdf");