获取ghostscript编译好的库
时间: 2023-08-28 09:06:58 浏览: 39
你可以在Ghostscript官网的下载页面 [https://www.ghostscript.com/download/gsdnld.html](https://www.ghostscript.com/download/gsdnld.html) 上下载Ghostscript的源代码。下载完成后,按照以下步骤进行编译:
1. 安装Visual Studio 2019和CMake 3.15或更高版本。
2. 打开命令行窗口并切换到Ghostscript源代码目录。
3. 运行以下命令:
```
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A x64 ..
cmake --build . --config Release
```
这将生成Ghostscript的编译结果,包括库和可执行文件。
4. 找到`build`目录下的`bin`子目录,将其中的Ghostscript库文件复制到你的工程目录中。
5. 在你的工程中链接Ghostscript库,并在代码中调用Ghostscript API。
希望这可以帮助到你。
相关问题
windows平台编译好的ghostscript库
Ghostscript是一个开源的PostScript和PDF解释器,可以用于处理和转换PDF文件。Ghostscript库可以从官方网站(https://www.ghostscript.com/download/gsdnld.html)中获取预编译的二进制文件。以下是Windows平台上编译好的Ghostscript库下载链接:
- 32位版本:https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/gs9533w32.exe
- 64位版本:https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/gs9533w64.exe
下载后,运行安装程序并按照提示进行安装。安装程序会将Ghostscript库文件和可执行文件拷贝到系统目录中。在使用Ghostscript库时,可以直接调用相关的可执行文件,也可以将库文件拷贝到项目目录中,并在项目中链接相应的库文件。
需要注意的是,Ghostscript库的使用需要遵守相关许可协议。
windows下使用vs2017编译ghostscript库
以下是在 Windows 平台下使用 Visual Studio 2017 编译 Ghostscript 库的步骤:
1. 下载 Ghostscript 源代码
你可以在 Ghostscript 官网的下载页面 [https://www.ghostscript.com/download/gsdnld.html](https://www.ghostscript.com/download/gsdnld.html) 上下载 Ghostscript 的源代码。下载完成后,解压到本地。
2. 安装依赖库
Ghostscript 依赖以下库:
- zlib
- libpng
- jpeglib
- tiff
你可以在各自的官网上下载这些库的源代码,或者使用预编译的二进制文件。
3. 配置编译环境
- 安装 Visual Studio 2017,并安装 C++ 开发环境。
- 安装 CMake。你可以从 [https://cmake.org/download/](https://cmake.org/download/) 下载最新版本的 CMake。
4. 生成 Visual Studio 工程
- 打开 CMake GUI。
- 在 "Where is the source code" 中填写 Ghostscript 源代码的路径。
- 在 "Where to build the binaries" 中填写生成的工程文件路径,例如 Ghostscript/build。
- 点击 Configure,选择 Visual Studio 版本并选择生成 64 位库。
- CMake 会提示你输入各种选项,你可以根据自己的需求进行选择。如果不确定,可以选用默认值。
- 点击 Generate,CMake 会生成 Visual Studio 工程文件。
5. 编译 Ghostscript 库
- 打开 Visual Studio,打开生成的 Ghostscript 工程文件。
- 在解决方案栏中,右键点击 ALL_BUILD 项目,选择生成。
- 编译完成后,在解决方案栏中找到 gs 工程,右键点击 INSTALL 项目,选择生成。
- 编译完成后,你可以在 Ghostscript 安装目录下找到生成的库文件。
以上就是在 Windows 平台下使用 Visual Studio 2017 编译 Ghostscript 库的步骤。希望对你有所帮助。