{"id":518,"date":"2009-04-29T20:38:50","date_gmt":"2009-04-29T20:38:50","guid":{"rendered":"http:\/\/www.haydnwilliams.com\/blog\/?p=518"},"modified":"2022-04-11T21:49:12","modified_gmt":"2022-04-11T20:49:12","slug":"working-with-pdfs-in-os-x","status":"publish","type":"post","link":"https:\/\/www.haydnwilliams.com\/blog\/working-with-pdfs-in-os-x\/","title":{"rendered":"Working with PDFs in OS X"},"content":{"rendered":"<p>I&#8217;ve just been playing around creating some eps files with gnuplot, and have subsequently had to convert them to PDFs for someone else to view. Turns out I wasn&#8217;t aware of the following:<\/p>\n<p>1) You can drag-and-drop pages within PDFs in Preview.app, to re-arrange the page order. You can also delete pages using the Edit menu (and add blank ones, if that floats your boat). More detail <a href=\"http:\/\/www.mactricksandtips.com\/2008\/10\/joining-pdf-files-together-in-preview.html\">here<\/a>.<\/p>\n<div id=\"attachment_529\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-529\" src=\"http:\/\/www.haydnwilliams.com\/blog\/wp-content\/uploads\/2009\/04\/20090429.jpg\" alt=\"Editing a PDF in Preview.app\" title=\"Editing a PDF in Preview.app\" width=\"500\" height=\"267\" class=\"size-full wp-image-529\" \/><p id=\"caption-attachment-529\" class=\"wp-caption-text\">Editing a PDF in Preview.app<\/p><\/div>\n<p>I&#8217;ve also just discovered that you can use Cmd-R to rotate either a single page or all pages between portrait and landscape orientation.<\/p>\n<p>2) If you&#8217;re a fan of the command-line, there&#8217;s a built-in script to join multiple PDFs. I originally found it on <a href=\"http:\/\/kpwu.wordpress.com\/2007\/02\/02\/joinsplit-pdf-file-easily-at-mac\/\">this blog<\/a> (turns out they&#8217;re investigating protein misfolding and aggregation, small world). Basically, you can find the script at the following location (all one line, obviously):<\/p>\n<p><code>\/System\/Library\/Automator\/Combine PDF pages.action\/Contents\/Resources\/join.py<\/code><\/p>\n<p>If you want to add the path to your .profile file, don&#8217;t forget to put it in quotes otherwise OS X will baulk at the spaces. To use the script, just go like so&#8230;<\/p>\n<p><code>~ $ join.py -o output.pdf input1.pdf input2.pdf ... inputN.pdf<\/code><\/p>\n<p>I&#8217;m not suggesting these are particularly life-changing pieces of news, but I wasn&#8217;t aware of them so thought I&#8217;d spread the love.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve just been playing around creating some eps files with&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[388,185,236,241],"class_list":["post-518","post","type-post","status-publish","format-standard","hentry","category-it","tag-join-py","tag-mac","tag-os-x","tag-pdf"],"_links":{"self":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts\/518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/comments?post=518"}],"version-history":[{"count":0,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts\/518\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/media?parent=518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/categories?post=518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/tags?post=518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}