pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject pdfbox-docs git commit: Site checkin for project Apache PDFBox Website
Date Tue, 07 Jun 2016 16:33:08 GMT
Repository: pdfbox-docs
Updated Branches:
  refs/heads/asf-site 28eb37928 -> 1a6a784f8


Site checkin for project Apache PDFBox Website


Project: http://git-wip-us.apache.org/repos/asf/pdfbox-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/pdfbox-docs/commit/1a6a784f
Tree: http://git-wip-us.apache.org/repos/asf/pdfbox-docs/tree/1a6a784f
Diff: http://git-wip-us.apache.org/repos/asf/pdfbox-docs/diff/1a6a784f

Branch: refs/heads/asf-site
Commit: 1a6a784f8cb689ff15385850cd1068093193c7d8
Parents: 28eb379
Author: Andreas Lehmkühler <andreas@lehmi.de>
Authored: Tue Jun 7 18:33:06 2016 +0200
Committer: Andreas Lehmkühler <andreas@lehmi.de>
Committed: Tue Jun 7 18:33:06 2016 +0200

----------------------------------------------------------------------
 content/1.8/architecture.html        | 26 ++++++++---------
 content/1.8/faq.html                 | 48 +++++++++++++++----------------
 content/2.0/cookbook/encryption.html | 42 +++++++++++++--------------
 content/mailinglists.html            |  6 ++--
 4 files changed, 61 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/1a6a784f/content/1.8/architecture.html
----------------------------------------------------------------------
diff --git a/content/1.8/architecture.html b/content/1.8/architecture.html
index f4aad24..4f673ad 100644
--- a/content/1.8/architecture.html
+++ b/content/1.8/architecture.html
@@ -246,21 +246,21 @@ doesn’t provide the functionality needed.</p>
 
 <p>A page in a pdf document is represented with a COSDictionary. The entries that are
available for a page can be seen in the PDF Reference and an example of a page looks like
this:</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;&lt;
+<p><code class="highlighter-rouge">text
+&lt;&lt;
     /Type /Page
     /MediaBox [0 0 612 915]
     /Contents 56 0 R
 &gt;&gt;
-</code></pre>
-</div>
+</code></p>
 
 <p>The information within the dictionary can be accessed using the COS model</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="n">COSDictionary</span>
<span class="n">page</span> <span class="o">=</span> <span class="o">...;</span>
-<span class="n">COSArray</span> <span class="n">mediaBox</span> <span
class="o">=</span> <span class="o">(</span><span class="n">COSArray</span><span
class="o">)</span><span class="n">page</span><span class="o">.</span><span
class="na">getDictionaryObject</span><span class="o">(</span> <span
class="s">"MediaBox"</span> <span class="o">);</span>
-<span class="n">System</span><span class="o">.</span><span class="na">out</span><span
class="o">.</span><span class="na">println</span><span class="o">(</span>
<span class="s">"Width:"</span> <span class="o">+</span> <span
class="n">mediaBox</span><span class="o">.</span><span class="na">get</span><span
class="o">(</span> <span class="mi">3</span> <span class="o">)</span>
<span class="o">);</span>
-</code></pre>
-</div>
+<p><code class="highlighter-rouge">java
+COSDictionary page = ...;
+COSArray mediaBox = (COSArray)page.getDictionaryObject( "MediaBox" );
+System.out.println( "Width:" + mediaBox.get( 3 ) );
+</code></p>
 
 <p>As can be seen from that little example the COS model provides a low level API to
access 
 information within the PDF. In order to use the COS model successfully a good knowledge of
@@ -278,11 +278,11 @@ available to access the attributes.</p>
 
 <p>The same code from above to get the page width can be rewritten to use PD Model
