{"id":5,"date":"2007-01-12T23:14:41","date_gmt":"2007-01-13T07:14:41","guid":{"rendered":"https:\/\/www.wkiri.com\/today\/?p=5"},"modified":"2007-01-17T17:51:23","modified_gmt":"2007-01-18T01:51:23","slug":"how-to-combine-multiple-pdf-files-into-a-single-document","status":"publish","type":"post","link":"https:\/\/www.wkiri.com\/today\/?p=5","title":{"rendered":"How to combine multiple .pdf files into a single document"},"content":{"rendered":"<p>As part of a NASA proposal I am writing, I need to be able to combine multiple .pdf files into a single, larger .pdf file.  Sure, you can do this with Acrobat &#8212; but you have to pay for it.  Today I was delighted to learn about <a href=\"http:\/\/www.accesspdf.com\/pdftk\/\">pdftk<\/a>, the PDF toolkit from AccessPDF.  You can download the program <a href=\"http:\/\/www.accesspdf.com\/article.php\/20041130153545577\">here<\/a>, although I instead got it via fink on my Mac, so your mileage may vary.<\/p>\n<p>At any rate, this gem of a program runs on the command line with simple, easy-to-use syntax.  For example, to concatenate f1.pdf and f2.pdf, you type<\/p>\n<blockquote><p>\n<tt>pdftk f1.pdf f2.pdf cat output combinedfile.pdf<\/tt>\n<\/p><\/blockquote>\n<p>But wait, there&#8217;s more!  You can pick and choose which pages you want, e.g.<\/p>\n<blockquote><p>\n<tt>pdftk A=f1.pdf B=f2.pdf cat A1-3 B2-4 A6 output combinedfile.pdf<\/tt>\n<\/p><\/blockquote>\n<p>to get the first three pages from f1.pdf, then pages 2-4 from f2.pdf, then page 6 from f1.pdf&#8230; neatly organized in the order you specify!  And these are just some of the <a href=\"http:\/\/www.accesspdf.com\/article.php\/20041129175231241\">&#8220;simple examples&#8221;<\/a>.  There&#8217;s more power here than I&#8217;ll probably ever need in terms of PDF manipulation.  Thank you, Sid Stewart.<\/p>\n<p>Postscript: although this program works like a charm for small files, it dies an ugly death on large ones.  The best alternative I was able to find for the Mac is <a href=\"http:\/\/www.monkeybreadsoftware.de\/Freeware\/CombinePDFs.shtml\">Combine PDFs<\/a>, which handles large files just fine.  However, it is a graphical app.  This is handy, since you can drag-and-drop PDF files into it and assemble them manually, but it is also difficult to automate.  pdftk is a command-line app, so it&#8217;s easy to incorporate it into a Makefile to automatically refresh your output .pdf file if any of the components change; Combine PDFs has to be run manually each time.  Still, it was able to give me what I needed for the proposal.  Thanks, MonkeyBread Software.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of a NASA proposal I am writing, I need to be able to combine multiple .pdf files into a single, larger .pdf file. Sure, you can do this with Acrobat &#8212; but you have to pay for it. Today I was delighted to learn about pdftk, the PDF toolkit from AccessPDF. You can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/5"}],"collection":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5"}],"version-history":[{"count":0,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wkiri.com\/today\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}