{"id":199,"date":"2010-02-07T19:33:42","date_gmt":"2010-02-07T11:33:42","guid":{"rendered":"https:\/\/patrick-nagel.net\/blog\/?p=199"},"modified":"2010-03-01T20:02:02","modified_gmt":"2010-03-01T12:02:02","slug":"creating-multi-page-pdf-files-with-gimp-and-convert","status":"publish","type":"post","link":"https:\/\/patrick-nagel.net\/blog\/archives\/199","title":{"rendered":"Creating multi-page PDF files with GIMP and `convert`"},"content":{"rendered":"<p>Occasionally I have to sign some document (old style, with a pen) and send it electronically. Sometimes those are multi-page documents. Since it is uncommon to send it back as multiple image files after scanning, and multi-page image formats are uncommon as well, I&#8217;d like to send them as PDF file. Before I discovered this method, I used to insert the scanned images into OpenOffice Writer, and then create the PDF with it. This works, but it is a bit cumbersome to tell OpenOffice Writer to maximise the images (eliminating page borders, etc.), especially when there are a lot of pages. It just doesn&#8217;t feel like a real solution.<\/p>\n<p>So, here we go:<\/p>\n<p><strong>Prerequisites:<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/www.gimp.org\/\">GIMP<\/a> (I&#8217;m currently at version 2.6.8, but this will probably work with older versions as well)<\/li>\n<li><a href=\"http:\/\/www.graphicsmagick.org\/\">GraphicsMagick<\/a> (tested with 1.3.8) or <a href=\"http:\/\/www.imagemagick.org\/\">ImageMagick<\/a> (tested with 6.5.8.8)<\/li>\n<\/ul>\n<p><strong>Procedure:<\/strong><\/p>\n<ol>\n<li>Get the scanned pages opened as layers of one image in GIMP. If they are available as files already, you can use <em>File \/ Open as Layers&#8230;<\/em>.<\/li>\n<li>Make sure that the layers are ordered in the following way: Page 1 must be the bottom layer, the last page must be the top layer. You can reorder them via the &#8220;Layers&#8221; dialogue (activate it via the <em>Windows \/ Dockable Dialogues<\/em> menu if you don&#8217;t see it)<\/li>\n<li><em>Save As&#8230;<\/em> and choose &#8220;MNG animation&#8221; or just add &#8220;.mng&#8221; to the filename. (In case you are wondering, <a href=\"http:\/\/en.wikipedia.org\/wiki\/Multiple-image_Network_Graphics\">MNG<\/a> is the animated counterpart to PNG).<br \/>\nA dialogue window saying &#8220;MNG plug-in can only handle layers as animation frames&#8221; will come up &#8211; choose &#8220;Save as Animation&#8221; here and press the Export button. In the next dialogue you don&#8217;t need to make any changes to the defaults, just press the Save button.<\/li>\n<li>Now, open a console window and simply enter<br \/>\n<code>convert document.mng document.pdf<\/code><\/li>\n<\/ol>\n<p>That&#8217;s it &#8211; you now have your PDF file ready for sending!<\/p>\n<p><strong>Update (2010-02-08):<\/strong><br \/>\nAs chithanh pointed out in <a href=\"https:\/\/patrick-nagel.net\/blog\/archives\/199\/comment-page-1#comment-12405\">comment 1<\/a>, there is another convenient way to accomplish the same. It does not involve GIMP, but instead requires <a href=\"http:\/\/www.pdfhacks.com\/pdftk\/\">pdftk<\/a> to concatenate PDF files. Please see <a href=\"https:\/\/patrick-nagel.net\/blog\/archives\/199\/comment-page-1#comment-12408\">comment 2<\/a> for details.<\/p>\n<p><strong>Update (2010-03-01):<\/strong><br \/>\nAnd yet another way (definitely the most straight-forward one, if you have the pages as single image files already) was pointed out by goffrie in <a href=\"https:\/\/patrick-nagel.net\/blog\/archives\/199#comment-12557\">comment 5<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Occasionally I have to sign some document (old style, with a pen) and send it electronically. Sometimes those are multi-page documents. Since it is uncommon to send it back as multiple image files after scanning, and multi-page image formats are uncommon as well, I&#8217;d like to send them as PDF file. Before I discovered this &hellip; <a href=\"https:\/\/patrick-nagel.net\/blog\/archives\/199\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Creating multi-page PDF files with GIMP and `convert`&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-linux-general"],"_links":{"self":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":13,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":210,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions\/210"}],"wp:attachment":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}