Switch to full style
Ask all general Gimp related questions here
Post a reply

Exporting problem

Mon Jun 17, 2019 12:50 am

GIMP Version: 2.10.10
Operating System: Linux
OS Version: UbuntuStudio 18.04
GIMP Experience: Experienced User

List any relevant plug-ins or scripts:
Export Layers to PDF

List any ERROR messages you received:
AttributeError: 'NoneType' object has no attribute 'rfind'



I am trying to export layers of a multi page doc to a PDF and get this error. Any idea on what this is and how to resolve it?

Thanks

Re: Exporting problem

Mon Jun 17, 2019 3:03 am

If you search for that error AttributeError: 'NoneType' object has no attribute 'rfind' lots of hits, most of them concerning python.

Are you using a separate Gimp plugin to create the PDF?

No consolation but, using (k)ubuntu 18.04 and Gimp 2.10.10 from the PPA, a multi-layer image exports to a multi-page PDF without issue, using the regular Gimp export menu.

Are you using a 'flatpak' or 'appimage' GIMP ? AFAIK, either work but I am not using these types at the smoment. Can you run gimp --verbose from a terminal, see if you get more descriptive error messages.


Edit: OK, I know the plugin you are using, It uses ImageMagick (IM) It was originally made for Gimp 2.6 then updated to Gimp 2.8 Just tried that last version and I get errors as well. I can see it writing png's to /tmp but for some reason IM is not saving the PDF. It could be a problem with the 'buntu IM

A quick check with command line IM and that fails as well. Needs some investigation.

It is superseded in Gimp 2.10 by the export PDF dialogue which now has the option to export multi-page

multi-pdf.jpg
multi-pdf.jpg (38.77 KiB) Viewed 2742 times


Edit again:
Just remembered. I have come across this before (I keep a 'static' IM7 for some things) In Ubuntu 18 IM 'bans' some file types PDF is one of them. These are kept in the file /etc/ImageMagick-6/policy.xml
You can comment out like this:

comment-out.jpg
comment-out.jpg (27.55 KiB) Viewed 2735 times


or easier, disable the whole file
Code:
sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xmlout


Just tried the export-layers-to-pdf.py and it is back to working. Still advise using the Gimp function as above.
Post a reply