<?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>Random Wisdom &#187; pdftops</title>
	<atom:link href="http://scrolls.mafgani.net/tag/pdftops/feed/" rel="self" type="application/rss+xml" />
	<link>http://scrolls.mafgani.net</link>
	<description>An attempt at organizing my thoughts ...</description>
	<lastBuildDate>Sun, 13 Mar 2011 22:54:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Cropping a PDF Document</title>
		<link>http://scrolls.mafgani.net/2006/07/cropping-a-pdf-document/</link>
		<comments>http://scrolls.mafgani.net/2006/07/cropping-a-pdf-document/#comments</comments>
		<pubDate>Mon, 31 Jul 2006 20:29:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[file processing]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdftops]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=70</guid>
		<description><![CDATA[Easily accomplished using pdftops: $ pdftops -paperw WIDTH \ -paperh HEIGHT \ -noshrink -expand document.pdf &#38;&#38; ps2pdf document.ps WIDTH and HEIGHT are in points &#8212; they basically specify the dimensions of the image to be cropped. Content is extracted from the center of the page. This technique is specially useful as a bypass for using [...]]]></description>
			<content:encoded><![CDATA[<p>Easily accomplished using <span style="font-style: italic;"><a href="http://www.die.net/doc/linux/man/man1/pdftops.1.html">pdftops</a></span>:</p>
<pre>
$ pdftops -paperw WIDTH \
             -paperh HEIGHT \
             -noshrink -expand document.pdf &amp;&amp; ps2pdf document.ps
</pre>
<p>WIDTH and HEIGHT are in points &#8212; they basically specify the dimensions of the image to be cropped.</p>
<p>Content is extracted from the center of the page. This technique is specially useful as a bypass for using <span style="font-style: italic;"><a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/psfrag.html">psfrag</a></span> with pdfLatex:</p>
<ul>
<li>Save EPS figure with TAGS</li>
<li>Create a very simple tex document that simply includes the figure (centered) with psfrag replacements and run latex -> dvips -> ps2pdf</li>
<li>Follow the step above to crop out the figure.</li>
</ul>
<p>The cropped out figure will have the TAGS replaced and be in PDF format &#8212; ready to be used with pdfLatex!</p>
<p><span style="font-weight: bold;">UPDATE [16 July 2009]</span> It looks like <span style="font-style: italic;">pdfcrop</span> might actually be a better option:</p>
<pre>
$ pdfcrop --help
PDFCROP 1.5, 2004/06/24 - Copyright (c) 2002, 2004 by Heiko Oberdiek.
Syntax:   pdfcrop [options] &lt;input[.pdf]&gt; [output file]
Function: Margins are calculated and removed for each page in the file.
Options:                                                    (defaults:)
  --help              print usage
  --(no)verbose       verbose printing                      (false)
  --(no)debug         debug informations                    (false)
  --gscmd &lt;name&gt;      call of ghostscript                   (gs)
  --pdftexcmd &lt;name&gt;  call of pdfTeX                        (pdftex)
  --margins "&lt;left&gt; &lt;top&gt; &lt;right&gt; &lt;bottom&gt;"                 (0 0 0 0)
                      add extra margins, unit is bp. If only one number is
                      given, then it is used for all margins, in the case
                      of two numbers they are also used for right and bottom.
  --(no)clip          clipping support, if margins are set  (false)
  --(no)hires         using `%%HiResBoundingBox'            (false)
                      instead of `%%BoundingBox'
  --papersize &lt;foo&gt;   parameter for gs's -sPAPERSIZE=&lt;foo&gt;,
                      use only with older gs versions &lt;7.32 ()
Examples:
  pdfcrop --margins 10 input.pdf output.pdf
  pdfcrop --margins '5 10 5 20' --clip input.pdf output.pdf
</pre>
<p>The tool comes as a part of the &#8216;tetex&#8217; package.</p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2006/07/cropping-a-pdf-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