classes.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="n">PDPage</span>
<span class="n">page</span> <span class="o">=</span> <span class="o">...;</span>
-<span class="n">PDRectangle</span> <span class="n">mediaBox</span>
<span class="o">=</span> <span class="n">page</span><span class="o">.</span><span
class="na">getMediaBox</span><span class="o">();</span>
-<span class="n">System</span><span class="o">.</span><span class="na">out</span><span
class="o">.</span><span class="na">println</span><span class="o">(</span>
<span class="s">"Width:"</span> <span class="o">+</span> <span
class="n">mediaBox</span><span class="o">.</span><span class="na">getWidth</span><span
class="o">()</span> <span class="o">);</span>
-</code></pre>
-</div>
+<p><code class="highlighter-rouge">java
+PDPage page = ...;
+PDRectangle mediaBox = page.getMediaBox();
+System.out.println( "Width:" + mediaBox.getWidth() );
+</code></p>
 
 <p>PD Model objects sit on top of COS model. Typically, the classes in the PD Model
will only
 store a COS object and all setter/getter methods will modify data that is stored in the

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/1a6a784f/content/1.8/faq.html
----------------------------------------------------------------------
diff --git a/content/1.8/faq.html b/content/1.8/faq.html
index aafc4bd..7231308 100644
--- a/content/1.8/faq.html
+++ b/content/1.8/faq.html
@@ -155,25 +155,25 @@
 <p><a name="log4j"></a>
 ### I am getting the below Log4J warning message, how do I remove it? ###</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="nl">log4j:</span><span
class="n">WARN</span> <span class="n">No</span> <span class="n">appenders</span>
<span class="n">could</span> <span class="n">be</span> <span class="n">found</span>
<span class="k">for</span> <span class="n">logger</span> <span
class="o">(</span><span class="n">org</span><span class="o">.</span><span
class="na">apache</span><span class="o">.</span><span class="na">pdfbox</span><span
class="o">.</span><span class="na">util</span><span class="o">.</span><span
class="na">ResourceLoader</span><span class="o">).</span>
-<span class="nl">log4j:</span><span class="n">WARN</span> <span
class="n">Please</span> <span class="n">initialize</span> <span class="n">the</span>
<span class="n">log4j</span> <span class="n">system</span> <span
class="n">properly</span><span class="o">.</span>
-</code></pre>
-</div>
+<p><code class="highlighter-rouge">java
+log4j:WARN No appenders could be found for logger (org.apache.pdfbox.util.ResourceLoader).
+log4j:WARN Please initialize the log4j system properly.
+</code></p>
 
 <p>This message means that you need to configure the log4j logging system.
 See the <a href="http://logging.apache.org/log4j/1.2/manual.html">log4j documentation</a>
for more information.</p>
 
 <p>PDFBox comes with a sample log4j configuration file.  To use it you set a system
property like this</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="n">java</span>
<span class="o">-</span><span class="n">Dlog4j</span><span class="o">.</span><span
class="na">configuration</span><span class="o">=</span><span class="n">log4j</span><span
class="o">.</span><span class="na">xml</span> <span class="n">org</span><span
class="o">.</span><span class="na">apache</span><span class="o">.</span><span
class="na">pdfbox</span><span class="o">.</span><span class="na">ExtractText</span>
<span class="o">&lt;</span><span class="n">PDF</span><span
class="o">-</span><span class="n">file</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">output</span><span
class="o">-</span><span class="n">text</span><span class="o">-</span><span
class="n">file</span><span class="o">&gt;</span>
-</code></pre>
-</div>
+<p><code class="highlighter-rouge">java
+java -Dlog4j.configuration=log4j.xml org.apache.pdfbox.ExtractText &lt;PDF-file&gt;
&lt;output-text-file&gt;
+</code></p>
 
 <p>If this is not working for you then you may have to specify the log4j config file
using a URL path, like this:</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="n">log4j</span><span
class="o">.</span><span class="na">configuration</span><span class="o">=</span><span
class="nl">file:</span><span class="c1">///&lt;path to config file&gt;</span>
-</code></pre>
-</div>
+<p><code class="highlighter-rouge">java
+log4j.configuration=file:///&lt;path to config file&gt;
+</code></p>
 
 <p><a name="threadsafe"></a>
 ### Is PDFBox thread safe? ###</p>
@@ -189,20 +189,20 @@ don’t then the document will not be closed properly.  Also, you must
close all
 PDDocument objects that get created.  The following code creates <strong>two</strong>
 PDDocument objects; one from the “new PDDocument()” and the second by the load method.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="n">PDDocument</span>
