我为Magick.NET找到了这个链接
Is there way to refer ghostscript's DLLs without installing?
它提到了函数: MagickNET.SetGhostscriptDirectory
Python有等效的吗?
我尝试设置路径,但在python程序中,当复制到其他机器时,它无法加载gsdll64.dll:
我的代码:
import os, time
import sys
import camelot.io as camelot
import traceback
sys.path.insert(0, r'C:\gs\gs9.56.1\bin')
sys.path.insert(0, r'C:\gs\gs9.56.1\lib')
print('path',sys.path)
#check ghostscript lib - as done in ghostscript_backend.py
import ctypes
from ctypes.util import find_library
mylib = find_library("".join(("gsdll", str(ctypes.sizeof(ctypes.c_voidp) * 8), ".dll")))
print(mylib,os.getcwd())
if mylib is None:
print('gsdll not loaded')发布于 2022-08-11 11:54:42
在站点-包\ghostscript\_gsprint.py
编写代码是为了从windows注册表获取dll路径。
在函数__win32_finddll中,我添加了从我的文件夹中检查和加载dll的代码:
LooseVrsn = "9.56.1" #from dll->Properties->details->ProductVersion
dll_path = os.path.join(os.getcwd(),'gsdll64.dll')
dlls.append((LooseVrsn, dll_path))https://stackoverflow.com/questions/73301138
复制相似问题