Running cewe2pdf on Windows 11 and Python3.10
There is an issue with Cairosvg being unable to load a dll.
This code snip added immediately after 'Step 1' to clpFile.py resolves the problem:
gtkbin = r'C:\Program Files\GTK3-Runtime Win64\bin'
add_dll_dir = getattr(os, 'add_dll_directory', None)
if callable(add_dll_dir):
add_dll_dir(gtkbin)
else:
os.environ['PATH'] = os.pathsep.join((gtkbin, os.environ['PATH']))
import cairosvg
The use of getattr and callable is a technique I haven't seen - neat!
I don't have this trouble on my Windows 10 PC using Anaconda (conda 24.1.2, python 3.11.7)
I have installed Cairo using Microsofts vcpkg management, as described in the README.
This puts {snip}\Source\GitHub\vcpkg\installed\x64-windows\bin in my PATH. Cairo and other dlls are there, and that seems to be enough.
I haven't seen issues related to this problem from others and am reluctant to add your snippet to the base code. If we were to do something like this then I'd prefer to add a list of additional dll directories as an entry in cewe2pdf.ini (as is done for extraBackgroundFolders and passepartoutFolders). Then we would have a platform independent mechanism which works without code changes, and which would also work for a (non-modifiable) executable.
So I'd like to close this issue with this comment, unless there are objections? @sildeag?
With no feedback on my suggestion to close, I'm going ahead