001: package com.canoo.webtest.plugins.pdftest.htmlunit;
002:
003: import java.util.List;
004:
005: import com.gargoylesoftware.htmlunit.Page;
006:
007: /**
008: * Represents a PDF document.
009: * @author Etienne Studer
010: * @author Marc Guillemot
011: */
012: public interface PDFPage extends Page {
013: String MODE_NORMAL = "normal";
014: String MODE_LINES = "groupByLines";
015:
016: String getDocumentTitle();
017:
018: int getNumberOfPages();
019:
020: String getText(int startPage, int endPage);
021:
022: public String getText(String fragmentSeparator,
023: String lineSeparator, String pageSeparator, String mode);
024:
025: /**
026: *
027: * @param password the password to use to decrypt
028: * @throws PDFInvalidPasswordException if the password is invalid to decrypt document
029: */
030: void decrypt(String password);
031:
032: boolean isEncrypted();
033:
034: /**
035: * Gets the fields with the given name
036: * @param name the field name
037: * @param type the type of fields to look for
038: * @return a list of {@link PDFField}
039: */
040: List getFields(String name, PDFField.Type type);
041:
042: /**
043: * Gets the fields with the given name
044: * @param name the field name
045: * @return a list of {@link PDFField}
046: */
047: List getFields(String name);
048:
049: /**
050: * Gets the fields with the given name
051: * @param name the field name
052: * @param pageNumber the page number where the field should be located
053: * @param type the type of fields to look for
054: * @return a list of {@link PDFField}
055: * @throws IllegalArgumentException if the pageNumber is not a valid page number
056: */
057: List getFields(String name, int pageNumber, PDFField.Type type);
058:
059: /**
060: * Gets the fields with the given name
061: * @param name the field name
062: * @param pageNumber the page number where the field should be located
063: * @return a list of {@link PDFField}
064: * @throws IllegalArgumentException if the pageNumber is not a valid page number
065: */
066: List getFields(String name, int pageNumber);
067:
068: /**
069: * Gets the fields of the given page
070: * @param pageNumber the page number where the field should be located
071: * @return a list of {@link PDFField}
072: * @throws IllegalArgumentException if the pageNumber is not a valid page number
073: */
074: List getFields(int pageNumber);
075:
076: /**
077: * Gets all the fields
078: * @return a list of {@link PDFField}
079: */
080: List getFields();
081:
082: boolean hasPermission(final PDFEncryptionPermission permission);
083:
084: String getEncryptProperty(String key);
085:
086: public int getEncryptionStrength();
087:
088: public String getInfoProperty(String key);
089:
090: boolean isUserPassword(String password);
091:
092: boolean isOwnerPassword(String password);
093:
094: /**
095: * Gets the hyperlinks contained in the document
096: * @return a list of {@link PDFLink}
097: */
098: List getLinks();
099:
100: /**
101: * Gets the bookmarks contained in the document
102: * @return a list of {@link PDFBookmark}
103: */
104: List getBookmarks();
105:
106: /**
107: * Gets the fonts contained in the document
108: * @return a list of {@link PDFFont}
109: */
110: List getFonts();
111: }
|