Load a bitmap (BMP) for conversion in C#
Bitmap
To load and convert a bitmap image 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 a bitmap image to convert.DocumentFormat— The file format represented as a member of theDocumentFormatenumeration.
To load and convert a bitmap image from your local storage, use the following code:
using GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter();// Specify the file format.GdPicture14.DocumentFormat format = GdPicture14.DocumentFormat.DocumentFormatBMP;// Load a bitmap image from a file.gdpictureDocumentConverter.LoadFromFile(@"C:\temp\source.bmp", format);gdpictureDocumentConverter.SaveAsPDF(@"C:\temp\output.pdf");Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter() ' Specify the file format. Dim format As GdPicture14.DocumentFormat = GdPicture14.DocumentFormat.DocumentFormatBMP ' Load a bitmap image from a file. gdpictureDocumentConverter.LoadFromFile("C:\temp\source.bmp", format) gdpictureDocumentConverter.SaveAsPDF("C:\temp\output.pdf")End Using