Closed lost-RD closed 4 years ago
I did manage to fix the issue by commenting out the line in WeasyPrintClient.InitProcess that added gtk3 to the front of PATH. Now my own installation of GTK+ 3.0 is doing the heavy lifting.
Thanks for your comments.
It is seems the gtk3 library that comes with the lib is missing some files, we will investigate the issue
Thanks
Any update on this? :)
Now GTK3 has been update in version 2, hope it solves your problem
Kindly, let me know the issue exist
Thanks
@balbarak Great! I will test it and let you know if it works now 👍
@balbarak With today's merged PR it seems to work great! So when that's released, it should be all good.
Thanks!
Pushed to nuget v2.0.1
Thanks
The reason given by OnDataError is
(Pixbuf error: Unrecognized image file format)
so I took a look into the included files and there was agdk-pixbuf-query-loaders.exe
in the gtk3 folder that instructed me that it would look ingtk3\lib\gdk-pixbuf-2.0\2.10.0\loaders\
for loaders. That directory structure didn't exist so I created it and pulled the loaders fromhttps://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/tree/master/gtk-nsis-pack/lib/gdk-pixbuf-2.0/2.10.0/loaders
and tried the exe again, this time with better results:However, even with the loader that should allow gdk-pixbuf to load a JPG into memory, WeasyPrint still gives me the same error.
Next I tried using the command line in the same manner as you do (I had a poke around in your code using dnSpy):
python.exe weasyprint.exe input.html output.pdf -e utf8
And to my surprise, but not really, the pdf rendered perfectly, JPGs and all. I'm on the right track!
Next step was to see if the issue was in the Path so I modified your code to print the Path when I call GeneratePdf. Nothing showed up in the output. Seems I don't know as much as I think I do. Over to you.