<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.local-guru.net,2005:/blog/tag/pdf</id>
  <link type="text/html" href="http://www.local-guru.net" rel="alternate"/>
  <link type="application/atom+xml" href="http://www.local-guru.net/blog/tag/pdf.atom" rel="self"/>
  <title>GuruBlog : Articles about pdf</title>
  <subtitle>local-guru.net</subtitle>
  <updated>2009-06-16T03:04:00+02:00</updated>
  <generator>GuruBlog engine</generator>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/177</id>
    <published>2009-06-16T03:04:00+02:00</published>
    <updated>2009-06-16T03:04:00+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2009/6/16/ebook-pdf-border-remover" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">ebook pdf border remover</title>
    <category term="ebook" scheme="http://www.local-guru.net/blog/tag/ebook"/>
    <category term="pdf" scheme="http://www.local-guru.net/blog/tag/pdf"/>
    <content type="html">&lt;p&gt;cropborder is a little java-tool i wrote to remove the white border of a pdf file, to make it more readable on an
ebook-reader.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/img/guru/cropborder.png" alt="cropborder example" /&gt;&lt;/p&gt;

&lt;p&gt;the white margin around the content is very usefull when printed on paper, but is really anoying on an ebook-reader
because it only makes the text smaller.&lt;/p&gt;

&lt;p&gt;to use the tool call it with&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;java -jar cropborder.jar [-in &amp;lt;input.pdf&amp;gt;] [-out &amp;lt;output.pdf&amp;gt;] [-f &amp;lt;scaling factor&amp;gt;] [-l &amp;lt;dots to move the left border&amp;gt;] [-d &amp;lt;dots to move the lower border&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;the default values for the parameter are&lt;/p&gt;

&lt;p&gt;in.pdf for intput
out.pdf for output
1.4 for the scaling factor
and shift by -100, and -130 points (a point is a 1/72 inch)&lt;/p&gt;

&lt;p&gt;the tool uses the iText library and is published under the "do whatever you like, but don't blame me if it goes boom"-Licence&lt;/p&gt;

&lt;p&gt;i also made a &lt;a href="http://www.local-guru.net/blog/pages/ebook-pdf-border-remover"&gt;project&lt;/a&gt; page for it&lt;/p&gt;

&lt;h2&gt;Download&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://www.local-guru.net/projects/cropborder/cropborder-0.1.zip"&gt;cropborder-0.1.zip&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/151</id>
    <published>2009-04-09T10:09:00+02:00</published>
    <updated>2009-04-09T10:09:00+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2009/4/9/rotated-text-in-reportlabs" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">rotated text in reportlabs</title>
    <category term="python" scheme="http://www.local-guru.net/blog/tag/python"/>
    <category term="pdf" scheme="http://www.local-guru.net/blog/tag/pdf"/>
    <category term="reportlab" scheme="http://www.local-guru.net/blog/tag/reportlab"/>
    <content type="html">&lt;p&gt;if you want to make a great chart like the one below in &lt;a href="http://www.reportlab.org/"&gt;reportlab&lt;/a&gt;, you need rotated text.
it isn't very complicated - its just a bit hard to find som examples on the net.&lt;/p&gt;

&lt;p&gt;the canvas in reportlab has a &lt;em&gt;saveState&lt;/em&gt; and a &lt;em&gt;restoreState&lt;/em&gt; method, and supports &lt;em&gt;rotate&lt;/em&gt; and &lt;em&gt;translate&lt;/em&gt; similar
to openGL or processing. see the code example below who it is done.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/img/guru/reportlabs_chart.png" alt="chart with rotated lables" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/66</id>
    <published>2008-09-10T09:03:00+02:00</published>
    <updated>2008-09-10T09:03:00+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2008/9/10/reportlab-test" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">ReportLab Test</title>
    <category term="python" scheme="http://www.local-guru.net/blog/tag/python"/>
    <category term="pdf" scheme="http://www.local-guru.net/blog/tag/pdf"/>
    <content type="html">&lt;p&gt;I just have tested &lt;a href="http://www.reportlab.org/"&gt;reportlab&lt;/a&gt; a python-framework for pdf generation.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;from reportlab.pdfgen import canvas
from reportlab.lib.units import cm


c = canvas.Canvas("hello.pdf")

c.drawString(2*cm,28*cm,"Hello World")

c.line( 2*cm, 26*cm, 2*cm, 16*cm)
c.line( 2*cm, 16*cm, 12*cm, 16*cm )

c.setFillColorRGB( 0, 0, 1 )
c.rect( 2.5*cm, 16*cm, 1.5*cm, 7*cm, fill = 1 )
c.setFillColorRGB( 0, 1, 0 )
c.rect( 4.5*cm, 16*cm, 1.5*cm, 6*cm, fill = 1 )
c.setFillColorRGB( 1, 0, 0 )
c.rect( 6.5*cm, 16*cm, 1.5*cm, 8*cm, fill = 1 )

c.showPage()
c.save()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this little script generates a pdf containing 'hello world' and a simple bar-chart.
i think i will give it a try if i have to generate pdf-reports the next time&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/13</id>
    <published>2007-12-07T06:42:00+01:00</published>
    <updated>2007-12-07T06:42:00+01:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2007/12/7/pdf-for-n770" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">PDF for N770</title>
    <category term="pdf" scheme="http://www.local-guru.net/blog/tag/pdf"/>
    <category term="N770" scheme="http://www.local-guru.net/blog/tag/n770"/>
    <content type="html">&lt;p&gt;I own a Nokia 770 which i use to read pdf-files in the subway.  i realy like it, but it has one downside - it is extreamly slow in changing the page if the page has to be zoomed or scrolled.
the solution i found was to define a custom papersize for my "print-to-pdf" dialog, which fits into my N770 screen without the need to scroll or zoom.&lt;/p&gt;

&lt;p&gt;if i want to read some website-content offline in the subway,
i just have to print it to pdf using my custom page-format and copy it to my device using bluetooth.&lt;/p&gt;
</content>
  </entry>
</feed>

