<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Xpdf on Michael’s Domain</title><link>https://jeltsch.org/en/tags/xpdf/</link><description>Recent content in Xpdf on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/xpdf/index.xml" rel="self" type="application/rss+xml"/><item><title>Some useful PDF editing (and search) commands</title><link>https://jeltsch.org/en/pdf/</link><pubDate>Thu, 28 Jul 2011 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/pdf/</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Insert pages with interleave:&lt;/strong&gt; pdftk A=input_odd_pages.pdf B=input_even_pages.pdf shuffle A B output collated.pdf(from the pdftk package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Split an A2-sized PDF into two A3 pages for printing (no overlap):&lt;/strong&gt; pdfposter -m A3 -p A2 Periodic-Table_A2.pdf Periodic-Table_2xA3.pdf&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Split an arbitrary-sized PDF into A3 pages for printing at 100% size (= 1), no overlap:&lt;/strong&gt; pdfposter -m A3 -s1 Poster.pdf Poster_split_to_A3.pdf&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reverse page order:&lt;/strong&gt; pdftk input.pdf cat end-1 output reversed.pdf(from the pdftk package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reduce PDF filesize:&lt;/strong&gt; gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf Allowed PDFSETTINGS are /screen, /ebook, /printer, /prepress, /default. (from the ghostscript package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Convert a color PDF into grayscale:&lt;/strong&gt; gs -sOutputFile=output.pdf -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dAutoRotatePages=/None -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH input.pdf (from the ghostscript package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Export bitmap images:&lt;/strong&gt; pdfimages -j original.pdf extracted (from the xpdf package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Convert into a bitmap image:&lt;/strong&gt; convert original.pdf converted.png (from the imagemagick package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Split into individual 1-page PDF files:&lt;/strong&gt; pdftk original.pdf burst (from the pdftk package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Merge two or more PDF files:&lt;/strong&gt; pdftk original1.pdf original2.pdf cat output merged.pdf (from the pdftk package)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Delete page 13 from a PDF file:&lt;/strong&gt; pdftk original.pdf cat 1-12 14-end output page13deleted.pdf (from the pdftk package&amp;gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rotate page 5 of the PDF file 90 degrees counterclockwise:&lt;/strong&gt; pdftk Figures_LRES.pdf cat 1-4 5L 6-end output Figures_LRES2.pdf (from the pdftk package&amp;gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assemble a new PDF where each 4 pages from the source files are merged into one landscape page:&lt;/strong&gt; pdfjam *.pdf &amp;ndash;landscape &amp;ndash;nup 2x2 For portrait orientation use the &amp;ldquo;&amp;ndash;no-landscape&amp;rdquo; option (from the pdfjam package).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Underlay a PDF with another (background) PDF:&lt;/strong&gt; pdftk foreground.pdf background background.pdf output overlay.pdf (from the pdftk package).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GUI PDF editors:&lt;/strong&gt; I tried out 
 &lt;a href="http://sourceforge.net/projects/pdfedit" target="_blank" rel="noopener noreferrer nofollow"&gt;PDFEdit&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
, but it is too difficult for me. The 
 &lt;a href="http://code-industry.net/pdfeditor.php" target="_blank" rel="noopener noreferrer nofollow"&gt;Master PDF Editor"&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 is not free, but it seems to be much more usable without extensive initialization of the user.&lt;/li&gt;
&lt;li&gt;**Encrypt a PDF with both a owner password (to change the file) and a user password (to open the file): **pdftk input.pdf output encrypted.pdf owner_pw PROMPT user_pw PROMPT (from the pdftk package).&lt;/li&gt;
&lt;li&gt;**If you need to do a text search through many PDF files in the current directory and all of its subdirectories, you can use 
 &lt;a href="https://pdfgrep.org/" target="_blank" rel="noopener noreferrer nofollow"&gt;pdfgrep&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
: **pdfgrep -r searchterm * (from the pdfgrep package).&lt;/li&gt;
&lt;li&gt;**Convert &amp;amp; merge all jpg files in the current directory into one PDF file:**convert *.jpg pictures.pdfIn the recent Ubuntu editions, this batch operation is not allowed due to security risks and you can disable this policy by renaming the configuration file:/etc/ImageMagick-6$ sudo mv policy.xml policy.xmlout&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>