at.knowcenter.wag.egov.egiz.pdf
Class TextualSignature

java.lang.Object
  extended byat.knowcenter.wag.egov.egiz.pdf.TextualSignature

public class TextualSignature
extends Object

Contains helper function for textual signatures.

Author:
wprinz

Constructor Summary
TextualSignature()
           
 
Method Summary
static String extractTextTextual(PdfDataSource pdfDataSource, String encoding)
          Extracts the document text from a given pdf.
static byte[] normalizePDF(PdfDataSource pdfDataSource)
          Normalizes a given binary PDF to a version PDFbox can handle correctly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextualSignature

public TextualSignature()
Method Detail

extractTextTextual

public static String extractTextTextual(PdfDataSource pdfDataSource,
                                        String encoding)
                                 throws PDFDocumentException
Extracts the document text from a given pdf.

Returns:
Returns the extracted document text.
Throws:
PDFDocumentException
TextExtractionException - Forwarded exception.

normalizePDF

public static byte[] normalizePDF(PdfDataSource pdfDataSource)
                           throws IOException,
                                  com.lowagie.text.DocumentException,
                                  PDFDocumentException
Normalizes a given binary PDF to a version PDFbox can handle correctly.

PDFbox has serious problems with documents that use incremental updates or XObject forms. Therefor use this to remove incremental updates and create a streamlined document.

Note that this has nothing to do with text normalization. It just unifies the PDF documents that are fed into PDFbox for text extraction and page length determination.

Returns:
Returns the normalized pdf.
Throws:
IOException
com.lowagie.text.DocumentException
PDFDocumentException


Copyright © 2006-2010. All Rights Reserved.