<?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; Paged Media</title>
	<atom:link href="http://www.intelligrape.com/blog/tag/paged-media/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>Add Page number using Page Property of CSS</title>
		<link>http://www.intelligrape.com/blog/2010/08/20/add-page-number-using-page-property-of-css/</link>
		<comments>http://www.intelligrape.com/blog/2010/08/20/add-page-number-using-page-property-of-css/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 07:11:22 +0000</pubDate>
		<dc:creator>Uday Pratap Singh</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[HTML-UI-CSS]]></category>
		<category><![CDATA[css page number]]></category>
		<category><![CDATA[css page property]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Paged Media]]></category>

		<guid isPermaLink="false">http://www.intelligrape.com/blog/?p=1531</guid>
		<description><![CDATA[In my recent project we need to generate the pdf document from HTML page. We are using iText renderer for doing this. The client had the requirement that each page bottom right need to have number on it. All these things need to be replicated on every page. So for doing this we need to [...]]]></description>
			<content:encoded><![CDATA[<p>In my recent project we need to generate the pdf document from HTML page. We are using iText renderer for doing this. The client had the requirement that each page bottom right need to have number on it. All these things need to be replicated on every page. So for doing this we need to know more about the CSS3 page properties . I found the solution in this documentation <a href="http://www.w3.org/TR/css3-page/ ">http://www.w3.org/TR/css3-page/ </a>and <a href="http://www.w3.org/TR/CSS21/generate.html#counters">http://www.w3.org/TR/CSS21/generate.html#counters</a><br />
For doing this I did something like</p>

<div class="wp_syntax"><div class="code"><pre class="groovy">@page <span style="color: #66cc66;">&#123;</span>
        margin-top: 149px<span style="color: #66cc66;">;</span>
        margin-left: 2px<span style="color: #66cc66;">;</span>
        margin-bottom: 40px<span style="color: #66cc66;">;</span>
        margin-right: 2px<span style="color: #66cc66;">;</span>
        <span style="color: #663399;">size</span>: landscape<span style="color: #66cc66;">;</span>
        counter-increment: page<span style="color: #66cc66;">;</span>
&nbsp;
     @bottom-right <span style="color: #66cc66;">&#123;</span>
padding-right:20px<span style="color: #66cc66;">;</span>
        content: <span style="color: #ff0000;">&quot;Page &quot;</span> counter<span style="color: #66cc66;">&#40;</span>page<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
      <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Its just so simple we added and incremental page counter in the page property which can be reset as well. As my counter was incrementing after each page so I defined counter-interment at page level, although depending on the cases you can increment the counter before or after occurrence of any element like.</p>

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

<p>in above example counter will be incremented before the incrementClass appears on the page.</p>
<p>Hope it helps</p>
<p>## Uday Pratap Singh ##<br />
uday@intelligrape.com</p>
<p><a href="http://www.IntelliGrape.com/">http://www.IntelliGrape.com/</a><br />
<a href="http://in.linkedin.com/in/meudaypratap">http://in.linkedin.com/in/meudaypratap</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.intelligrape.com/blog/2010/08/20/add-page-number-using-page-property-of-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

