|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.qoppa.pdfText.PDFText
PDFText is the class to extract the list of words contained in a PDF document as a Vector.
It also returns the DocumentInfo for the document as well as the page count.
| Constructor Summary | |
PDFText(InputStream inStream,
IPassword password)
Creates a PDFText object from a PDF InputStream. |
|
PDFText(String fileName,
IPassword password)
Loads a PDFText object from a file. |
|
PDFText(URL url,
IPassword password)
Loads a PDFText object from a URL. |
|
| Method Summary | |
Vector |
findText(int pageIndex,
String searchText,
boolean caseSensitive,
boolean wholeWords)
Searches a page for text and returns a list of TextPosition objects for each of the occurrences of the string in the page. |
DocumentInfo |
getDocumentInfo()
Returns a DocumentInfo object containing the information section of a PDF document (author, title, etc.) |
static DocumentInfo |
getDocumentInfo(InputStream inStream,
IPassword password)
Returns a DocumentInfo object containing the information section of a PDF document (author, title, etc.) |
String |
getFileName()
Returns the name of the pdf document. |
Vector |
getLinesWithPositions(int pageIndex)
Returns position information for all the lines of text in the specified page of the PDF document. |
int |
getPageCount()
Returns the number of pages of the pdf document. |
String |
getText()
Returns the text in the pdf document as a String. |
String |
getText(int pageIndex)
Returns text contained in the specified page of the pdf document as a String. |
static String |
getVersion()
Returns version string for jPDFText. |
Vector |
getWords()
Returns all words in the pdf document as a Vector of Strings. |
Vector |
getWords(int pageIndex)
Returns all words contained in the specified page of the pdf document as a Vector of Strings. |
Vector |
getWordsWithPositions(int pageIndex)
Returns position information for all the words in the specified page of the PDF document. |
static boolean |
setAppletKey(String key,
Applet applet)
Method to unlock the production version of the library. |
static boolean |
setKey(String key)
Method to unlock the production version of the library. |
void |
usePermissionsPassword(String password)
Tells the PDFText object that the permissions password is known, so all permissions are granted. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PDFText(InputStream inStream,
IPassword password)
throws PDFException
inStream - InputStream to read the pdf document from.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
public PDFText(String fileName,
IPassword password)
throws PDFException
fileName - Name of the PDF file.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
public PDFText(URL url,
IPassword password)
throws PDFException
url - URL pointint to the location of the PDF file.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.| Method Detail |
public DocumentInfo getDocumentInfo()
public static DocumentInfo getDocumentInfo(InputStream inStream,
IPassword password)
throws PDFException
inStream - InputStream to read the pdf document from.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
PDFExceptionpublic String getFileName()
public int getPageCount()
public String getText()
throws PDFException
String. Pages are separated with a return char.
PDFException
public String getText(int pageIndex)
throws PDFException
pageIndex - is the 0 based page number. pageIndex = 0 is the first page of the document.
PDFException
public static boolean setAppletKey(String key,
Applet applet)
key - Production key.public static boolean setKey(String key)
key - Production key.public static String getVersion()
public Vector getWords()
throws PDFException
Vector of Strings.
PDFException
public Vector getWords(int pageIndex)
throws PDFException
pageIndex - is the 0 based page number. pageIndex = 0 is the first page of the document.
PDFException
public Vector getLinesWithPositions(int pageIndex)
throws PDFException
pageIndex - is the 0 based page number. pageIndex = 0 is the first page of the document.
PDFException
public Vector getWordsWithPositions(int pageIndex)
throws PDFException
pageIndex - is the 0 based page number. pageIndex = 0 is the first page of the document.
PDFException
public Vector findText(int pageIndex,
String searchText,
boolean caseSensitive,
boolean wholeWords)
throws PDFException
pageIndex - The index of the page to search insearchText - The text to search for.caseSensitive - Flag indicating whether the search should be case sensitive.wholeWords - Flag indicating whether the search should only look at whole words.
PDFException
public void usePermissionsPassword(String password)
throws PDFException
password - The permissions password
PDFException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||