<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Autarchy of the Private Cave &#187; print</title> <atom:link href="https://bogdan.org.ua/tags/print/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>How to print a single page from PDF file using Linux command line interface (CLI)</title><link>https://bogdan.org.ua/2008/10/30/how-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html</link> <comments>https://bogdan.org.ua/2008/10/30/how-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html#comments</comments> <pubDate>Thu, 30 Oct 2008 10:42:28 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[acroread]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[PDF]]></category> <category><![CDATA[pdf2ps]]></category> <category><![CDATA[pdftops]]></category> <category><![CDATA[print]]></category> <category><![CDATA[PS]]></category> <category><![CDATA[single page]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=433</guid> <description><![CDATA[There are several ways to do that, I&#8217;ll describe the one which worked for me. Please note, that printing from CLI has an advantage of being able to print out something at work from the comfort of your home and ssh (provided that the printer is on and is loaded with paper). To extract a [&#8230;]]]></description> <content:encoded><![CDATA[<p>There are several ways to do that, I&#8217;ll describe the one which worked for me. Please note, that printing from CLI has an advantage of being able to print out something at work from the comfort of your home and ssh <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> (provided that the printer is on and is loaded with paper).</p><p>To extract a single page (or a range of pages), I used <strong>pdftops</strong>:<br
/> <span
id="more-433"></span></p><blockquote><p><strong>pdftops -f 187 -l 187 -paper A4 abstract_book.pdf page_187.ps</strong></p></blockquote><p>Here, <strong>-f</strong> is the <strong>f</strong>irst page, <strong>-l</strong> is the <strong>l</strong>ast, and <strong>-paper</strong> is paper size.</p><p>Alternatives include using <strong>pdf2ps</strong> (which relies on GhostScript and accepts the same options) and <strong>acroread -toPostScript</strong> (which uses non-free Adobe Reader in CLI mode to convert PDF to PS).</p><p>Now that I have a single-page PS file, I can print it:</p><blockquote><p><strong>cupsdoprint -P S200 -o Resolution=720dpi,Copies=2,PageSize=A4 page_187.ps</strong></p></blockquote><p>Printing options will vary depending on your printer model (use <strong>lpoptions -l -P PrinterName</strong> to find out possible options and their default values). In the sample line above, <strong>S200</strong> is the printer to use for printing, Resolution/Copies/PageSize are all self-explanatory printing options.</p><p>Alternative (and, actually, more standard) way to print is by using <strong>lpr</strong>, but if you run CUPS and KDE then <strong>cupsdoprint</strong> isn&#8217;t any worse.</p><p>For more details this <a
href="http://www.faqs.org/docs/Linux-HOWTO/Printing-Usage-HOWTO.html">FAQ</a> might be helpful. Also, keep in mind that simple shell scripts can automate routine sequential tasks, and that piping helps.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F10%2F30%2Fhow-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html&amp;linkname=How%20to%20print%20a%20single%20page%20from%20PDF%20file%20using%20Linux%20command%20line%20interface%20%28CLI%29" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F10%2F30%2Fhow-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html&amp;linkname=How%20to%20print%20a%20single%20page%20from%20PDF%20file%20using%20Linux%20command%20line%20interface%20%28CLI%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F10%2F30%2Fhow-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html&amp;linkname=How%20to%20print%20a%20single%20page%20from%20PDF%20file%20using%20Linux%20command%20line%20interface%20%28CLI%29" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F10%2F30%2Fhow-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html&amp;linkname=How%20to%20print%20a%20single%20page%20from%20PDF%20file%20using%20Linux%20command%20line%20interface%20%28CLI%29" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F10%2F30%2Fhow-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html&amp;linkname=How%20to%20print%20a%20single%20page%20from%20PDF%20file%20using%20Linux%20command%20line%20interface%20%28CLI%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2008%2F10%2F30%2Fhow-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html&#038;title=How%20to%20print%20a%20single%20page%20from%20PDF%20file%20using%20Linux%20command%20line%20interface%20%28CLI%29" data-a2a-url="https://bogdan.org.ua/2008/10/30/how-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html" data-a2a-title="How to print a single page from PDF file using Linux command line interface (CLI)"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2008/10/30/how-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>