com.canoo.webtest.plugins.pdftest.htmlunit
Interface PDFPage

All Superinterfaces:
com.gargoylesoftware.htmlunit.Page, Serializable
All Known Implementing Classes:
PdfBoxPDFPage

public interface PDFPage
extends com.gargoylesoftware.htmlunit.Page

Represents a PDF document.

Author:
Etienne Studer, Marc Guillemot

Field Summary
static String MODE_LINES
           
static String MODE_NORMAL
           
 
Method Summary
 void decrypt(String password)
           
 List getBookmarks()
          Gets the bookmarks contained in the document
 String getDocumentTitle()
           
 int getEncryptionStrength()
           
 String getEncryptProperty(String key)
           
 List getFields()
          Gets all the fields
 List getFields(int pageNumber)
          Gets the fields of the given page
 List getFields(String name)
          Gets the fields with the given name
 List getFields(String name, int pageNumber)
          Gets the fields with the given name
 List getFields(String name, int pageNumber, PDFField.Type type)
          Gets the fields with the given name
 List getFields(String name, PDFField.Type type)
          Gets the fields with the given name
 List getFonts()
          Gets the fonts contained in the document
 String getInfoProperty(String key)
           
 List<? extends PDFLink> getLinks()
          Gets the hyperlinks contained in the document
 int getNumberOfPages()
           
 String getText(int startPage, int endPage)
           
 String getText(String fragmentSeparator, String lineSeparator, String pageSeparator, String mode)
           
 boolean hasPermission(PDFEncryptionPermission permission)
           
 boolean isEncrypted()
           
 boolean isOwnerPassword(String password)
           
 boolean isUserPassword(String password)
           
 
Methods inherited from interface com.gargoylesoftware.htmlunit.Page
cleanUp, getEnclosingWindow, getUrl, getWebResponse, initialize
 

Field Detail

MODE_NORMAL

static final String MODE_NORMAL
See Also:
Constant Field Values

MODE_LINES

static final String MODE_LINES
See Also:
Constant Field Values
Method Detail

getDocumentTitle

String getDocumentTitle()

getNumberOfPages

int getNumberOfPages()

getText

String getText(int startPage,
               int endPage)

getText

String getText(String fragmentSeparator,
               String lineSeparator,
               String pageSeparator,
               String mode)

decrypt

void decrypt(String password)
Parameters:
password - the password to use to decrypt
Throws:
PDFInvalidPasswordException - if the password is invalid to decrypt document

isEncrypted

boolean isEncrypted()

getFields

List getFields(String name,
               PDFField.Type type)
Gets the fields with the given name

Parameters:
name - the field name
type - the type of fields to look for
Returns:
a list of PDFField

getFields

List getFields(String name)
Gets the fields with the given name

Parameters:
name - the field name
Returns:
a list of PDFField

getFields

List getFields(String name,
               int pageNumber,
               PDFField.Type type)
Gets the fields with the given name

Parameters:
name - the field name
pageNumber - the page number where the field should be located
type - the type of fields to look for
Returns:
a list of PDFField
Throws:
IllegalArgumentException - if the pageNumber is not a valid page number

getFields

List getFields(String name,
               int pageNumber)
Gets the fields with the given name

Parameters:
name - the field name
pageNumber - the page number where the field should be located
Returns:
a list of PDFField
Throws:
IllegalArgumentException - if the pageNumber is not a valid page number

getFields

List getFields(int pageNumber)
Gets the fields of the given page

Parameters:
pageNumber - the page number where the field should be located
Returns:
a list of PDFField
Throws:
IllegalArgumentException - if the pageNumber is not a valid page number

getFields

List getFields()
Gets all the fields

Returns:
a list of PDFField

hasPermission

boolean hasPermission(PDFEncryptionPermission permission)

getEncryptProperty

String getEncryptProperty(String key)

getEncryptionStrength

int getEncryptionStrength()

getInfoProperty

String getInfoProperty(String key)

isUserPassword

boolean isUserPassword(String password)

isOwnerPassword

boolean isOwnerPassword(String password)

getLinks

List<? extends PDFLink> getLinks()
Gets the hyperlinks contained in the document

Returns:
a list of PDFLink

getBookmarks

List getBookmarks()
Gets the bookmarks contained in the document

Returns:
a list of PDFBookmark

getFonts

List getFonts()
Gets the fonts contained in the document

Returns:
a list of PDFFont

Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved.