Java Doc for PDFParser.java in  » Web-Crawler » heritrix » org » archive » crawler » extractor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Crawler » heritrix » org.archive.crawler.extractor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.archive.crawler.extractor.PDFParser

PDFParser
public class PDFParser (Code)
Supports PDF parsing operations. For now this primarily means extracting URIs, but the logic in extractURIs() could easily be adopted/extended for a variety of PDF processing tasks.
author:
   Parker Thompson


Field Summary
 PdfDictionarycatalog
    
 byte[]document
    
 PdfReaderdocumentReader
    
 ArrayList<ArrayList<Integer>>encounteredReferences
    
 ArrayList<String>foundURIs
    

Constructor Summary
public  PDFParser(String doc)
    
public  PDFParser(byte[] doc)
    

Method Summary
public  ArrayListextractURIs()
     Extract URIs from all objects found in a Pdf document's catalog.
protected  voidextractURIs(PdfObject entity)
    
protected  voidgetInFromFile(String doc)
     Read a file named 'doc' and store its' bytes for later processing.
public  ArrayListgetURIs()
     Get a list of URIs retrieved from the Pdf during the extractURIs operation.
protected  booleanhaveSeen(int generation, int id)
     Indicates, based on a PDFObject's generation/id pair whether the parser has already encountered this object (or a reference to it) so we don't infinitely loop on circuits within the PDF.
protected  voidinitialize()
     Initialize opens the document for reading.
public static  voidmain(String[] argv)
    
protected  voidmarkAsSeen(int generation, int id)
     Note that an object (id/generation pair) has been seen by this parser so that it can be handled differently when it is encountered again.
protected  voidresetState()
     Reinitialize the object as though a new one were created.
public  voidresetState(byte[] doc)
     Reset the object and initialize it with a new byte array (the document).
public  voidresetState(String doc)
    

Field Detail
catalog
PdfDictionary catalog(Code)



document
byte[] document(Code)



documentReader
PdfReader documentReader(Code)



encounteredReferences
ArrayList<ArrayList<Integer>> encounteredReferences(Code)



foundURIs
ArrayList<String> foundURIs(Code)




Constructor Detail
PDFParser
public PDFParser(String doc) throws IOException(Code)



PDFParser
public PDFParser(byte[] doc) throws IOException(Code)




Method Detail
extractURIs
public ArrayList extractURIs()(Code)
Extract URIs from all objects found in a Pdf document's catalog. Returns an array list representing all URIs found in the document catalog tree. URIs from all objects found in a Pdf document's catalog.



extractURIs
protected void extractURIs(PdfObject entity)(Code)
Parse a PdfDictionary, looking for URIs recursively and adding them to foundURIs
Parameters:
  entity -



getInFromFile
protected void getInFromFile(String doc) throws IOException(Code)
Read a file named 'doc' and store its' bytes for later processing.
Parameters:
  doc -
throws:
  IOException -



getURIs
public ArrayList getURIs()(Code)
Get a list of URIs retrieved from the Pdf during the extractURIs operation. A list of URIs retrieved from the Pdf during theextractURIs operation.



haveSeen
protected boolean haveSeen(int generation, int id)(Code)
Indicates, based on a PDFObject's generation/id pair whether the parser has already encountered this object (or a reference to it) so we don't infinitely loop on circuits within the PDF.
Parameters:
  generation -
Parameters:
  id - True if already seen.



initialize
protected void initialize() throws IOException(Code)
Initialize opens the document for reading. This is done implicitly by the constuctor. This should only need to be called directly following a reset.
throws:
  IOException -



main
public static void main(String[] argv)(Code)



markAsSeen
protected void markAsSeen(int generation, int id)(Code)
Note that an object (id/generation pair) has been seen by this parser so that it can be handled differently when it is encountered again.
Parameters:
  generation -
Parameters:
  id -



resetState
protected void resetState()(Code)
Reinitialize the object as though a new one were created.



resetState
public void resetState(byte[] doc) throws IOException(Code)
Reset the object and initialize it with a new byte array (the document).
Parameters:
  doc -
throws:
  IOException -



resetState
public void resetState(String doc) throws IOException(Code)
Reinitialize the object as though a new one were created, complete with a valid pointer to a document that can be read
Parameters:
  doc -
throws:
  IOException -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.