pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leleu...@apache.org
Subject svn commit: r1389563 - in /pdfbox/site/src/site: site.xml xdoc/index.xml xdoc/userguide/preflight.xml
Date Mon, 24 Sep 2012 20:49:53 GMT
Author: leleueri
Date: Mon Sep 24 20:49:53 2012
New Revision: 1389563

URL: http://svn.apache.org/viewvc?rev=1389563&view=rev
Log:
[https://issues.apache.org/jira/browse/PDFBOX-1409] Addition of the Preflight documentation
page (first part "How to use Preflight" and second part "Error categories") 

Added:
    pdfbox/site/src/site/xdoc/userguide/preflight.xml   (with props)
Modified:
    pdfbox/site/src/site/site.xml
    pdfbox/site/src/site/xdoc/index.xml

Modified: pdfbox/site/src/site/site.xml
URL: http://svn.apache.org/viewvc/pdfbox/site/src/site/site.xml?rev=1389563&r1=1389562&r2=1389563&view=diff
==============================================================================
--- pdfbox/site/src/site/site.xml (original)
+++ pdfbox/site/src/site/site.xml Mon Sep 24 20:49:53 2012
@@ -84,6 +84,7 @@
       <item name="Redistribution" href="userguide/redistribution.html"/>
       <item name=".NET Version" href="userguide/dot_net.html"/>
       <item name="Text Extraction" href="userguide/text_extraction.html"/>
+      <item name="PDF/A Validation" href="userguide/preflight.html"/>
     </menu>
     <menu ref="reports"/>
   </body>

Modified: pdfbox/site/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/pdfbox/site/src/site/xdoc/index.xml?rev=1389563&r1=1389562&r2=1389563&view=diff
==============================================================================
--- pdfbox/site/src/site/xdoc/index.xml (original)
+++ pdfbox/site/src/site/xdoc/index.xml Mon Sep 24 20:49:53 2012
@@ -53,6 +53,7 @@
         <li>Create a PDF from a text file</li>
         <li>Create images from PDF pages</li>
         <li>Print a PDF</li>
+        <li>PDF/A validation</li>
       </ul>
     </section>
   </body>

Added: pdfbox/site/src/site/xdoc/userguide/preflight.xml
URL: http://svn.apache.org/viewvc/pdfbox/site/src/site/xdoc/userguide/preflight.xml?rev=1389563&view=auto
==============================================================================
--- pdfbox/site/src/site/xdoc/userguide/preflight.xml (added)
+++ pdfbox/site/src/site/xdoc/userguide/preflight.xml Mon Sep 24 20:49:53 2012
@@ -0,0 +1,120 @@
+<!--
+ ! 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.
+ !-->
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/XDOC/2.0
+                              http://maven.apache.org/xsd/xdoc-2.0.xsd">
+  <head>
+    <title>PDFBox - Preflight</title>
+  </head>
+  <body>
+    <section name="Document Validation">
+    The Apache Preflight library is a Java tool that implements a parser compliant with the
ISO-19005 specification (aka PDF/A-1).
+    
+		<subsection name="Check Compliance with PDF/A-1b" id="PDFA1b">    
+        <p>This small sample shows how to check the compliance of a file with the PDF/A-1b
specification.</p>
+        <source>
+ValidationResult result = null;
+
+FileDataSource fd = new FileDataSource(args[0]);
+PreflightParser parser = new PreflightParser(fd);
+try {
+
+  /* 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...)
+   */
+  parser.parse();
+
+  /* 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.
+   */
+  PreflightDocument document = parser.getPreflightDocument();
+  document.validate();
+
+  // Get validation result
+  result = document.getResult();
+  document.close();
+  
+} catch (SyntaxValidationException e) {
+  /* 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  
+  result = e.getResult();
+}
+
+// display validation result
+if (result.isValid()) {
+  System.out.println("The file " + args[0] + " is a valid PDF/A-1b file");
+} else {
+  System.out.println("The file" + args[0] + " is not valid, error(s) :");
+  for (ValidationError error : result.getErrorsList()) {
+    System.out.println(error.getErrorCode() + " : " + error.getDetails());
+  }
+}
+      	</source>
+	    </subsection>
+	    <subsection name="Categories of Validation Error" id="errors">    
+        <p>If a validation fails, the ValidationResult object contains all causes of
the failure. <br />
+        In order to help in the failure understanding, all error codes have the following
form X[.Y[.Z]] where :<ul>
+        <li>'X' is the category (ex : Font validation error...)</li>
+        <li>'Y' represent a subsection of the category (ex : "Font with Glyph error")</li>
+        <li>'Z' represent the cause of the error (ex : "Font with a missing Glyph")</li>

+				</ul>
+        Category ('Y') and cause ('Z') 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 PreglihtConstant interface) :</p>
+        
+       	<table>
+					<tr>
+						<th>Category</th>
+						<th>Description</th>
+					</tr>
+					<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>
+				</table>
+	    </subsection>
+    </section>
+  </body>
+</document>

Propchange: pdfbox/site/src/site/xdoc/userguide/preflight.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message