将PDF转换为JPG格式,如Photoshop质量 – 商业C + + / Delphi库

为了实现基于Windows的页面翻转应用程序,我需要能够将大量的PDF页面转换为高质量的JPG,而不仅仅是缩略图。

目的是为了达到最好的质量/文件大小,类似于Photoshops为Web保存做到这一点。

目前,我正在使用Datalogics的Adobe PDF库SDK,似乎不能完成这项任务。 因此,我正在寻找一个替代commcerical C ++或Delphi库,它提供了良好的质量/尺寸/速度。

在这里做一些search之后,我注意到大多数post都是关于GS&Imagekick的,我也testing过,但是我对输出和速度并不满意。

目标是导入300dpi的PDF文件,并将其转换成JPG质量50,1500像素的高度,输出尺寸为300-500kb。

如果任何人都可以指出一个好的图书馆来完成这个任务,我将是最伟大的。

Gnostice PDFtoolKit VCL可能是一个候选人。 转换为JPEG是其中的一个选项。

我总是推荐Graphics32来处理所有的图片操作需求; 你有几个resamplers可供选择。 但是,我不认为它可以读取PDF文件作为图像。 但是如果你能够自己生成大的图像,这可能是一个不错的选择。

Atalasoft DotImage (与PDF光栅插件)将做到这一点(我在那里工作的PDF技术)。 您将使用C#(或另一种.NET)语言工作:

ConvertToJpegs(string outfileStem, Stream pdf) { JpegEncoder encoder = new JpegEncoder(); encoder.Quality = 50; int page = 1; PdfImageSource source = new PdfImageSource(pdf); source.Resolution = 300; // sets the rendering resolution to 200 dpi // larger numbers means better resolution in the image, but will cost in // terms of output file size - as resolution increases, memory used increases // as a function of the square of the resolution, whereas compression only // saves maybe a flat 30% of the total image size, depending on the Quality // setting on the encoder. while (source.HasMoreImages()) { AtalaImage image = source.AcquireNext(); // this image will be in either 8 bit gray or 24 bit rgb depending // on the page contents. try { string path = String.Format("{0}{1}.jpg", outFileStem, page++); // if you need to resample the image, this is the place to do it image.Save(path, encoder, null); } finally { source.Release(image); } } } 

还有快速PDF库

看看DynaPDF 。 我知道它相当昂贵,但你可以尝试启动包。

PS:在购买产品之前,请确保它符合您的需求。