Author: buildbot Date: Tue Nov 4 15:18:49 2014 New Revision: 927907 Log: Staging update by buildbot for pdfbox
Modified: websites/staging/pdfbox/trunk/content/ (props changed) websites/staging/pdfbox/trunk/content/cookbook/documentcreation.html Propchange: websites/staging/pdfbox/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Tue Nov 4 15:18:49 2014 @@ -1 +1 @@ -1636601 +1636602 Modified: websites/staging/pdfbox/trunk/content/cookbook/documentcreation.html ============================================================================== --- websites/staging/pdfbox/trunk/content/cookbook/documentcreation.html (original) +++ websites/staging/pdfbox/trunk/content/cookbook/documentcreation.html Tue Nov 4 15:18:49 2014 @@ -158,18 +158,22 @@ <h2 id="document-creation">Document Creation</h2> <h3 id="create-a-blank-pdf">Create a blank PDF</h3> <p>This small sample shows how to create a new PDF document using PDFBox.</p> -<p>````java -// Create a new empty document -PDDocument document = new PDDocument();</p> -<p>// Create a new blank page and add it to the document -PDPage blankPage = new PDPage(); -document.addPage( blankPage );</p> -<p>// Save the newly created document -document.save("BlankPage.pdf");</p> -<p>// finally make sure that the document is properly -// closed. -document.close(); -````</p> +<div class="codehilite"><pre><span class="c1">// Create a new empty document</span> +<span class="n">PDDocument</span> <span class="n">document</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDDocument</span><span class="o">();</span> + +<span class="c1">// Create a new blank page and add it to the document</span> +<span class="n">PDPage</span> <span class="n">blankPage</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDPage</span><span class="o">();</span> +<span class="n">document</span><span class="o">.</span><span class="na">addPage</span><span class="o">(</span> <span class="n">blankPage</span> <span class="o">);</span> + +<span class="c1">// Save the newly created document</span> +<span class="n">document</span><span class="o">.</span><span class="na">save</span><span class="o">(</span><span class="s">"BlankPage.pdf"</span><span class="o">);</span> + +<span class="c1">// finally make sure that the document is properly</span> +<span class="c1">// closed.</span> +<span class="n">document</span><span class="o">.</span><span class="na">close</span><span class="o">();</span> +</pre></div> + + <h3 id="hello-world-using-a-pdf-base-font">Hello World using a PDF base font</h3> <p>This small sample shows how to create a new document and print the text "Hello World" using one of the PDF base fonts.</p> <div class="codehilite"><pre><span class="c1">// Create a document and add a page to it</span>