<span class="n">doc</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">PDDocument</span><span class="o">();</span>
-<span class="k">try</span>
-<span class="o">{</span>
-   <span class="n">doc</span> <span class="o">=</span> <span class="n">PDDocument</span><span
class="o">.</span><span class="na">load</span><span class="o">(</span>
<span class="s">"my.pdf"</span> <span class="o">);</span>
-<span class="o">}</span>
-<span class="k">finally</span>
-<span class="o">{</span>
-   <span class="k">if</span><span class="o">(</span> <span class="n">doc</span>
<span class="o">!=</span> <span class="kc">null</span> <span class="o">)</span>
-   <span class="o">{</span>
-      <span class="n">doc</span><span class="o">.</span><span
class="na">close</span><span class="o">();</span>
-   <span class="o">}</span>
-<span class="o">}</span>
-</code></pre>
-</div>
+<p><code class="highlighter-rouge">java
+PDDocument doc = new PDDocument();
+try
+{
+   doc = PDDocument.load( "my.pdf" );
+}
+finally
+{
+   if( doc != null )
+   {
+      doc.close();
+   }
+}
+</code></p>
 
 <h2 id="text-extraction-1">Text Extraction</h2>
 

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/1a6a784f/content/2.0/cookbook/encryption.html
----------------------------------------------------------------------
diff --git a/content/2.0/cookbook/encryption.html b/content/2.0/cookbook/encryption.html
index d8978f2..0cbd1d6 100644
--- a/content/2.0/cookbook/encryption.html
+++ b/content/2.0/cookbook/encryption.html
@@ -138,28 +138,28 @@
 
 <p>This small sample shows how to encrypt a file so that it can be viewed, but not
printed..</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="n">PDDocument</span>
<span class="n">doc</span> <span class="o">=</span> <span class="n">PDDocument</span><span
class="o">.</span><span class="na">load</span><span class="o">(</span><span
class="s">"filename.pdf"</span><span class="o">);</span>
+<p>``` java
+PDDocument doc = PDDocument.load(“filename.pdf”);</p>
 
-<span class="c1">// Define the length of the encryption key.</span>
-<span class="c1">// Possible values are 40, 128 or 256.</span>
-<span class="kt">int</span> <span class="n">keyLength</span> <span
class="o">=</span> <span class="mi">256</span><span class="o">;</span>
-    
-<span class="n">AccessPermission</span> <span class="n">ap</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">AccessPermission</span><span
class="o">();</span>
-        
-<span class="c1">// disable printing, everything else is allowed</span>
-<span class="n">ap</span><span class="o">.</span><span class="na">setCanPrint</span><span
class="o">(</span><span class="kc">false</span><span class="o">);</span>
-        
-<span class="c1">// owner password (to open the file with all permissions) is "12345"</span>
-<span class="c1">// user password (to open the file but with restricted permissions,
is empty here) </span>
-<span class="n">StandardProtectionPolicy</span> <span class="n">spp</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">StandardProtectionPolicy</span><span
class="o">(</span><span class="s">"12345"</span><span class="o">,</span>
<span class="s">""</span><span class="o">,</span> <span class="n">ap</span><span
class="o">);</span>
-<span class="n">spp</span><span class="o">.</span><span class="na">setEncryptionKeyLength</span><span
class="o">(</span><span class="n">keyLength</span><span class="o">);</span>
-<span class="n">spp</span><span class="o">.</span><span class="na">setPermissions</span><span
class="o">(</span><span class="n">ap</span><span class="o">);</span>
-<span class="n">doc</span><span class="o">.</span><span class="na">protect</span><span
class="o">(</span><span class="n">spp</span><span class="o">);</span>
-        
-<span class="n">doc</span><span class="o">.</span><span class="na">save</span><span
class="o">(</span><span class="s">"filename-encrypted.pdf"</span><span
class="o">);</span>
-<span class="n">doc</span><span class="o">.</span><span class="na">close</span><span
class="o">();</span>
-</code></pre>
-</div>
+<p>// Define the length of the encryption key.
+// Possible values are 40, 128 or 256.
+int keyLength = 256;</p>
+
+<p>AccessPermission ap = new AccessPermission();</p>
+
+<p>// disable printing, everything else is allowed
+ap.setCanPrint(false);</p>
+
+<p>// owner password (to open the file with all permissions) is “12345”
+// user password (to open the file but with restricted permissions, is empty here) 
+StandardProtectionPolicy spp = new StandardProtectionPolicy(“12345”, “”, ap);
+spp.setEncryptionKeyLength(keyLength);
+spp.setPermissions(ap);
+doc.protect(spp);</p>
+
+<p>doc.save(“filename-encrypted.pdf”);
+doc.close();
+```</p>
 
             </div>
         </div>

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/1a6a784f/content/mailinglists.html
----------------------------------------------------------------------
diff --git a/content/mailinglists.html b/content/mailinglists.html
index 1d71352..ede3417 100644
--- a/content/mailinglists.html
+++ b/content/mailinglists.html
@@ -167,7 +167,7 @@ to the <strong>Commit Mailing List</strong>.</p>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#117;&#115;&#101;&#114;&#115;&#045;&#115;&#117;&#098;&#115;&#099;&#114;&#105;&#098;&#101;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Subscribe</a></td>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#117;&#115;&#101;&#114;&#115;&#045;&#117;&#110;&#115;&#117;&#098;&#115;&#099;&#114;&#105;&#098;&#101;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Unsubscribe</a></td>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#117;&#115;&#101;&#114;&#115;&#045;&#104;&#101;&#108;&#112;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Help</a></td>
-      <td><a href="http://mail-archives.apache.org/mod_mbox/pdfbox-users/">Archive</a></td>
+      <td><a href="https://lists.apache.org/list.html?users@pdfbox.apache.org">Archive</a></td>
       <td><a href="http://pdfbox-users.markmail.org/">MarkMail</a></td>
     </tr>
     <tr>
