James Munsch

Some notes on exporting layers as pdf using gimp

I created a repo for a script that I had used a few years ago, which had been modified a couple times, and in 2015 I found difficult to find again, and to use for Mac 10.10.x:

  • https://github.com/jmunsch/gimp_export_layers_to_pdf


  • So what I had originally done instead was to use this plugin: http://registry.gimp.org/node/28268 and renamed the images in numerical order and ran the following in terminal.

    
      convert *.png output.pdf
      

    Basically I had a difficult time finding out why the original script wasn't working. I linked the stackexchange question that I had asked, and eventually answered after a lot of trouble shooting. (see: here. ) It still doesn't work with png's but will work if the layers are pulled in as jpegs. Or the quality if the pdf is less than 100.

    
      cd /Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/plug-ins
    chown jmunsch:admin export-layers-to-pdf.py
    
    
    cd /var/folders/w1
    
    /Applications/GIMP.app/Contents/MacOS/GIMP ~/Desktop/Export_These_Layers.xcf
    
    otool -L /usr/local/bin/convert
    
    brew update && brew upgrade
    brew reinstall imagemagick
    
    ls /usr/local/opt/freetype/lib/libfreetype.6.dylib
    stat /usr/local/opt/freetype/lib/libfreetype.6.dylib
    
    otool -L /usr/local/bin/convert
    
    cp /usr/local/opt/freetype/lib/libfreetype.6.dylib /Applications/GIMP.app/Contents/Resources/lib
    
    
    locate libpng16
    cp /usr/local/Cellar/libpng/1.6.18/lib/libpng16.16.dylib /Applications/GIMP.app/Contents/Resources/lib
    
    locate liblzma.5.dylib
    otool -L /usr/local/lib/liblzma.5.dylib
    otool -L /Applications/GIMP.app/Contents/Resources/lib/liblzma.5.dylib
    cp /usr/local/lib/liblzma.5.dylib /Applications/GIMP.app/Contents/Resources/lib
    
    which convert
    ls -la /usr/local/bin/convert
    
    ls /usr/local/Cellar/imagemagick/6.9.2-6/lib/ImageMagick//modules-Q16/
    ls /usr/local/Cellar/imagemagick/6.9.2-6/lib/ImageMagick//modules-Q16/coders
    /usr/local/Cellar/imagemagick/6.9.2-6/lib/ImageMagick//modules-Q16/coders/png.la
    stat /usr/local/Cellar/imagemagick/6.9.2-6/lib/ImageMagick//modules-Q16/coders/png.la
    
    convert '/var/folders/w1/gg1rwbxd17x07kv9swxwv84h0000gn/T/tmpsPHsvG.png' '/var/folders/w1/gg1rwbxd17x07kv9swxwv84h0000gn/T/tmpXGKL0S.png' '/var/folders/w1/gg1rwbxd17x07kv9swxwv84h0000gn/T/tmp196lyv.png' '/var/folders/w1/gg1rwbxd17x07kv9swxwv84h0000gn/T/tmprNZdlG.png' '/Users/jmunsch/Desktop/hggfd.pdf'
    
    brew doctor
    echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
    
    ls /usr/local/Cellar/imagemagick/6.9.2-6/lib/ImageMagick//modules-Q16
    ls /usr/local/Cellar/imagemagick/6.9.2-6/lib/ImageMagick//modules-Q16/coders
    cd ~/Desktop
    python test.py
    
    open /usr/local/Cellar/imagemagick//6.9.1-10/share/doc/ImageMagick-6/www/api/constitute.html
    
    brew uninstall imagemagick; brew install imagemagick;brew install libpng; brew link libpng
    brew --config
    brew uninstall xz
    brew uninstall imagemagick; brew install imagemagick --build-from-source
    brew uninstall --force imagemagick; brew install -v imagemagick --build-from-source
    
    
    cp /usr/local/lib/liblzma.5.dylib /Applications/GIMP.app/Contents/Resources/lib
    
    brew uninstall --force imagemagick
    
    brew update && brew upgrade && brew uninstall --force imagemagick && brew install -v imagemagick --build-from-source
    which convert
    ls -la /usr/local/bin/convert
      

    But hey it exports jpegs as pdf ... woo.



    heres the code from the repo