{"id":47,"date":"2010-04-09T04:52:19","date_gmt":"2010-04-09T09:52:19","guid":{"rendered":"http:\/\/coherentpdf.com\/blog\/?p=47"},"modified":"2010-04-09T04:52:19","modified_gmt":"2010-04-09T09:52:19","slug":"removing-the-last-page-from-a-pdf","status":"publish","type":"post","link":"https:\/\/coherentpdf.com\/blog\/?p=47","title":{"rendered":"Removing the Last Page from a PDF"},"content":{"rendered":"<p>A customer recently asked how to do this. The Coherent PDF Tools page specification doesn&#8217;t directly allow it, but we can do it indirectly:<\/p>\n<ol>\n<li>Reverse the document&#8217;s pages using the &#8216;reverse&#8217; page specification<\/li>\n<li>Use the page specification &#8216;2-end&#8217; to remove the first page<\/li>\n<li>Reverse the document again<\/li>\n<\/ol>\n<div>You can use the &#8216;AND&#8217; construction to string these together in a single command, avoiding processing the file multiple times:<\/div>\n<p><code>cpdf in.pdf reverse AND -range 2-end AND -range reverse -o out.pdf<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer recently asked how to do this. The Coherent PDF Tools page specification doesn&#8217;t directly allow it, but we can do it indirectly: Reverse the document&#8217;s pages using the &#8216;reverse&#8217; page specification Use the page specification &#8216;2-end&#8217; to remove &hellip; <a href=\"https:\/\/coherentpdf.com\/blog\/?p=47\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[1],"tags":[],"class_list":["post-47","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47"}],"version-history":[{"count":0,"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"wp:attachment":[{"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coherentpdf.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}