{"id":2832,"date":"2013-04-03T12:29:54","date_gmt":"2013-04-03T12:29:54","guid":{"rendered":"http:\/\/really.zonky.org\/?p=2832"},"modified":"2013-04-03T12:29:54","modified_gmt":"2013-04-03T12:29:54","slug":"fixing-a-mangled-pdf-with-some-pages-requiring-rotation","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=2832","title":{"rendered":"Fixing A Mangled PDF With Some Pages Requiring Rotation"},"content":{"rendered":"<p>Scanning paper documents is such a tedious task that I tend to lose concentration when doing it. And as a result I recently ended up with two PDF documents needing post-processing. In the worst case, the PDF consisted of three pages &#8211; one in the correct orientation, and two rotated 180\u00b0!<\/p>\n<p>As usual, there&#8217;s a Unix command to help out with that &#8211;\u00a0<em>pdftk<\/em>. Specifically :-<\/p>\n<pre>\r\npdftk \\\r\n  input-file.pdf \\\r\n  cat 1 2-endS \\\r\n  output out.pdf\r\n<\/pre>\n<p>\nThe interesting operation is contained within the <em>cat 1 2-endS<\/em> which translates as copy the input page 1 to the output unaltered, and copy the remaining pages rotated 180\u00b0 (or &#8220;S&#8221;) to the output. This is of course only the tiniest fraction of what this tool can do.<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scanning paper documents is such a tedious task that I tend to lose concentration when doing it. And as a result I recently ended up with two PDF documents needing post-processing. In the worst case, the PDF consisted of three pages &#8211; one in the correct orientation, and two rotated 180\u00b0! As usual, there&#8217;s a <a href='https:\/\/really.zonky.org\/?p=2832' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[226],"tags":[],"class_list":["post-2832","post","type-post","status-publish","format-standard","hentry","category-working-notes","category-226-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-JG","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/2832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2832"}],"version-history":[{"count":3,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/2832\/revisions"}],"predecessor-version":[{"id":2835,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/2832\/revisions\/2835"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}