我怎么转换PDF到一个位图图像在.net中? [英] how do I convert a pdf to a bitmap image in .net?

查看:179
本文介绍了我怎么转换PDF到一个位图图像在.net中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Looking for solution to convert a specified page of a pdf file to a bitmap image.

推荐答案

(声明我在软件二十一世纪制作该组件)

如果你不想惹Ghostscript的API和需要快速有效的解决方案来转换PDF文档光栅图像(PNG,JPG,......),你可以使用超级Pdf2Image转换.NET 。它可用于32位和64位,是非常便宜和有效的。

If you don't want to mess with Ghostscript API and need a quick working solution to convert PDF documents to raster images (PNG, JPG, ...), you could use Super Pdf2Image Converter .NET. It's available for both 32 and 64 bit and is very cheap and effective.

您可以到这里看看: http://softwaresigloxxi.com/SuperPdf2ImageConverter.html

例如,这里有一个样品code转换:

For instance, here's a sample code for converting:

// 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);

这篇关于我怎么转换PDF到一个位图图像在.net中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