如何在.net中将pdf转换为位图图像?

时间:2010-02-10 18:55:35

标签: c# .net pdf bitmap

寻找将pdf文件的指定页面转换为位图图像的解决方案。

4 个答案:

答案 0 :(得分:1)

这可能会起到作用:

http://www.o2sol.com/pdf4net/products.htm

答案 1 :(得分:1)

我在之前的项目中做过这个。我们使用了ImageMagick.NET,它可能是最好的开源图像处理API的包装,ImageMagick

http://imagemagick.codeplex.com/

答案 2 :(得分:1)

从SourceForge下载PDFcreator。它是开源的,具有COM自动化组件,各种语言的示例代码。您可以使用PDFcreator打印机驱动程序以多种图形格式保存。

答案 3 :(得分:0)

(免责声明我在Software Siglo XXI上使用此组件)

如果您不想搞乱Ghostscript API并需要快速解决方案将PDF文档转换为光栅图像(PNG,JPG,...),您可以使用 Super Pdf2Image Converter .NET 。它适用于32位和64位,非常便宜和有效。

您可以在此处查看:http://softwaresigloxxi.com/SuperPdf2ImageConverter.html

例如,这是一个用于转换的示例代码:

// Instantiate the component
Pdf2ImageConverter p2i = new Pdf2ImageConverter(pdfPath);

// Get page count of a PDF file
int pages = p2i.GetPageCount();

// Get size of any page
int width, height;
p2i.GetPageSize(1, out width, out height);

// Convert any page of PDF to image file (preserving aspect ratio)
p2i.GetImage(outputImagePath, pageNumber, resolution, imageFormat);

// Or... convert any page of PDF to image (returns bitmap object)
Bitmap bm = p2i.GetImage(pageNumber, resolution, width, height, imageFormat);
相关问题