de.oio.jpdfunit.document
Interface Document


public interface Document

The Document interface provides a lot of methods to get basic information about the document.

Author:
bbratkus

Method Summary
 void closeDocument()
          Please close the file after finishing your tests.
 int countPages()
          The method gets the page count of the document.
 String decryptDocument(String passwd)
          The method trys to decrypt the document with a given password and returns the content if it is possible.
 List getAllBookmarks()
          This method returns all the bookmarks of the testing document.
 Font[] getAllFontsInDocument()
          For testing the different fonts of a document you can get the hole fonts as an array.
 Font[] getAllFontsOnPage(int page)
          For testing the different fonts of a document you can get the fonts for a selected page by using this method.
 String getAuthor()
          The method gets the author of the document if it was set in the document information.
 Content getContent()
          The method gets the content of the document if it is not decrypted.
 Calendar getCreationDate()
          The method gets the creation date of the document but be carefull it is a very specific Calendari.e.
 String getCreator()
          The method gets the cretor of the document if it was set in the document information.
 int getEnryptionLength()
          The method gets the encryption length of the document if it is encrypted.
 String getKeywords()
          The method gets the keywords of a document if they are set in the document information.
 String getProducer()
          The method gets the producer of the document if this is set in the document information.
 String getSubject()
          The method gets the subject of the document if it is set in the document information.
 String getTitle()
          The method gets the title of the document if it is set in the document information.
 float getVersion()
          The method gets the version of the document if it is set in the document information.
 boolean isDocumentEncrypted()
          The method checks if the document is encrypted.
 boolean isOwnerPasswd(String passwd)
          The method checks if the supposed owner password is the owner password of the document.
 boolean isUserPasswd(String passwd)
          The method checks if the supposed user password is the user password of the document.
 

Method Detail

closeDocument

void closeDocument()
Please close the file after finishing your tests.


countPages

int countPages()
The method gets the page count of the document.

Returns:
the number of pages it is 1-based.

decryptDocument

String decryptDocument(String passwd)
The method trys to decrypt the document with a given password and returns the content if it is possible.

Parameters:
passwd - The owner or the user password of the pdf file to decrypt the document.
Returns:
The hole content of the document.

getCreator

String getCreator()
The method gets the cretor of the document if it was set in the document information.

Returns:
The creator of the document.

getAuthor

String getAuthor()
The method gets the author of the document if it was set in the document information.

Returns:
The author of the document a document information.

getContent

Content getContent()
The method gets the content of the document if it is not decrypted.

Returns:
The Content of the document a document.

getCreationDate

Calendar getCreationDate()
The method gets the creation date of the document but be carefull it is a very specific Calendari.e. "GregorianCalendar testDate = new GregorianCalendar(2005, Calendar.JUNE, 29, 16, 33, 02);"

Returns:
The creation date of the document a document information.

getEnryptionLength

int getEnryptionLength()
The method gets the encryption length of the document if it is encrypted.

Returns:
If the document is encrypted the method returns the encryption length else 0.

getKeywords

String getKeywords()
The method gets the keywords of a document if they are set in the document information.

Returns:
The keywords of the document which were set in the document information.

getProducer

String getProducer()
The method gets the producer of the document if this is set in the document information.

Returns:
The producer of the document which was set in the document information.

getSubject

String getSubject()
The method gets the subject of the document if it is set in the document information.

Returns:
The subject of the document which can be found in the document information.

getTitle

String getTitle()
The method gets the title of the document if it is set in the document information.

Returns:
The title of the document which is set in the document information.

getVersion

float getVersion()
The method gets the version of the document if it is set in the document information.

Returns:
The version of the document.

isDocumentEncrypted

boolean isDocumentEncrypted()
The method checks if the document is encrypted.

Returns:
Returns true if the document is encrypted.

isOwnerPasswd

boolean isOwnerPasswd(String passwd)
The method checks if the supposed owner password is the owner password of the document.

Parameters:
passwd - The supposed owner password.
Returns:
Returns true if the parameter is the owner password of the document.

isUserPasswd

boolean isUserPasswd(String passwd)
The method checks if the supposed user password is the user password of the document.

Parameters:
passwd - The supposed user password.
Returns:
Returns true if the parameter is the user password of the document.

getAllFontsInDocument

Font[] getAllFontsInDocument()
For testing the different fonts of a document you can get the hole fonts as an array.

Returns:
Returns a font array, which contains all the fonts of the document. This fonts are specified by their type and font name.

getAllFontsOnPage

Font[] getAllFontsOnPage(int page)
For testing the different fonts of a document you can get the fonts for a selected page by using this method. Be carefull it is 1-based.

Parameters:
page - The supposed page to get the fonts from.
Returns:
Returns a font array, which contains all the fonts of the page. This fonts are specified by their type and font name.

getAllBookmarks

List getAllBookmarks()
This method returns all the bookmarks of the testing document.

Returns:
The list containing the bookmarks.


Copyright © 2011. All Rights Reserved.