pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r969978 - /websites/production/pdfbox/content/2.0/migration.html
Date Fri, 23 Oct 2015 13:37:18 GMT
Author: msahyoun
Date: Fri Oct 23 13:37:18 2015
New Revision: 969978

Log:
Site checkin for project Apache PDFBox Website

Modified:
    websites/production/pdfbox/content/2.0/migration.html

Modified: websites/production/pdfbox/content/2.0/migration.html
==============================================================================
--- websites/production/pdfbox/content/2.0/migration.html (original)
+++ websites/production/pdfbox/content/2.0/migration.html Fri Oct 23 13:37:18 2015
@@ -247,14 +247,11 @@ and so on. The <code>add</code> method n
 <h3 id="iterating-pages">Iterating Pages</h3>
 
 <p>With PDFBox 2.0.0 the prefered way to iterate through the pages of a document is</p>
-
-<p>~~java
-for(PDPage page : document.getPages())
-{
-    ... (do something)
-}
-~~~</p>
-
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span
class="k">for</span><span class="o">(</span><span class="n">PDPage</span>
<span class="n">page</span> <span class="o">:</span> <span class="n">document</span><span
class="o">.</span><span class="na">getPages</span><span class="o">())</span>
+<span class="o">{</span>
+    <span class="o">...</span> <span class="o">(</span><span class="k">do</span>
<span class="n">something</span><span class="o">)</span>
+<span class="o">}</span>
+</code></pre></div>
 <h3 id="pdf-rendering">PDF Rendering</h3>
 
 <p>With PDFBox 2.0.0 <code>PDPage.convertToImage</code>has been removed.
Instead the new <code>PDFRenderer</code> class shall be used.</p>
@@ -275,13 +272,10 @@ for(PDPage page : document.getPages())
 <p>With PDFBox 2.0.0 <code>PDFPrinter</code> has been removed.</p>
 
 <p>Users of <code>PDFPrinter.silentPrint()</code> should now use this code:</p>
-
-<p>~~java
-PrinterJob job = PrinterJob.getPrinterJob();
-job.setPageable(new PDFPageable(document));
-job.print();
-~~~</p>
-
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span
class="n">PrinterJob</span> <span class="n">job</span> <span class="o">=</span>
<span class="n">PrinterJob</span><span class="o">.</span><span
class="na">getPrinterJob</span><span class="o">();</span>
+<span class="n">job</span><span class="o">.</span><span class="na">setPageable</span><span
class="o">(</span><span class="k">new</span> <span class="nf">PDFPageable</span><span
class="o">(</span><span class="n">document</span><span class="o">));</span>
+<span class="n">job</span><span class="o">.</span><span class="na">print</span><span
class="o">();</span>
+</code></pre></div>
 <p>While users of <code>PDFPrinter.print()</code> should now use this code:</p>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span
class="n">PrinterJob</span> <span class="n">job</span> <span class="o">=</span>
<span class="n">PrinterJob</span><span class="o">.</span><span
class="na">getPrinterJob</span><span class="o">();</span>
 <span class="n">job</span><span class="o">.</span><span class="na">setPageable</span><span
class="o">(</span><span class="k">new</span> <span class="nf">PDFPageable</span><span
class="o">(</span><span class="n">document</span><span class="o">));</span>



Mime
View raw message