<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Rotating PDFs in ColdFusion</title>
	<atom:link href="http://www.stillnetstudios.com/rotating-pdfs-in-coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stillnetstudios.com/rotating-pdfs-in-coldfusion/</link>
	<description>Web development notes and commentary from Ryan Stille</description>
	<lastBuildDate>Wed, 01 Feb 2012 10:14:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Rolf Staflin</title>
		<link>http://www.stillnetstudios.com/rotating-pdfs-in-coldfusion/comment-page-1/#comment-366</link>
		<dc:creator>Rolf Staflin</dc:creator>
		<pubDate>Fri, 14 Mar 2008 14:49:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.stillnetstudios.com/2008/02/24/rotating-pdfs-in-coldfusion/#comment-366</guid>
		<description>I think you are right about the rotation. Bruno Lowagie, the man behind iText, wrote this code to rotate pages 90 degrees (I cut out the error handling for clarity):

            PdfDictionary pageDict;
            int rot;
            PdfReader reader = new PdfReader(&quot;test.pdf&quot;);
            int n = reader.getNumberOfPages();
            for (int i = 1; i [ TRUNCATED FOR SOME REASON?? - sorry, - ed.]

The short version, then, is that a PdfDictionary stores values in a HashMap, so when you call

dictionary.put( PdfName.ROTATE, PdfNumber.init(degreesToRotate) );

you are replacing the old value with the new one. To implement a cumulative rotation, call dictionary.get(PdfName.ROTATE) first to get the current rotation. Then just add that number to degreesToRotate.

Cheers,
/Rolf</description>
		<content:encoded><![CDATA[<p>I think you are right about the rotation. Bruno Lowagie, the man behind iText, wrote this code to rotate pages 90 degrees (I cut out the error handling for clarity):</p>
<p>            PdfDictionary pageDict;<br />
            int rot;<br />
            PdfReader reader = new PdfReader(&#8220;test.pdf&#8221;);<br />
            int n = reader.getNumberOfPages();<br />
            for (int i = 1; i [ TRUNCATED FOR SOME REASON?? - sorry, - ed.]</p>
<p>The short version, then, is that a PdfDictionary stores values in a HashMap, so when you call</p>
<p>dictionary.put( PdfName.ROTATE, PdfNumber.init(degreesToRotate) );</p>
<p>you are replacing the old value with the new one. To implement a cumulative rotation, call dictionary.get(PdfName.ROTATE) first to get the current rotation. Then just add that number to degreesToRotate.</p>
<p>Cheers,<br />
/Rolf</p>
]]></content:encoded>
	</item>
</channel>
</rss>

