<?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>Intelligrape  Groovy &#38; Grails Blogs &#187; PDF generation</title>
	<atom:link href="http://www.intelligrape.com/blog/tag/pdf-generation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.intelligrape.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 07:48:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
			<title>Intelligrape  Groovy &amp; Grails Blogs</title>
			<url>http://www.intelligrape.com/blog/wp-content/uploads/2011/05/favicon2.ico</url>
			<link>http://www.intelligrape.com/blog</link>
			<width></width>
			<height></height>
			<description></description>
		</image>		<item>
		<title>Creating Paged Media with Different Paged Modes Using CSS3</title>
		<link>http://www.intelligrape.com/blog/2010/07/30/creating-paged-media-with-different-paged-modes-using-css3/</link>
		<comments>http://www.intelligrape.com/blog/2010/07/30/creating-paged-media-with-different-paged-modes-using-css3/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 11:29:13 +0000</pubDate>
		<dc:creator>Vivek Krishna</dc:creator>
				<category><![CDATA[HTML-UI-CSS]]></category>
		<category><![CDATA[Java tools]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Paged Media]]></category>
		<category><![CDATA[PDF generation]]></category>

		<guid isPermaLink="false">http://www.intelligrape.com/blog/?p=1415</guid>
		<description><![CDATA[In one of our projects, we had to create PDF documents from HTML. The iText renderer was an excellent solution to do that. However, the tricky part was that the cover page had to be of portrait orientation and the rest of the document, of landscape orientation. After doing a fair share of searching on [...]]]></description>
			<content:encoded><![CDATA[<p>In one of our projects, we had to create PDF documents from HTML. The iText renderer was an excellent solution to do that. However, the tricky part was that the cover page had to be of portrait orientation and the rest of the document, of landscape orientation. After doing a fair share of searching on the web, I came across the <a href="http://www.w3.org/TR/css3-page/#page-type" target="_blank">Documentation for CSS3 Paged Media.</a></p>
<p>This could be achieved by creating an @page rule with a page name and then, using the page name in the element, which was going to enclose the body, for which we needed a particular style.</p>
<p>For example, since I needed the landscape mode on the inner pages, I had to create a @page rule in the CSS file as</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="groovy">@page content<span style="color: #66cc66;">&#123;</span>
           <span style="color: #663399;">size</span>: A4 landscape<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

</blockquote>
<p>And a css selector,(say a div, which was going to enclose such pages)</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="groovy">div .<span style="color: #006600;">content</span><span style="color: #66cc66;">&#123;</span>
          page: content<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

</blockquote>
<p>If the HTML was something like,</p>
<blockquote><p>
&lt;content in portrait mode&gt;<br />
&lt;div class=&#8221;content&#8221;&gt;<br />
 My contents here<br />
&lt;/div&gt;<br />
&lt;content in portrait mode&gt;
</p></blockquote>
<p>&#8220;My contents here&#8221; would appear in a landscaped page.</p>
<p>Hope this helps</p>
<p>Vivek<br />
vivek[at]IntelliGrape.com</p>
<p>http://in.linkedin.com/in/svivekkrishna</p>
]]></content:encoded>
			<wfw:commentRss>http://www.intelligrape.com/blog/2010/07/30/creating-paged-media-with-different-paged-modes-using-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

