Convert BMP to PDF | C#
Contents
[
Hide
]Convert BMP files to PDF document using Aspose.PDF for .NET library.
BMP images are Files having extension. BMP represent Bitmap Image files that are used to store bitmap digital images. These images are independent of graphics adapter and are also called device independent bitmap (DIB) file format. You can convert BMP to PDF files with Aspose.PDF for .NET API. Therefore, you can follow the following steps to convert BMP images:
- Initialize a new Document
- Load input BMP image
- Finally, save the output PDF file
So the following code snippet follows these steps and shows how to convert BMP to PDF using C#:
Initialize empty PDF document
using (Document pdfDocument = new Document())
{
pdfDocument.Pages.Add();
Aspose.Pdf.Image image = new Aspose.Pdf.Image();
// Load sample BMP image file
image.File = dataDir + "Sample.bmp";
pdfDocument.Pages[1].Paragraphs.Add(image);
// Save output PDF document
pdfDocument.Save(dataDir + "BMPtoPDF.pdf");
}
Applies to
Platform | Supported |
---|---|
.NET | 2.0-4.6 |
.NET Core | 2.0-3.1 |