Convert BMP to PDF
Contents
[
Hide
]
Convert BMP to PDF
Using Aspose.Imaging for .NET, developers can convert BMP to PDF formats. This article shows how to export/convert BMP file to PDF formats with Aspose.Imaging. Aspose.Imaging for .NET provides the Image class to load BMP files and same can be used to convert the BMP to PDF formats. The following code snippet shows you how to convert BMP to PDF image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Imaging; | |
using Aspose.Imaging.FileFormats.Bmp; | |
using Aspose.Imaging.ImageOptions; | |
using System.IO; | |
string templatesFolder = @"c:\Users\USER\Downloads\templates\"; | |
string dataDir = templatesFolder; | |
using (BmpImage image = (BmpImage)Image.Load(dataDir + "template.bmp")) | |
{ | |
Aspose.Imaging.ImageOptions.PdfOptions exportOptions = new PdfOptions(); | |
exportOptions.PdfDocumentInfo = new Aspose.Imaging.FileFormats.Pdf.PdfDocumentInfo(); | |
image.Save(dataDir + "result.pdf", exportOptions); | |
} | |
File.Delete(dataDir + "result.pdf"); |