@@ -176,7 +176,7 @@ to the <strong>Commit Mailing List</strong>.</p>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#100;&#101;&#118;&#045;&#115;&#117;&#098;&#115;&#099;&#114;&#105;&#098;&#101;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Subscribe</a></td>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#100;&#101;&#118;&#045;&#117;&#110;&#115;&#117;&#098;&#115;&#099;&#114;&#105;&#098;&#101;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Unsubscribe</a></td>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#100;&#101;&#118;&#045;&#104;&#101;&#108;&#112;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Help</a></td>
-      <td><a href="http://mail-archives.apache.org/mod_mbox/pdfbox-dev/">Archive</a></td>
+      <td><a href="https://lists.apache.org/list.html?dev@pdfbox.apache.org">Archive</a></td>
       <td><a href="http://pdfbox-dev.markmail.org/">MarkMail</a></td>
     </tr>
     <tr>
@@ -185,7 +185,7 @@ to the <strong>Commit Mailing List</strong>.</p>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#099;&#111;&#109;&#109;&#105;&#116;&#115;&#045;&#115;&#117;&#098;&#115;&#099;&#114;&#105;&#098;&#101;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Subscribe</a></td>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#099;&#111;&#109;&#109;&#105;&#116;&#115;&#045;&#117;&#110;&#115;&#117;&#098;&#115;&#099;&#114;&#105;&#098;&#101;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Unsubscribe</a></td>
       <td><a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#099;&#111;&#109;&#109;&#105;&#116;&#115;&#045;&#104;&#101;&#108;&#112;&#064;&#112;&#100;&#102;&#098;&#111;&#120;&#046;&#097;&#112;&#097;&#099;&#104;&#101;&#046;&#111;&#114;&#103;">Help</a></td>
-      <td><a href="http://mail-archives.apache.org/mod_mbox/pdfbox-commits/">Archive</a></td>
+      <td><a href="https://lists.apache.org/list.html?commits@pdfbox.apache.org">Archive</a></td>
       <td><a href="http://pdfbox-commits.markmail.org/">MarkMail</a></td>
     </tr>
   </tbody>


Mime
View raw message