Exporting layers in GIMP file to single pdf file

[Update: there is a nice working plugin that does the trick, see here]

In GIMP exporting multiple layers to one pdf file is surprisingly difficult. I found two solution, both require additional software besides GIMP, but are fairly easy to implement. One solution is given here. [this link doesn't work anymore] It requires a plug-in or script to export individual layers to separate tiff files (something which perhaps surprisingly is not possible out-of-the-box in GIMP).

The before-mentioned site suggest the script “Save Layers as Individual Files”, which can be downloaded [this link doesn't work anymore] from Panotools. Next step is to use ImageMagick to convert the tiff files into a single pdf file. Unfortunately the script throws up an error when I try to open it.

Luckily I found an even easier solution here. No need for a separate plugin, but you still need GraphicsMagick or ImageMagick.

  • Open the GIMP file with multiple layers
  • Make sure to order the layers in reverse order, page 1 must by the bottom layer, the last page the top layer
  • Save the file as a MNG animation. In the dialogue that comes up, select “save as animation”.
  • Now, open the terminal and use the command ‘convert document.mng document.pdf’ to export the mng file to a pdf file.

Credits go to Patrick’s WebLog, go there for more details.

About pvanb

I am a tropical forest ecologist with a focus on spatial and temporal patterns and processes at population and ecosystem level. I am furthermore very interested in issues related to conservation and sustainable use of biodiversity and natural resources under current and future climates. I have worked in the Middle East (Syria and Lebanon) and South America (Brazil) and in Eastern Africa (Kenya).
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

13 Responses to Exporting layers in GIMP file to single pdf file

  1. Aston says:

    You can also, if you like the way GIMP orders the layers, use the “-reverse” switch in ImageMagick (eg “convert document.mng -reverse document.pdf”), though GIMP does have Layer > Stack > Reverse Layer Order.

    The MNG tip is a good one, as ImageMagick only supports the bottom two layers of an XCF, and for some reason repeats page 1 at the end of the PDF when converting from PSD. GIF works perfectly, but of course has colour restrictions. Thanks for that!

    • pvanb says:

      Thanks for the tip about using the ‘-reverse’ switch in ImageMagick or alternatively the ‘reverse layer order’ option in GIMP

  2. Aston says:

    Don’t know if you’re interested, but I found out you can actually get around the PSD problem (of having a repeated bottom layer) by specifying what layers to convert, making the command “convert document.psd[1-*numberOfLayers*] document.pdf”, which in my case was “convert document.psd[1-4] document.pdf”. This works pretty well for me, because I’m pretty happy to work on the file in GIMP as a PSD.

    http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=16498

  3. Great stuff! Worked like a charm. Thanks a bunch!

    Alex

  4. Miralem says:

    There is even simpler fix that worked for me. I have just merged all layers to one (in layers command right click and then merge down, gimp 2.8.0). With one layer left I have exported to pdf and it worked great.

    • pvanb says:

      But wouldn’t that leave you with a pdf with one page (the merged image) only? I see I did not mention it explicitly, but what I was trying is to get a pdf with one page per layer.

  5. nola mike says:

    I’ve been trying to figure this out forever. Worked great, thanks!

  6. Nevar says:

    Hi,

    Also try this script. PDF straight from Gimp :-)
    http://registry.gimp.org/node/25677

  7. Pingback: A plugin to export layers in GIMP file to single pdf file | Ecostudies

  8. monk13y says:

    Thank, its work :D

  9. Marc says:

    http://registry.gimp.org/node/27987

    plugin menu appearing in the “file” menu of GIMP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s