如何使用Ghostscript将PDF转换为图像 [英] How to use Ghostscript for converting PDF to Image

查看:927
本文介绍了如何使用Ghostscript将PDF转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现Ghostscript能够将PDF转换为图像格式。

I found that Ghostscript is able to convert PDF to Image format.

我试过 PDF到图像转换器但无法清楚地理解它。

I tried PDF to Image Converter but not able to understand it clearly.

我已安装 gs905w64.exe 但当我尝试添加引用到我的Web应用程序时我收到此错误。

I have installed gs905w64.exe but when I tried to add reference to my web application I am getting this error.

无法添加对gsdll32.dll的引用。在组件中找不到类型库。

推荐答案

您可以使用C#运行GhostScript命令行或使用Platform Invoke(pInvoke)调用直接调用GhostScript dll。

You can use C# to run the GhostScript command line or use Platform Invoke (pInvoke) calls to call the GhostScript dll directly.

GhostScript主要基于文件,因此输入是磁盘上文件的路径和输出是在磁盘上创建文件。用于调用dll或exe的参数基本相同,因此直接调用dll没有太大的好处,但确实可以生成更好的代码。

GhostScript is primarily file based, so the input is path to a file on disk and the output is the creation of files on disk. The parameters used to call either the dll or exe are basically the same, so there is not a huge benefit to calling the dll directly, but does make for nicer code.

我有C#包装器可以用来调用ghostscript dll,如果你给我发电子邮件(地址在个人资料上)我会发给你。

I have C# wrapper that can be used to call the ghostscript dll, if you email me (address on profile) I will sent it to you.

HTH

更新:

代码回购移至 https://bitbucket.org/brightertools/ghostscript

这篇关于如何使用Ghostscript将PDF转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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