Load and convert various documents from URLs

Bitmap

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

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

To load and convert a bitmap image 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.bmp");
// Specify the file format.
GdPicture14.DocumentFormat format = GdPicture14.DocumentFormat.DocumentFormatBMP;
// Load a bitmap image from a URL.
gdpictureDocumentConverter.LoadFromHttp(fileUri, format);
// Save the PDF document to file.
gdpictureDocumentConverter.SaveAsPDF(@"C:\temp\output.pdf");