You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2015/11/16 19:57:40 UTC

[5/6] pdfbox-docs git commit: Site checkin for project Apache PDFBox Website

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/aa929f46/content/1.8/cookbook/pdfacreation.html
----------------------------------------------------------------------
diff --git a/content/1.8/cookbook/pdfacreation.html b/content/1.8/cookbook/pdfacreation.html
new file mode 100644
index 0000000..382c1fc
--- /dev/null
+++ b/content/1.8/cookbook/pdfacreation.html
@@ -0,0 +1,239 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<!--
+     
+     Licensed to the Apache Software Foundation (ASF) under one or more
+     contributor license agreements.  See the NOTICE file distributed with
+     this work for additional information regarding copyright ownership.
+     The ASF licenses this file to You under the Apache License, Version 2.0
+     (the "License"); you may not use this file except in compliance with
+     the License.  You may obtain a copy of the License at
+     
+     http://www.apache.org/licenses/LICENSE- 2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+     -->
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="The Apache PDFBox™ library is an open source Java tool for working with PDF documents. This project allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. Apache PDFBox also includes several command line utilities. Apache PDFBox is published under the Apache License v2.0.
+">
+
+    <title>Apache PDFBox | Create a valid PDF/A document</title>
+
+    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+    <link href="/assets/open-iconic/font/css/open-iconic-bootstrap.min.css" rel="stylesheet">
+    <link href="/css/pygments-github.css" rel="stylesheet">
+    
+    <link href="/css/site.css" rel="stylesheet">
+    
+    
+    
+     
+    
+    
+
+</head>
+
+<body>
+    <nav class="navbar navbar-default navbar-top">
+      <div class="container">
+        <div class="navbar-header">
+          <a href="/index.html">
+            <img class="logo" src="/images/logo-head.gif">
+          </a>
+          <p class="pull-right visible-xs">
+            <button type="button" class="btn btn-primary btn-sm" data-toggle="offcanvas">Menu</button>
+          </p>
+        </div>
+      </div>
+    </nav>
+    
+    <div class="container">
+        
+        <div class="row row-offcanvas row-offcanvas-left">
+            <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
+                
+                <ul class="sidebar">
+                    <li class="sidebar-header">Apache PDFBox</li>
+                    <li><a href="/index.html">Overview</a></li>
+                    <li><a href="/download.cgi">Downloads</a></li>
+                    
+                    <li class="sidebar-header">Community</li>
+                    <li><a href="/support.html">Support</a></li>
+                    <li><a href="/mailinglists.html">Mailing Lists</a></li>
+                    <li><a href="/team.html">Project Team</a></li>
+                    
+                    <li class="sidebar-header">Documentation</li>
+                    <li class="sidebar-node" id="v2-0">
+                        <a href="#">2.0.0 (trunk)</a>
+                        <ul>
+                            <li><a href="/2.0/migration.html">Migration Guide</a></li>
+                            <li><a href="/2.0/getting-started.html">Getting Started</a></li>
+                            <li><a href="/2.0/examples.html">Examples</a></li>
+                            <li><a href="/2.0/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v2-0-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/2.0/cookbook/encryption.html">Document Encryption</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/2.0/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/2.0.0-SNAPSHOT/javadocs/">API Docs</a></li>
+                        </ul>
+                    </li>
+                    <li class="sidebar-node" id="v1-8">
+                        <a href="#">1.8.10</a>
+                        <ul>
+                            <li><a href="/1.8/architecture.html">Architecture</a></li>
+                            <li><a href="/1.8/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v1-8-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/1.8/cookbook/documentcreation.html">Document Creation</a></li>
+                                    <li><a href="/1.8/cookbook/textextraction.html">Text Extraction</a></li>
+                                    <li><a href="/1.8/cookbook/encryption.html">Document Encryption</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithfonts.html">Working with Fonts</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithmetadata.html">Working with Metadata</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithattachments.html">Working with Attachments</a></li>
+                                    <li><a href="/1.8/cookbook/pdfavalidation.html">PDF/A Validation</a></li>
+                                    <li><a href="/1.8/cookbook/pdfacreation.html">Creating a PDF/A document</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/1.8/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/1.8.10/javadocs/">API Docs</a></li>
+                            <li><a href="/1.8/faq.html">FAQ</a></li>
+                        </ul>
+                    </li>
+                    
+                    <li class="sidebar-header">Development</li>
+                    <li><a href="/building.html">Building from Source</a></li>
+                    <li><a href="/codingconventions.html">Coding Conventions</a></li>
+                    <li><a href="/siteupdate.html">Update the Website</a></li>  
+                    <li><a href="https://builds.apache.org/view/All/job/PDFBox-trunk/">Jenkins</a></li>
+                    <li><a href="https://travis-ci.org/apache/pdfbox">Travis CI</a></li>
+                    <li><a href="https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor">SonarQube</a></li>
+                    <li><a href="https://issues.apache.org/jira/browse/PDFBOX">JIRA</a></li>
+                    <li><a href="/ideas.html">Ideas</a></li>
+                    <li><a href="/references.html">External Links</a></li>
+
+                    <li class="sidebar-header">Apache Software Foundation</li>
+                    <li><a href="http://www.apache.org/">Apache Software Foundation</a></li>
+                    <li><a href="http://www.apache.org/foundation/thanks.html">ASF Sponsors</a></li>
+                    <li><a href="http://www.apache.org/security/">Security</a></li>
+                </ul>
+            </div>
+            <div class="col-xs-12 col-sm-9">
+                <h1 id="pdf-a-creation">PDF/A Creation</h1>
+
+<p>The Apache PDFBox API can be used to create a PDF/A File. PDF/A is a PDF file with some constraints to ensure its 
+long time conservation. These constraints are described in ISO 19005.</p>
+
+<p>This small sample shows what should be added during creation of a PDF file to transform it in a valid PDF/A 
+document. The current example creates a valid PDF/A-1b document.</p>
+
+<h2 id="load-all-the-fonts-used-in-document">Load all the fonts used in document</h2>
+
+<p>The PDF/A specification enforces that the fonts used in the document are present in the PDF File. You
+have to load them. As an example:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">InputStream</span> <span class="n">fontStream</span> <span class="o">=</span> <span class="n">CreatePDFA</span><span class="o">.</span><span class="na">class</span><span class="o">.</span><span class="na">getResourceAsStream</span><span class="o">(</span><span class="s">"/org/apache/pdfbox/resources/ttf/ArialMT.ttf"</span><span class="o">);</span>
+<span class="n">PDFont</span> <span class="n">font</span> <span class="o">=</span> <span class="n">PDTrueTypeFont</span><span class="o">.</span><span class="na">loadTTF</span><span class="o">(</span><span class="n">doc</span><span class="o">,</span> <span class="n">fontStream</span><span class="o">);</span>
+</code></pre></div>
+<h2 id="including-xmp-metadata-block">Including XMP metadata block</h2>
+
+<p>It is imposed to have xmp metadata defined in the PDF. At least, the PDFA Schema (giving details on the version
+of PDF/A specification reached by the document) must be present. These lines create the xmp metadata for a
+PDF/A-1b document:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">XMPMetadata</span> <span class="n">xmp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">XMPMetadata</span><span class="o">();</span>
+<span class="n">XMPSchemaPDFAId</span> <span class="n">pdfaid</span> <span class="o">=</span> <span class="k">new</span> <span class="n">XMPSchemaPDFAId</span><span class="o">(</span><span class="n">xmp</span><span class="o">);</span>
+<span class="n">xmp</span><span class="o">.</span><span class="na">addSchema</span><span class="o">(</span><span class="n">pdfaid</span><span class="o">);</span>
+<span class="n">pdfaid</span><span class="o">.</span><span class="na">setConformance</span><span class="o">(</span><span class="s">"B"</span><span class="o">);</span>
+<span class="n">pdfaid</span><span class="o">.</span><span class="na">setPart</span><span class="o">(</span><span class="mi">1</span><span class="o">);</span>
+<span class="n">pdfaid</span><span class="o">.</span><span class="na">setAbout</span><span class="o">(</span><span class="s">""</span><span class="o">);</span>
+<span class="n">metadata</span><span class="o">.</span><span class="na">importXMPMetadata</span><span class="o">(</span><span class="n">xmp</span><span class="o">);</span>
+</code></pre></div>
+<h2 id="including-color-profile">Including color profile</h2>
+
+<p>It is mandatory to include the color profile used by the document. Different profiles can be used. This 
+example takes one present in pdfbox:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// create output intent</span>
+<span class="n">InputStream</span> <span class="n">colorProfile</span> <span class="o">=</span> <span class="n">CreatePDFA</span><span class="o">.</span><span class="na">class</span><span class="o">.</span><span class="na">getResourceAsStream</span><span class="o">(</span><span class="s">"/org/apache/pdfbox/resources/pdfa/sRGB Color Space Profile.icm"</span><span class="o">);</span>
+<span class="n">PDOutputIntent</span> <span class="n">oi</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDOutputIntent</span><span class="o">(</span><span class="n">doc</span><span class="o">,</span> <span class="n">colorProfile</span><span class="o">);</span> 
+<span class="n">oi</span><span class="o">.</span><span class="na">setInfo</span><span class="o">(</span><span class="s">"sRGB IEC61966-2.1"</span><span class="o">);</span> 
+<span class="n">oi</span><span class="o">.</span><span class="na">setOutputCondition</span><span class="o">(</span><span class="s">"sRGB IEC61966-2.1"</span><span class="o">);</span> 
+<span class="n">oi</span><span class="o">.</span><span class="na">setOutputConditionIdentifier</span><span class="o">(</span><span class="s">"sRGB IEC61966-2.1"</span><span class="o">);</span> 
+<span class="n">oi</span><span class="o">.</span><span class="na">setRegistryName</span><span class="o">(</span><span class="s">"http://www.color.org"</span><span class="o">);</span> 
+<span class="n">cat</span><span class="o">.</span><span class="na">addOutputIntent</span><span class="o">(</span><span class="n">oi</span><span class="o">);</span>
+</code></pre></div>
+<h2 id="complete-example">Complete example</h2>
+
+<p>The complete example can be found in pdfbox-example. The source file is</p>
+<div class="highlight"><pre><code class="language-" data-lang="">src/main/java/org/apache/pdfbox/examples/pdfa/CreatePDFA.java
+</code></pre></div>
+            </div>
+        </div>
+    </div>
+
+    <footer class="footer">
+        <div class="container"
+            <div class="row">
+                <div class="span3">
+                    <!-- nothing in here on purpose -->
+                </div>
+                <div class="span9">
+                    <p>Copyright © 2009&ndash;2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+                        <br/>Apache PDFBox, PDFBox, Apache, the Apache feather logo and the Apache PDFBox project logos are trademarks of The Apache Software Foundation.</p>
+                </div>
+            </div>
+        </div>
+    </footer>
+
+        <!-- Twitter Bootstrap and jQuery after this line. -->
+    <script src="//code.jquery.com/jquery-latest.js"></script>
+    <script src="/bootstrap/js/bootstrap.min.js"></script>
+    <script type="text/javascript">
+        
+        $(document).ready(function () {
+                $('[data-toggle="offcanvas"]').click(function () {
+                $('.row-offcanvas').toggleClass('active')
+            });
+        });
+        
+        $(function() {
+            // collapse tree nodes dynamically to support noscript
+            $('.sidebar-node').addClass('collapsed');
+            
+
+            // toggle expand/collapse
+            $('.sidebar-node > a').click(function(e) {
+                $(this).parent().toggleClass('collapsed');
+                e.preventDefault();
+            });
+
+            // preserve expand/collapse across page navigation
+            var path = document.location.pathname;
+            if (path.indexOf('/2.0') == 0) {
+                $('#v2-0').removeClass('collapsed');
+                if (path.indexOf('/2.0/cookbook') == 0) {
+                    $('#v2-0-cookbook').removeClass('collapsed');
+                }
+            } else {
+                $('#v1-8').removeClass('collapsed');
+                if (path.indexOf('/1.8/cookbook') == 0) {
+                    $('#v1-8-cookbook').removeClass('collapsed');
+                }
+            }
+
+        });
+    </script>
+
+</body>
+
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/aa929f46/content/1.8/cookbook/pdfavalidation.html
----------------------------------------------------------------------
diff --git a/content/1.8/cookbook/pdfavalidation.html b/content/1.8/cookbook/pdfavalidation.html
new file mode 100644
index 0000000..2f15089
--- /dev/null
+++ b/content/1.8/cookbook/pdfavalidation.html
@@ -0,0 +1,299 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<!--
+     
+     Licensed to the Apache Software Foundation (ASF) under one or more
+     contributor license agreements.  See the NOTICE file distributed with
+     this work for additional information regarding copyright ownership.
+     The ASF licenses this file to You under the Apache License, Version 2.0
+     (the "License"); you may not use this file except in compliance with
+     the License.  You may obtain a copy of the License at
+     
+     http://www.apache.org/licenses/LICENSE- 2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+     -->
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="The Apache PDFBox™ library is an open source Java tool for working with PDF documents. This project allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. Apache PDFBox also includes several command line utilities. Apache PDFBox is published under the Apache License v2.0.
+">
+
+    <title>Apache PDFBox | Cookbook - PDF/A Validation</title>
+
+    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+    <link href="/assets/open-iconic/font/css/open-iconic-bootstrap.min.css" rel="stylesheet">
+    <link href="/css/pygments-github.css" rel="stylesheet">
+    
+    <link href="/css/site.css" rel="stylesheet">
+    
+    
+    
+     
+    
+    
+
+</head>
+
+<body>
+    <nav class="navbar navbar-default navbar-top">
+      <div class="container">
+        <div class="navbar-header">
+          <a href="/index.html">
+            <img class="logo" src="/images/logo-head.gif">
+          </a>
+          <p class="pull-right visible-xs">
+            <button type="button" class="btn btn-primary btn-sm" data-toggle="offcanvas">Menu</button>
+          </p>
+        </div>
+      </div>
+    </nav>
+    
+    <div class="container">
+        
+        <div class="row row-offcanvas row-offcanvas-left">
+            <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
+                
+                <ul class="sidebar">
+                    <li class="sidebar-header">Apache PDFBox</li>
+                    <li><a href="/index.html">Overview</a></li>
+                    <li><a href="/download.cgi">Downloads</a></li>
+                    
+                    <li class="sidebar-header">Community</li>
+                    <li><a href="/support.html">Support</a></li>
+                    <li><a href="/mailinglists.html">Mailing Lists</a></li>
+                    <li><a href="/team.html">Project Team</a></li>
+                    
+                    <li class="sidebar-header">Documentation</li>
+                    <li class="sidebar-node" id="v2-0">
+                        <a href="#">2.0.0 (trunk)</a>
+                        <ul>
+                            <li><a href="/2.0/migration.html">Migration Guide</a></li>
+                            <li><a href="/2.0/getting-started.html">Getting Started</a></li>
+                            <li><a href="/2.0/examples.html">Examples</a></li>
+                            <li><a href="/2.0/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v2-0-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/2.0/cookbook/encryption.html">Document Encryption</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/2.0/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/2.0.0-SNAPSHOT/javadocs/">API Docs</a></li>
+                        </ul>
+                    </li>
+                    <li class="sidebar-node" id="v1-8">
+                        <a href="#">1.8.10</a>
+                        <ul>
+                            <li><a href="/1.8/architecture.html">Architecture</a></li>
+                            <li><a href="/1.8/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v1-8-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/1.8/cookbook/documentcreation.html">Document Creation</a></li>
+                                    <li><a href="/1.8/cookbook/textextraction.html">Text Extraction</a></li>
+                                    <li><a href="/1.8/cookbook/encryption.html">Document Encryption</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithfonts.html">Working with Fonts</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithmetadata.html">Working with Metadata</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithattachments.html">Working with Attachments</a></li>
+                                    <li><a href="/1.8/cookbook/pdfavalidation.html">PDF/A Validation</a></li>
+                                    <li><a href="/1.8/cookbook/pdfacreation.html">Creating a PDF/A document</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/1.8/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/1.8.10/javadocs/">API Docs</a></li>
+                            <li><a href="/1.8/faq.html">FAQ</a></li>
+                        </ul>
+                    </li>
+                    
+                    <li class="sidebar-header">Development</li>
+                    <li><a href="/building.html">Building from Source</a></li>
+                    <li><a href="/codingconventions.html">Coding Conventions</a></li>
+                    <li><a href="/siteupdate.html">Update the Website</a></li>  
+                    <li><a href="https://builds.apache.org/view/All/job/PDFBox-trunk/">Jenkins</a></li>
+                    <li><a href="https://travis-ci.org/apache/pdfbox">Travis CI</a></li>
+                    <li><a href="https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor">SonarQube</a></li>
+                    <li><a href="https://issues.apache.org/jira/browse/PDFBOX">JIRA</a></li>
+                    <li><a href="/ideas.html">Ideas</a></li>
+                    <li><a href="/references.html">External Links</a></li>
+
+                    <li class="sidebar-header">Apache Software Foundation</li>
+                    <li><a href="http://www.apache.org/">Apache Software Foundation</a></li>
+                    <li><a href="http://www.apache.org/foundation/thanks.html">ASF Sponsors</a></li>
+                    <li><a href="http://www.apache.org/security/">Security</a></li>
+                </ul>
+            </div>
+            <div class="col-xs-12 col-sm-9">
+                <h1 id="pdf-a-validation">PDF/A Validation</h1>
+
+<p>The Apache Preflight library is a Java tool that implements a parser compliant with the ISO-19005 specification (aka PDF/A-1).
+Check Compliance with PDF/A-1b</p>
+
+<p>This small sample shows how to check the compliance of a file with the PDF/A-1b specification.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">ValidationResult</span> <span class="n">result</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
+
+<span class="n">FileDataSource</span> <span class="n">fd</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FileDataSource</span><span class="o">(</span><span class="n">args</span><span class="o">[</span><span class="mi">0</span><span class="o">]);</span>
+<span class="n">PreflightParser</span> <span class="n">parser</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PreflightParser</span><span class="o">(</span><span class="n">fd</span><span class="o">);</span>
+<span class="k">try</span>
+<span class="o">{</span>
+
+    <span class="cm">/* Parse the PDF file with PreflightParser that inherits from the NonSequentialParser.
+     * Some additional controls are present to check a set of PDF/A requirements. 
+     * (Stream length consistency, EOL after some Keyword...)
+     */</span>
+    <span class="n">parser</span><span class="o">.</span><span class="na">parse</span><span class="o">();</span>
+
+    <span class="cm">/* Once the syntax validation is done, 
+     * the parser can provide a PreflightDocument 
+     * (that inherits from PDDocument) 
+     * This document process the end of PDF/A validation.
+     */</span>
+    <span class="n">PreflightDocument</span> <span class="n">document</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="na">getPreflightDocument</span><span class="o">();</span>
+    <span class="n">document</span><span class="o">.</span><span class="na">validate</span><span class="o">();</span>
+
+    <span class="c1">// Get validation result</span>
+    <span class="n">result</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="na">getResult</span><span class="o">();</span>
+    <span class="n">document</span><span class="o">.</span><span class="na">close</span><span class="o">();</span>
+
+<span class="o">}</span>
+<span class="k">catch</span> <span class="o">(</span><span class="n">SyntaxValidationException</span> <span class="n">e</span><span class="o">)</span>
+<span class="o">{</span>
+    <span class="cm">/* the parse method can throw a SyntaxValidationException 
+     * if the PDF file can't be parsed.
+     * In this case, the exception contains an instance of ValidationResult  
+     */</span>
+    <span class="n">result</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="na">getResult</span><span class="o">();</span>
+<span class="o">}</span>
+
+<span class="c1">// display validation result</span>
+<span class="k">if</span> <span class="o">(</span><span class="n">result</span><span class="o">.</span><span class="na">isValid</span><span class="o">())</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">"The file "</span> <span class="o">+</span> <span class="n">args</span><span class="o">[</span><span class="mi">0</span><span class="o">]</span> <span class="o">+</span> <span class="s">" is a valid PDF/A-1b file"</span><span class="o">);</span>
+<span class="o">}</span>
+<span class="k">else</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">"The file"</span> <span class="o">+</span> <span class="n">args</span><span class="o">[</span><span class="mi">0</span><span class="o">]</span> <span class="o">+</span> <span class="s">" is not valid, error(s) :"</span><span class="o">);</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">ValidationError</span> <span class="n">error</span> <span class="o">:</span> <span class="n">result</span><span class="o">.</span><span class="na">getErrorsList</span><span class="o">())</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="n">error</span><span class="o">.</span><span class="na">getErrorCode</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : "</span> <span class="o">+</span> <span class="n">error</span><span class="o">.</span><span class="na">getDetails</span><span class="o">());</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</code></pre></div>
+<h2 id="categories-of-validation-error">Categories of Validation Error</h2>
+
+<p>If a validation fails, the ValidationResult object contains all causes of the failure.
+In order to help in the failure understanding, all error codes have the following form X[.Y[.Z]] where :</p>
+
+<ul>
+<li>&#39;X&#39; is the category (ex : Font validation error...)</li>
+<li>&#39;Y&#39; represent a subsection of the category (ex : &quot;Font with Glyph error&quot;)</li>
+<li>&#39;Z&#39; represent the cause of the error (ex : &quot;Font with a missing Glyph&quot;)</li>
+</ul>
+
+<p>Category (&#39;Y&#39;) and cause (&#39;Z&#39;) may be missing according to the difficulty to identify the error detail.</p>
+
+<p>Here after, you can find all Categories (for detailed cause, see constants in the <code>PreflightConstants</code> interface) :</p>
+
+<table><thead>
+<tr>
+<th>Category</th>
+<th>Description</th>
+</tr>
+</thead><tbody>
+<tr>
+<td>1[.y[.z]]</td>
+<td>Syntax Error</td>
+</tr>
+<tr>
+<td>2[.y[.z]]</td>
+<td>Graphic Error</td>
+</tr>
+<tr>
+<td>3[.y[.z]]</td>
+<td>Font Error</td>
+</tr>
+<tr>
+<td>4[.y[.z]]</td>
+<td>Transparency Error</td>
+</tr>
+<tr>
+<td>5[.y[.z]]</td>
+<td>Annotation Error</td>
+</tr>
+<tr>
+<td>6[.y[.z]]</td>
+<td>Action Error</td>
+</tr>
+<tr>
+<td>7[.y[.z]]</td>
+<td>Metadata Error</td>
+</tr>
+</tbody></table>
+
+            </div>
+        </div>
+    </div>
+
+    <footer class="footer">
+        <div class="container"
+            <div class="row">
+                <div class="span3">
+                    <!-- nothing in here on purpose -->
+                </div>
+                <div class="span9">
+                    <p>Copyright © 2009&ndash;2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+                        <br/>Apache PDFBox, PDFBox, Apache, the Apache feather logo and the Apache PDFBox project logos are trademarks of The Apache Software Foundation.</p>
+                </div>
+            </div>
+        </div>
+    </footer>
+
+        <!-- Twitter Bootstrap and jQuery after this line. -->
+    <script src="//code.jquery.com/jquery-latest.js"></script>
+    <script src="/bootstrap/js/bootstrap.min.js"></script>
+    <script type="text/javascript">
+        
+        $(document).ready(function () {
+                $('[data-toggle="offcanvas"]').click(function () {
+                $('.row-offcanvas').toggleClass('active')
+            });
+        });
+        
+        $(function() {
+            // collapse tree nodes dynamically to support noscript
+            $('.sidebar-node').addClass('collapsed');
+            
+
+            // toggle expand/collapse
+            $('.sidebar-node > a').click(function(e) {
+                $(this).parent().toggleClass('collapsed');
+                e.preventDefault();
+            });
+
+            // preserve expand/collapse across page navigation
+            var path = document.location.pathname;
+            if (path.indexOf('/2.0') == 0) {
+                $('#v2-0').removeClass('collapsed');
+                if (path.indexOf('/2.0/cookbook') == 0) {
+                    $('#v2-0-cookbook').removeClass('collapsed');
+                }
+            } else {
+                $('#v1-8').removeClass('collapsed');
+                if (path.indexOf('/1.8/cookbook') == 0) {
+                    $('#v1-8-cookbook').removeClass('collapsed');
+                }
+            }
+
+        });
+    </script>
+
+</body>
+
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/aa929f46/content/1.8/cookbook/rendering.html
----------------------------------------------------------------------
diff --git a/content/1.8/cookbook/rendering.html b/content/1.8/cookbook/rendering.html
new file mode 100644
index 0000000..e70c066
--- /dev/null
+++ b/content/1.8/cookbook/rendering.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<!--
+     
+     Licensed to the Apache Software Foundation (ASF) under one or more
+     contributor license agreements.  See the NOTICE file distributed with
+     this work for additional information regarding copyright ownership.
+     The ASF licenses this file to You under the Apache License, Version 2.0
+     (the "License"); you may not use this file except in compliance with
+     the License.  You may obtain a copy of the License at
+     
+     http://www.apache.org/licenses/LICENSE- 2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+     -->
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="The Apache PDFBox™ library is an open source Java tool for working with PDF documents. This project allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. Apache PDFBox also includes several command line utilities. Apache PDFBox is published under the Apache License v2.0.
+">
+
+    <title>Apache PDFBox | Cookbook - Rendering</title>
+
+    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+    <link href="/assets/open-iconic/font/css/open-iconic-bootstrap.min.css" rel="stylesheet">
+    <link href="/css/pygments-github.css" rel="stylesheet">
+    
+    <link href="/css/site.css" rel="stylesheet">
+    
+    
+    
+     
+    
+    
+
+</head>
+
+<body>
+    <nav class="navbar navbar-default navbar-top">
+      <div class="container">
+        <div class="navbar-header">
+          <a href="/index.html">
+            <img class="logo" src="/images/logo-head.gif">
+          </a>
+          <p class="pull-right visible-xs">
+            <button type="button" class="btn btn-primary btn-sm" data-toggle="offcanvas">Menu</button>
+          </p>
+        </div>
+      </div>
+    </nav>
+    
+    <div class="container">
+        
+        <div class="row row-offcanvas row-offcanvas-left">
+            <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
+                
+                <ul class="sidebar">
+                    <li class="sidebar-header">Apache PDFBox</li>
+                    <li><a href="/index.html">Overview</a></li>
+                    <li><a href="/download.cgi">Downloads</a></li>
+                    
+                    <li class="sidebar-header">Community</li>
+                    <li><a href="/support.html">Support</a></li>
+                    <li><a href="/mailinglists.html">Mailing Lists</a></li>
+                    <li><a href="/team.html">Project Team</a></li>
+                    
+                    <li class="sidebar-header">Documentation</li>
+                    <li class="sidebar-node" id="v2-0">
+                        <a href="#">2.0.0 (trunk)</a>
+                        <ul>
+                            <li><a href="/2.0/migration.html">Migration Guide</a></li>
+                            <li><a href="/2.0/getting-started.html">Getting Started</a></li>
+                            <li><a href="/2.0/examples.html">Examples</a></li>
+                            <li><a href="/2.0/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v2-0-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/2.0/cookbook/encryption.html">Document Encryption</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/2.0/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/2.0.0-SNAPSHOT/javadocs/">API Docs</a></li>
+                        </ul>
+                    </li>
+                    <li class="sidebar-node" id="v1-8">
+                        <a href="#">1.8.10</a>
+                        <ul>
+                            <li><a href="/1.8/architecture.html">Architecture</a></li>
+                            <li><a href="/1.8/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v1-8-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/1.8/cookbook/documentcreation.html">Document Creation</a></li>
+                                    <li><a href="/1.8/cookbook/textextraction.html">Text Extraction</a></li>
+                                    <li><a href="/1.8/cookbook/encryption.html">Document Encryption</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithfonts.html">Working with Fonts</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithmetadata.html">Working with Metadata</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithattachments.html">Working with Attachments</a></li>
+                                    <li><a href="/1.8/cookbook/pdfavalidation.html">PDF/A Validation</a></li>
+                                    <li><a href="/1.8/cookbook/pdfacreation.html">Creating a PDF/A document</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/1.8/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/1.8.10/javadocs/">API Docs</a></li>
+                            <li><a href="/1.8/faq.html">FAQ</a></li>
+                        </ul>
+                    </li>
+                    
+                    <li class="sidebar-header">Development</li>
+                    <li><a href="/building.html">Building from Source</a></li>
+                    <li><a href="/codingconventions.html">Coding Conventions</a></li>
+                    <li><a href="/siteupdate.html">Update the Website</a></li>  
+                    <li><a href="https://builds.apache.org/view/All/job/PDFBox-trunk/">Jenkins</a></li>
+                    <li><a href="https://travis-ci.org/apache/pdfbox">Travis CI</a></li>
+                    <li><a href="https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor">SonarQube</a></li>
+                    <li><a href="https://issues.apache.org/jira/browse/PDFBOX">JIRA</a></li>
+                    <li><a href="/ideas.html">Ideas</a></li>
+                    <li><a href="/references.html">External Links</a></li>
+
+                    <li class="sidebar-header">Apache Software Foundation</li>
+                    <li><a href="http://www.apache.org/">Apache Software Foundation</a></li>
+                    <li><a href="http://www.apache.org/foundation/thanks.html">ASF Sponsors</a></li>
+                    <li><a href="http://www.apache.org/security/">Security</a></li>
+                </ul>
+            </div>
+            <div class="col-xs-12 col-sm-9">
+                <h1 id="document-rendering">Document Rendering</h1>
+
+<h2 id="convert-a-document-to-images">Convert a document to images</h2>
+
+<p>This small sample shows how to render (convert to images) a PDF document using PDFBox.</p>
+<div class="highlight"><pre><code class="language-" data-lang="">:::java
+    String filename = "YOURFILENAMEHERE.pdf";
+
+    // open the document
+    PDDocument doc = PDDocument.loadNonSeq(new File(filename), null);
+
+    boolean b;
+    List&lt;PDPage&gt; pages = doc.getDocumentCatalog().getAllPages();
+    for (int p = 0; p &lt; pages.size(); ++p)
+    {
+        // RGB image with 300 dpi
+        BufferedImage bim = pages.get(p).convertToImage(BufferedImage.TYPE_INT_RGB, 300);
+
+        // save as PNG with default metadata
+        b = ImageIO.write(bim, "png", new File("rgbpage" + (p+1) + ".png"));
+        if (!b)
+        {
+            // error handling
+        }
+
+        // B/W image with 300 dpi
+        bim = pages.get(p).convertToImage(BufferedImage.TYPE_BYTE_BINARY, 300);
+
+        // save as TIF with dpi in the metadata
+        // PDFBox will choose the best compression for you - here: CCITT G4
+        // you need to add jai_imageio.jar to your classpath for this to work
+        b = ImageIOUtil.writeImage(bim, "bwpage-" + (p+1) + ".tif", 300);
+        if (!b)
+        {
+            // error handling
+        }
+    }
+
+    doc.close();
+</code></pre></div>
+            </div>
+        </div>
+    </div>
+
+    <footer class="footer">
+        <div class="container"
+            <div class="row">
+                <div class="span3">
+                    <!-- nothing in here on purpose -->
+                </div>
+                <div class="span9">
+                    <p>Copyright © 2009&ndash;2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+                        <br/>Apache PDFBox, PDFBox, Apache, the Apache feather logo and the Apache PDFBox project logos are trademarks of The Apache Software Foundation.</p>
+                </div>
+            </div>
+        </div>
+    </footer>
+
+        <!-- Twitter Bootstrap and jQuery after this line. -->
+    <script src="//code.jquery.com/jquery-latest.js"></script>
+    <script src="/bootstrap/js/bootstrap.min.js"></script>
+    <script type="text/javascript">
+        
+        $(document).ready(function () {
+                $('[data-toggle="offcanvas"]').click(function () {
+                $('.row-offcanvas').toggleClass('active')
+            });
+        });
+        
+        $(function() {
+            // collapse tree nodes dynamically to support noscript
+            $('.sidebar-node').addClass('collapsed');
+            
+
+            // toggle expand/collapse
+            $('.sidebar-node > a').click(function(e) {
+                $(this).parent().toggleClass('collapsed');
+                e.preventDefault();
+            });
+
+            // preserve expand/collapse across page navigation
+            var path = document.location.pathname;
+            if (path.indexOf('/2.0') == 0) {
+                $('#v2-0').removeClass('collapsed');
+                if (path.indexOf('/2.0/cookbook') == 0) {
+                    $('#v2-0-cookbook').removeClass('collapsed');
+                }
+            } else {
+                $('#v1-8').removeClass('collapsed');
+                if (path.indexOf('/1.8/cookbook') == 0) {
+                    $('#v1-8-cookbook').removeClass('collapsed');
+                }
+            }
+
+        });
+    </script>
+
+</body>
+
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/aa929f46/content/1.8/cookbook/textextraction.html
----------------------------------------------------------------------
diff --git a/content/1.8/cookbook/textextraction.html b/content/1.8/cookbook/textextraction.html
new file mode 100644
index 0000000..a7ed24b
--- /dev/null
+++ b/content/1.8/cookbook/textextraction.html
@@ -0,0 +1,320 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<!--
+     
+     Licensed to the Apache Software Foundation (ASF) under one or more
+     contributor license agreements.  See the NOTICE file distributed with
+     this work for additional information regarding copyright ownership.
+     The ASF licenses this file to You under the Apache License, Version 2.0
+     (the "License"); you may not use this file except in compliance with
+     the License.  You may obtain a copy of the License at
+     
+     http://www.apache.org/licenses/LICENSE- 2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+     -->
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="The Apache PDFBox™ library is an open source Java tool for working with PDF documents. This project allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. Apache PDFBox also includes several command line utilities. Apache PDFBox is published under the Apache License v2.0.
+">
+
+    <title>Apache PDFBox | Cookbook - Textextraction</title>
+
+    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+    <link href="/assets/open-iconic/font/css/open-iconic-bootstrap.min.css" rel="stylesheet">
+    <link href="/css/pygments-github.css" rel="stylesheet">
+    
+    <link href="/css/site.css" rel="stylesheet">
+    
+    
+    
+     
+    
+    
+
+</head>
+
+<body>
+    <nav class="navbar navbar-default navbar-top">
+      <div class="container">
+        <div class="navbar-header">
+          <a href="/index.html">
+            <img class="logo" src="/images/logo-head.gif">
+          </a>
+          <p class="pull-right visible-xs">
+            <button type="button" class="btn btn-primary btn-sm" data-toggle="offcanvas">Menu</button>
+          </p>
+        </div>
+      </div>
+    </nav>
+    
+    <div class="container">
+        
+        <div class="row row-offcanvas row-offcanvas-left">
+            <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
+                
+                <ul class="sidebar">
+                    <li class="sidebar-header">Apache PDFBox</li>
+                    <li><a href="/index.html">Overview</a></li>
+                    <li><a href="/download.cgi">Downloads</a></li>
+                    
+                    <li class="sidebar-header">Community</li>
+                    <li><a href="/support.html">Support</a></li>
+                    <li><a href="/mailinglists.html">Mailing Lists</a></li>
+                    <li><a href="/team.html">Project Team</a></li>
+                    
+                    <li class="sidebar-header">Documentation</li>
+                    <li class="sidebar-node" id="v2-0">
+                        <a href="#">2.0.0 (trunk)</a>
+                        <ul>
+                            <li><a href="/2.0/migration.html">Migration Guide</a></li>
+                            <li><a href="/2.0/getting-started.html">Getting Started</a></li>
+                            <li><a href="/2.0/examples.html">Examples</a></li>
+                            <li><a href="/2.0/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v2-0-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/2.0/cookbook/encryption.html">Document Encryption</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/2.0/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/2.0.0-SNAPSHOT/javadocs/">API Docs</a></li>
+                        </ul>
+                    </li>
+                    <li class="sidebar-node" id="v1-8">
+                        <a href="#">1.8.10</a>
+                        <ul>
+                            <li><a href="/1.8/architecture.html">Architecture</a></li>
+                            <li><a href="/1.8/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v1-8-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/1.8/cookbook/documentcreation.html">Document Creation</a></li>
+                                    <li><a href="/1.8/cookbook/textextraction.html">Text Extraction</a></li>
+                                    <li><a href="/1.8/cookbook/encryption.html">Document Encryption</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithfonts.html">Working with Fonts</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithmetadata.html">Working with Metadata</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithattachments.html">Working with Attachments</a></li>
+                                    <li><a href="/1.8/cookbook/pdfavalidation.html">PDF/A Validation</a></li>
+                                    <li><a href="/1.8/cookbook/pdfacreation.html">Creating a PDF/A document</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/1.8/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/1.8.10/javadocs/">API Docs</a></li>
+                            <li><a href="/1.8/faq.html">FAQ</a></li>
+                        </ul>
+                    </li>
+                    
+                    <li class="sidebar-header">Development</li>
+                    <li><a href="/building.html">Building from Source</a></li>
+                    <li><a href="/codingconventions.html">Coding Conventions</a></li>
+                    <li><a href="/siteupdate.html">Update the Website</a></li>  
+                    <li><a href="https://builds.apache.org/view/All/job/PDFBox-trunk/">Jenkins</a></li>
+                    <li><a href="https://travis-ci.org/apache/pdfbox">Travis CI</a></li>
+                    <li><a href="https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor">SonarQube</a></li>
+                    <li><a href="https://issues.apache.org/jira/browse/PDFBOX">JIRA</a></li>
+                    <li><a href="/ideas.html">Ideas</a></li>
+                    <li><a href="/references.html">External Links</a></li>
+
+                    <li class="sidebar-header">Apache Software Foundation</li>
+                    <li><a href="http://www.apache.org/">Apache Software Foundation</a></li>
+                    <li><a href="http://www.apache.org/foundation/thanks.html">ASF Sponsors</a></li>
+                    <li><a href="http://www.apache.org/security/">Security</a></li>
+                </ul>
+            </div>
+            <div class="col-xs-12 col-sm-9">
+                <h1 id="textextraction">Textextraction</h1>
+
+<h2 id="extracting-text">Extracting Text</h2>
+
+<p>See class:org.apache.pdfbox.util.PDFTextStripper<br>
+See class:org.apache.pdfbox.searchengine.lucene.LucenePDFDocument<br>
+See command line app:ExtractText  </p>
+
+<p>One of the main features of PDFBox is its ability to quickly and accurately extract text 
+from a variety of PDF documents. This functionality is encapsulated in the 
+org.apache.pdfbox.util.PDFTextStripper and can be easily executed on the command line with 
+org.apache.pdfbox.ExtractText.</p>
+
+<h2 id="lucene-integration">Lucene Integration</h2>
+
+<p>Lucene is an open source text search library from the Apache Jakarta Project. In order for
+Lucene to be able to index a PDF document it must first be converted to text. PDFBox provides 
+a simple approach for adding PDF documents into a Lucene index.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">Document</span> <span class="n">luceneDocument</span> <span class="o">=</span> <span class="n">LucenePDFDocument</span><span class="o">.</span><span class="na">getDocument</span><span class="o">(</span> <span class="o">...</span> <span class="o">);</span>
+</code></pre></div>
+<p>Now that you hava a Lucene Document object, you can add it to the Lucene index just like 
+you would if it had been created from a text or HTML file. The LucenePDFDocument automatically 
+extracts a variety of metadata fields from the PDF to be added to the index, the javadoc 
+shows details on those fields. This approach is very simple and should be sufficient for 
+most users, if not then you can use some of the advanced text extraction techniques 
+described in the next section.</p>
+
+<h2 id="advanced-text-extraction">Advanced Text Extraction</h2>
+
+<p>Some applications will have complex text extraction requiments and neither the command 
+line application nor the LucenePDFDocument will be able to fulfill those requirements. 
+It is possible for users to utilize or extend the PDFTextStripper class to meet some of 
+these requirements.</p>
+
+<h3 id="limiting-the-extracted-text">Limiting The Extracted Text</h3>
+
+<p>There are several ways that we can limit the text that is extracted during the extraction 
+process. The simplest is to specify the range of pages that you want to be extracted. 
+For example, to only extract text from the second and third pages of the PDF document 
+you could do this:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">PDFTextStripper</span> <span class="n">stripper</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDFTextStripper</span><span class="o">();</span>
+<span class="n">stripper</span><span class="o">.</span><span class="na">setStartPage</span><span class="o">(</span> <span class="mi">2</span> <span class="o">);</span>
+<span class="n">stripper</span><span class="o">.</span><span class="na">setEndPage</span><span class="o">(</span> <span class="mi">3</span> <span class="o">);</span>
+<span class="n">stripper</span><span class="o">.</span><span class="na">writeText</span><span class="o">(</span> <span class="o">...</span> <span class="o">);</span>
+</code></pre></div>
+<p>NOTE: The startPage and endPage properties of PDFTextStripper are 1 based and inclusive.</p>
+
+<p>If you wanted to start on page 2 and extract to the end of the document then you would just
+set the startPage property. By default all pages in the pdf document are extracted.</p>
+
+<p>It is also possible to limit the extracted text to be between two bookmarks in the page. 
+If you are not familiar with how to use bookmarks in PDFBox then you should review the 
+Bookmarks page. Similar to the startPage/endPage properties, PDFTextStripper also has 
+startBookmark/endBookmark properties. There are some caveats to be aware of when using this
+feature of the PDFTextStripper. Not all bookmarks point to a page in the current PDF document. </p>
+
+<p>The possible states of a bookmark are:</p>
+
+<ul>
+<li>null - The property was not set, this is the default.</li>
+<li>Points to page in the PDF - The property was set and points to a valid page in the PDF</li>
+<li>Bookmark does not point to anything - The property was set but the bookmark does not point to any page</li>
+<li>Bookmark points to external action - The property was set, but it points to a page in a different PDF or performs an action when activated</li>
+</ul>
+
+<p>The table below will describe how PDFBox behaves in the various scenarios:</p>
+
+<table><thead>
+<tr>
+<th>Start Bookmark</th>
+<th>End Bookmark</th>
+<th>Result</th>
+</tr>
+</thead><tbody>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>This is the default, the properties have no effect on the text extraction.</td>
+</tr>
+<tr>
+<td>Points to a page in the PDF</td>
+<td>null</td>
+<td>Text extraction will begin on the page that this bookmark points to and go until the end of the document.</td>
+</tr>
+<tr>
+<td>null</td>
+<td>Points to a page in the PDF</td>
+<td>Text extraction will begin on the first page and stop at the end of the page that this bookmark points to.</td>
+</tr>
+<tr>
+<td>Bookmark does not point to anything</td>
+<td>null</td>
+<td>Because the PDFTextStripper cannot determine a start page based on the bookmark, it will start on the first page and go until the end of the document.</td>
+</tr>
+<tr>
+<td>null</td>
+<td>Bookmark does not point to anything</td>
+<td>Because the PDFTextStripper cannot determine a end page based on the bookmark, it will start on the first page and go until the end of the document.</td>
+</tr>
+<tr>
+<td>Bookmark does not point to anything</td>
+<td>Bookmark does not point to anything</td>
+<td>This is a special case! If the startBookmark and endBookmark are exactly the same then no text will be extracted. If they are different then it is not possible for the PDFTextStripper to determine that pages so it will include the entire document.</td>
+</tr>
+<tr>
+<td>Bookmark points to external action</td>
+<td>Bookmark points to external action</td>
+<td>If either the startBookmark or the endBookmark refer to an external page or execute an action then an OutlineNotLocalException will be thrown to indicate to the user that the bookmark is not valid.</td>
+</tr>
+</tbody></table>
+
+<p>NOTE: PDFTextStripper will check both the startPage/endPage and the startBookmark/endBookmark to determine if text should be extracted from the current page.</p>
+
+<h3 id="external-glyph-list">External Glyph List</h3>
+
+<p>Some PDF files need to map between glyph names and Unicode values during text extraction. 
+PDFBox comes with an Adobe Glyph List, but you may encounter files with glyph names that 
+are not in that map. To use your own glyphlist file, supply the file name to the <code>glyphlist_ext</code> JVM property.</p>
+
+<h3 id="right-to-left-text">Right to Left Text</h3>
+
+<p>Extracting text in languages whose text goes from right to left (such as Arabic and Hebrew)
+in PDF files can result in text that is backwards. PDFBox can normalize and reverse the text
+if the ICU4J jar file has been placed on the classpath (it is an optional dependency). 
+Note that you should also enable sorting with either org.apache.pdfbox.util.PDFTextStripper 
+or org.apache.pdfbox.ExtractText to ensure accurate output.</p>
+
+            </div>
+        </div>
+    </div>
+
+    <footer class="footer">
+        <div class="container"
+            <div class="row">
+                <div class="span3">
+                    <!-- nothing in here on purpose -->
+                </div>
+                <div class="span9">
+                    <p>Copyright © 2009&ndash;2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+                        <br/>Apache PDFBox, PDFBox, Apache, the Apache feather logo and the Apache PDFBox project logos are trademarks of The Apache Software Foundation.</p>
+                </div>
+            </div>
+        </div>
+    </footer>
+
+        <!-- Twitter Bootstrap and jQuery after this line. -->
+    <script src="//code.jquery.com/jquery-latest.js"></script>
+    <script src="/bootstrap/js/bootstrap.min.js"></script>
+    <script type="text/javascript">
+        
+        $(document).ready(function () {
+                $('[data-toggle="offcanvas"]').click(function () {
+                $('.row-offcanvas').toggleClass('active')
+            });
+        });
+        
+        $(function() {
+            // collapse tree nodes dynamically to support noscript
+            $('.sidebar-node').addClass('collapsed');
+            
+
+            // toggle expand/collapse
+            $('.sidebar-node > a').click(function(e) {
+                $(this).parent().toggleClass('collapsed');
+                e.preventDefault();
+            });
+
+            // preserve expand/collapse across page navigation
+            var path = document.location.pathname;
+            if (path.indexOf('/2.0') == 0) {
+                $('#v2-0').removeClass('collapsed');
+                if (path.indexOf('/2.0/cookbook') == 0) {
+                    $('#v2-0-cookbook').removeClass('collapsed');
+                }
+            } else {
+                $('#v1-8').removeClass('collapsed');
+                if (path.indexOf('/1.8/cookbook') == 0) {
+                    $('#v1-8-cookbook').removeClass('collapsed');
+                }
+            }
+
+        });
+    </script>
+
+</body>
+
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/pdfbox-docs/blob/aa929f46/content/1.8/cookbook/workingwithattachments.html
----------------------------------------------------------------------
diff --git a/content/1.8/cookbook/workingwithattachments.html b/content/1.8/cookbook/workingwithattachments.html
new file mode 100644
index 0000000..ab8a431
--- /dev/null
+++ b/content/1.8/cookbook/workingwithattachments.html
@@ -0,0 +1,240 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<!--
+     
+     Licensed to the Apache Software Foundation (ASF) under one or more
+     contributor license agreements.  See the NOTICE file distributed with
+     this work for additional information regarding copyright ownership.
+     The ASF licenses this file to You under the Apache License, Version 2.0
+     (the "License"); you may not use this file except in compliance with
+     the License.  You may obtain a copy of the License at
+     
+     http://www.apache.org/licenses/LICENSE- 2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+     -->
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="The Apache PDFBox™ library is an open source Java tool for working with PDF documents. This project allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. Apache PDFBox also includes several command line utilities. Apache PDFBox is published under the Apache License v2.0.
+">
+
+    <title>Apache PDFBox | Cookbook - Working with Attachments</title>
+
+    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+    <link href="/assets/open-iconic/font/css/open-iconic-bootstrap.min.css" rel="stylesheet">
+    <link href="/css/pygments-github.css" rel="stylesheet">
+    
+    <link href="/css/site.css" rel="stylesheet">
+    
+    
+    
+     
+    
+    
+
+</head>
+
+<body>
+    <nav class="navbar navbar-default navbar-top">
+      <div class="container">
+        <div class="navbar-header">
+          <a href="/index.html">
+            <img class="logo" src="/images/logo-head.gif">
+          </a>
+          <p class="pull-right visible-xs">
+            <button type="button" class="btn btn-primary btn-sm" data-toggle="offcanvas">Menu</button>
+          </p>
+        </div>
+      </div>
+    </nav>
+    
+    <div class="container">
+        
+        <div class="row row-offcanvas row-offcanvas-left">
+            <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
+                
+                <ul class="sidebar">
+                    <li class="sidebar-header">Apache PDFBox</li>
+                    <li><a href="/index.html">Overview</a></li>
+                    <li><a href="/download.cgi">Downloads</a></li>
+                    
+                    <li class="sidebar-header">Community</li>
+                    <li><a href="/support.html">Support</a></li>
+                    <li><a href="/mailinglists.html">Mailing Lists</a></li>
+                    <li><a href="/team.html">Project Team</a></li>
+                    
+                    <li class="sidebar-header">Documentation</li>
+                    <li class="sidebar-node" id="v2-0">
+                        <a href="#">2.0.0 (trunk)</a>
+                        <ul>
+                            <li><a href="/2.0/migration.html">Migration Guide</a></li>
+                            <li><a href="/2.0/getting-started.html">Getting Started</a></li>
+                            <li><a href="/2.0/examples.html">Examples</a></li>
+                            <li><a href="/2.0/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v2-0-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/2.0/cookbook/encryption.html">Document Encryption</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/2.0/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/2.0.0-SNAPSHOT/javadocs/">API Docs</a></li>
+                        </ul>
+                    </li>
+                    <li class="sidebar-node" id="v1-8">
+                        <a href="#">1.8.10</a>
+                        <ul>
+                            <li><a href="/1.8/architecture.html">Architecture</a></li>
+                            <li><a href="/1.8/dependencies.html">Dependencies</a></li>
+                            <li class="sidebar-node" id="v1-8-cookbook">
+                                <a href="#">Cookbook</a>
+                                <ul>
+                                    <li><a href="/1.8/cookbook/documentcreation.html">Document Creation</a></li>
+                                    <li><a href="/1.8/cookbook/textextraction.html">Text Extraction</a></li>
+                                    <li><a href="/1.8/cookbook/encryption.html">Document Encryption</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithfonts.html">Working with Fonts</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithmetadata.html">Working with Metadata</a></li>
+                                    <li><a href="/1.8/cookbook/workingwithattachments.html">Working with Attachments</a></li>
+                                    <li><a href="/1.8/cookbook/pdfavalidation.html">PDF/A Validation</a></li>
+                                    <li><a href="/1.8/cookbook/pdfacreation.html">Creating a PDF/A document</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/1.8/commandline.html">Command Line Tools</a></li>
+                            <li><a href="/docs/1.8.10/javadocs/">API Docs</a></li>
+                            <li><a href="/1.8/faq.html">FAQ</a></li>
+                        </ul>
+                    </li>
+                    
+                    <li class="sidebar-header">Development</li>
+                    <li><a href="/building.html">Building from Source</a></li>
+                    <li><a href="/codingconventions.html">Coding Conventions</a></li>
+                    <li><a href="/siteupdate.html">Update the Website</a></li>  
+                    <li><a href="https://builds.apache.org/view/All/job/PDFBox-trunk/">Jenkins</a></li>
+                    <li><a href="https://travis-ci.org/apache/pdfbox">Travis CI</a></li>
+                    <li><a href="https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor">SonarQube</a></li>
+                    <li><a href="https://issues.apache.org/jira/browse/PDFBOX">JIRA</a></li>
+                    <li><a href="/ideas.html">Ideas</a></li>
+                    <li><a href="/references.html">External Links</a></li>
+
+                    <li class="sidebar-header">Apache Software Foundation</li>
+                    <li><a href="http://www.apache.org/">Apache Software Foundation</a></li>
+                    <li><a href="http://www.apache.org/foundation/thanks.html">ASF Sponsors</a></li>
+                    <li><a href="http://www.apache.org/security/">Security</a></li>
+                </ul>
+            </div>
+            <div class="col-xs-12 col-sm-9">
+                <h1 id="working-with-attachments">Working with Attachments</h1>
+
+<h2 id="the-pdf-file-specification">The PDF File Specification</h2>
+
+<p>See package:org.apache.pdfbox.pdmodel.common.filespecification<br>
+See example:EmbeddedFiles  </p>
+
+<p>A PDF can contain references to external files via the file system or a URL to a remote 
+location. It is also possible to embed a binary file into a PDF document.</p>
+
+<p>There are two classes that can be used when referencing a file. <code>PDSimpleFileSpecification</code>
+is a simple string reference to a file(e.g. &quot;./movies/BigMovie.avi&quot;). The simple file 
+specification does not allow for any parameters to be set. </p>
+
+<p>The <code>PDComplexFileSpecification</code> is more feature rich and allows for advanced settings on 
+the file reference.</p>
+
+<p>It is also possible to embed a file directly into a PDF. Instead of setting the file 
+attribute of the <code>PDComplexFileSpecification</code>, the <code>EmbeddedFile</code> attribute can be used instead.</p>
+
+<h2 id="adding-a-file-attachment">Adding a File Attachment</h2>
+
+<p>PDF documents can contain file attachments that are accessed from the Document-&gt;File Attachments 
+menu. PDFBox allows attachments to be added to and extracted from PDF documents. 
+Attachments are part of the named tree that is attached to the document catalog.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">PDEmbeddedFilesNameTreeNode</span> <span class="n">efTree</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDEmbeddedFilesNameTreeNode</span><span class="o">();</span>
+
+<span class="c1">//first create the file specification, which holds the embedded file</span>
+<span class="n">PDComplexFileSpecification</span> <span class="n">fs</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDComplexFileSpecification</span><span class="o">();</span>
+<span class="n">fs</span><span class="o">.</span><span class="na">setFile</span><span class="o">(</span> <span class="s">"Test.txt"</span> <span class="o">);</span>
+<span class="n">InputStream</span> <span class="n">is</span> <span class="o">=</span> <span class="o">...;</span>
+<span class="n">PDEmbeddedFile</span> <span class="n">ef</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDEmbeddedFile</span><span class="o">(</span><span class="n">doc</span><span class="o">,</span> <span class="n">is</span> <span class="o">);</span>
+<span class="c1">//set some of the attributes of the embedded file</span>
+<span class="n">ef</span><span class="o">.</span><span class="na">setSubtype</span><span class="o">(</span> <span class="s">"test/plain"</span> <span class="o">);</span>
+<span class="n">ef</span><span class="o">.</span><span class="na">setSize</span><span class="o">(</span> <span class="n">data</span><span class="o">.</span><span class="na">length</span> <span class="o">);</span>
+<span class="n">ef</span><span class="o">.</span><span class="na">setCreationDate</span><span class="o">(</span> <span class="k">new</span> <span class="n">GregorianCalendar</span><span class="o">()</span> <span class="o">);</span>
+<span class="n">fs</span><span class="o">.</span><span class="na">setEmbeddedFile</span><span class="o">(</span> <span class="n">ef</span> <span class="o">);</span>
+
+<span class="c1">//now add the entry to the embedded file tree and set in the document.</span>
+<span class="n">Map</span> <span class="n">efMap</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">();</span>
+<span class="n">efMap</span><span class="o">.</span><span class="na">put</span><span class="o">(</span> <span class="s">"My first attachment"</span><span class="o">,</span> <span class="n">fs</span> <span class="o">);</span>
+<span class="n">efTree</span><span class="o">.</span><span class="na">setNames</span><span class="o">(</span> <span class="n">efMap</span> <span class="o">);</span>
+<span class="c1">//attachments are stored as part of the "names" dictionary in the document catalog</span>
+<span class="n">PDDocumentNameDictionary</span> <span class="n">names</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PDDocumentNameDictionary</span><span class="o">(</span> <span class="n">doc</span><span class="o">.</span><span class="na">getDocumentCatalog</span><span class="o">()</span> <span class="o">);</span>
+<span class="n">names</span><span class="o">.</span><span class="na">setEmbeddedFiles</span><span class="o">(</span> <span class="n">efTree</span> <span class="o">);</span>
+<span class="n">doc</span><span class="o">.</span><span class="na">getDocumentCatalog</span><span class="o">().</span><span class="na">setNames</span><span class="o">(</span> <span class="n">names</span> <span class="o">);</span>
+</code></pre></div>
+            </div>
+        </div>
+    </div>
+
+    <footer class="footer">
+        <div class="container"
+            <div class="row">
+                <div class="span3">
+                    <!-- nothing in here on purpose -->
+                </div>
+                <div class="span9">
+                    <p>Copyright © 2009&ndash;2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+                        <br/>Apache PDFBox, PDFBox, Apache, the Apache feather logo and the Apache PDFBox project logos are trademarks of The Apache Software Foundation.</p>
+                </div>
+            </div>
+        </div>
+    </footer>
+
+        <!-- Twitter Bootstrap and jQuery after this line. -->
+    <script src="//code.jquery.com/jquery-latest.js"></script>
+    <script src="/bootstrap/js/bootstrap.min.js"></script>
+    <script type="text/javascript">
+        
+        $(document).ready(function () {
+                $('[data-toggle="offcanvas"]').click(function () {
+                $('.row-offcanvas').toggleClass('active')
+            });
+        });
+        
+        $(function() {
+            // collapse tree nodes dynamically to support noscript
+            $('.sidebar-node').addClass('collapsed');
+            
+
+            // toggle expand/collapse
+            $('.sidebar-node > a').click(function(e) {
+                $(this).parent().toggleClass('collapsed');
+                e.preventDefault();
+            });
+
+            // preserve expand/collapse across page navigation
+            var path = document.location.pathname;
+            if (path.indexOf('/2.0') == 0) {
+                $('#v2-0').removeClass('collapsed');
+                if (path.indexOf('/2.0/cookbook') == 0) {
+                    $('#v2-0-cookbook').removeClass('collapsed');
+                }
+            } else {
+                $('#v1-8').removeClass('collapsed');
+                if (path.indexOf('/1.8/cookbook') == 0) {
+                    $('#v1-8-cookbook').removeClass('collapsed');
+                }
+            }
+
+        });
+    </script>
+
+</body>
+
+</html>
\ No newline at end of file