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 2014/09/18 19:35:16 UTC

svn commit: r1626032 - /pdfbox/cmssite/trunk/content/cookbook/pdfavalidation.mdtext

Author: msahyoun
Date: Thu Sep 18 17:35:15 2014
New Revision: 1626032

URL: http://svn.apache.org/r1626032
Log:
PDFBOX-2340 Fix typo in PDF/A validation doc

Modified:
    pdfbox/cmssite/trunk/content/cookbook/pdfavalidation.mdtext

Modified: pdfbox/cmssite/trunk/content/cookbook/pdfavalidation.mdtext
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/trunk/content/cookbook/pdfavalidation.mdtext?rev=1626032&r1=1626031&r2=1626032&view=diff
==============================================================================
--- pdfbox/cmssite/trunk/content/cookbook/pdfavalidation.mdtext (original)
+++ pdfbox/cmssite/trunk/content/cookbook/pdfavalidation.mdtext Thu Sep 18 17:35:15 2014
@@ -8,45 +8,53 @@ Check Compliance with PDF/A-1b
 This small sample shows how to check the compliance of a file with the PDF/A-1b specification.
 
 	:::java
-	ValidationResult result = null;
+    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();
+    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());
-	  }
+    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());
+        }
 	}
       	
 ### Categories of Validation Error