<?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; file</title>
	<atom:link href="http://scrolls.mafgani.net/tag/file/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>Printing multi-page duplex documents</title>
		<link>http://scrolls.mafgani.net/2009/10/printing-multi-page-duplex-documents/</link>
		<comments>http://scrolls.mafgani.net/2009/10/printing-multi-page-duplex-documents/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 13:04:41 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[duplex]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[file processing]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[ps]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=102</guid>
		<description><![CDATA[The psnup tool can be used to place multiple pages on each sheet of a document. E.g., the following command places two pages from the input file into each sheet of the output: $ psnup -l -2 input.ps output.ps While psnup is excellent for quick &#8220;N-up&#8221; conversion jobs, it doesn&#8217;t provide much control over the [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>psnup</strong> tool can be used to place multiple pages on each sheet of a document. E.g., the following command places two pages from the input file into each sheet of the output: </p>
<pre>$ psnup -l -2 input.ps output.ps</pre>
<p>While <strong>psnup</strong> is excellent for quick &#8220;N-up&#8221; conversion jobs, it doesn&#8217;t provide much control over the layout. The <strong>pstops</strong> utility on the other hand allows for fine grained scale, rotation and placement settings for each page that goes into a sheet of the output. The command syntax is a bit more complicated on account of the page specification strings that must now be provided. The following example shows a typical command needed to prepare a document for duplex printing with two pages on each side of a sheet:</p>
<pre>$ pstops -pa4 \
  '4:0L@0.8(21cm,-1cm)+1L@0.8(21cm,12.55cm),2R@0.8(0,29.85cm)+3R@0.8(0,16.25cm)' \
  input.ps output.ps
</pre>
<p>The command is best understood by referring to the relevant section from the <em>manpage</em>:</p>
<pre>
       Pstops rearranges pages from a  PostScript  document,  creating  a  new
       PostScript  file.   The  input  PostScript file should follow the Adobe
       Document Structuring Conventions.  Pstops can  be  used  to  perform  a
       large  number  of  arbitrary  re-arrangements  of  Documents, including
       arranging for printing 2-up, 4-up, booklets, reversing, selecting front
       or back sides of documents, scaling, etc.

       pagespecs follow the syntax:

              pagespecs   = [modulo:]specs

              specs       = spec[+specs][,specs]

              spec        = [-]pageno[L][R][U][@scale][(xoff,yoff)]

       modulo is the number of pages in each block. The value of modulo should
       be greater than 0; the default value is 1.  specs are the page specifi-
       cations  for  the  pages in each block. The value of the pageno in each
       spec should be between 0 (for the first page in the block) and modulo-1
       (for  the  last page in each block) inclusive.  The optional dimensions
       xoff and yoff shift the page by the specified amount.   xoff  and  yoff
       are  in  PostScript’s points, but may be followed by the units cm or in
       to convert to centimetres or inches, or the flag w or h to specify as a
       multiple  of  the width or height.  The optional parameters L, R, and U
       rotate the page left, right, or upside-down.  The optional scale param-
       eter  scales the page by the fraction specified.  If the optional minus
       sign is specified, the page is relative to the  end  of  the  document,
       instead of the start.

       If  page  specs  are  separated  by + the pages will be merged into one
       page; if they are separated by  they will be  on  separate  pages.   If
       there  is only one page specification, with pageno zero, the pageno may
       be omitted.

       The shift, rotation, and scaling are performed in that order regardless
       of which order they appear on the command line.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2009/10/printing-multi-page-duplex-documents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

