You are here

Export Layers as PDF

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

I'm tired of building a PDF from layers manually so I finally got around to scripting it. This requires "convert" from ImageMagick to be installed. It has been tested on Linux(Ubuntu).

Code License: 
GIMP Version: 
Scripting Engine: 

Comments

I have wrote new version. Where I can upload it?
No answers?

OK,
I have created new thread with new plugin "Export Layers to single multiple pages PDF"

On GIMP 2.6.11 on Mac OS X Mountain Lion, I get this error (and additionally, the dialog seems odd in that it forces me to pick a file name from a file browser, when what I wish to do is save the file as a new file):

Traceback (most recent call last):
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/python/gimpfu.py", line 692, in response
dialog.res = run_script(params)
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/python/gimpfu.py", line 353, in run_script
return apply(function, params)
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/plug-ins/export_layers_pdf-0.2.py", line 52, in export_layers
combine_imgs_into_pdf(imgfiles, pdfname)
File "/tmp/skl/Gimp.app/Contents/Resources/lib/gimp/2.0/plug-ins/export_layers_pdf-0.2.py", line 32, in combine_imgs_into_pdf
check_call(['convert'] + imgfiles + [pdfname])
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 457, in check_call
retcode = call(*popenargs, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 444, in call
return Popen(*popenargs, **kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 594, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 1097, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

I put this script in the ~/.gimp-2.6/scripts folder and restarted gimp but there were no scripts listed (in either the python-fu or script-fu consoles) by any names I could think of such as "export_layers_pdf" or "python-fu-export-pdf" etc...

I also tried placing this script in the ~/.gimp-2.6/plug-ins folder but still no luck at locating the script or any menu item for it from within gimp.

Has any one been able to figure out how to run this script from within gimp? If so, did it work and how did you get it to show up inside gimp so that you could run it?

If Linux, you need to give the py file permission to execute.

Did it still have the .txt extension when you uploaded it to the plug-ins folder?

Shows under File - Export Layers - As PDF

There is a reason to use ImageMagick instead then Ghostscript ?

WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\docume~1\\compaq~1.fam\\locals~1\\temp\\tmpzaxus7.tiff'

Trace back

Traceback (most recent call last):
File "C:\Program Files\GIMP-2.0\lib\gimp\2.0\python\gimpfu.py", line 692, in response
dialog.res = run_script(params)
File "C:\Program Files\GIMP-2.0\lib\gimp\2.0\python\gimpfu.py", line 353, in run_script
return apply(function, params)
File "C:\Documents and Settings\Compaq_Owner.FAMILY-ROOM\.gimp-2.6\plug-ins\export_layers_pdf-0.1.py", line 55, in export_layers
os.remove(img)
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\docume~1\\compaq~1.fam\\locals~1\\temp\\tmpuna0eg.tiff'

I noticed the file is associated with XnView.I tried to re-associate it with Imagemagick but got another error.

Subscribe to Comments for "Export Layers as PDF"