|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.qoppa.pdfViewer.PDFViewerBean
PDFViewer bean is a component that can be used to display PDF documents within an application or an applet. The bean takes a PDF document as a file name, a URL or an InputStream, reads the document and then displays the document, allowing the user to navigage through the document.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Field Summary | |
static int |
SPLITPOLICY_NEVER_VISIBLE
|
static int |
SPLITPOLICY_USEDOCUMENTPAGEMODE
|
static int |
ZOOMMODE_FITPAGE
FitPage zoom mode changes the scale when the window is resized so that the page is displayed using the maximum available space. |
static int |
ZOOMMODE_FITWIDTH
FitWidth zoom mode changes the scale when the window is resized so that the full width of the page is displayed using the maximum available space. |
static int |
ZOOMMODE_NORMAL
Normal zoom mode means that the scale remains the same when the window is resized. |
| Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
PDFViewerBean()
Construct the PDFViewerBean. |
|
| Method Summary | |
void |
actionPerformed(ActionEvent e)
Handles toolbar actions. |
void |
clearDocument()
Clears any loaded document. |
void |
documentChanged(DocumentEvent de)
Internal method, do not use. |
AcroForm |
getAcroForm()
Returns the AcroForm in this document. |
JTree |
getBookmarkTree()
Returns a reference to the bookmark tree component. |
IPDFDocument |
getDocument()
Returns the PDF document currently displayed. |
int |
getPageByLocation(int x,
int y)
Returns the index of a page given an x, y location on the document. |
int |
getPageCount()
Returns the number of pages in the current document. |
int |
getPageNumber()
Returns the currently displayed page. |
JComponent |
getPageView(int pageNumber)
Returns the page view component for the given page number. |
IPassword |
getPasswordHandler()
Returns the currently registered password handler. |
String[] |
getPasswords()
Standard implementation of the password handler. |
JRootPane |
getRootPane()
Returns a reference to the PDFViewerBean root pane. |
int |
getRotation()
Returns the current rotation. |
int |
getScale()
Returns the current scale used to display the PDF document. |
JScrollPane |
getScrollPane()
Returns a reference to the PDFViewerBean scroll pane. |
JPopupMenu |
getSelectContextMenu()
This returns the context menu displayed when text is selected on a page. |
TextSelection |
getSelectedText()
Gets the current text selection (if any page has selected text) in the document. |
SelectToolbar |
getSelectToolbar()
Returns the selection toolbar. |
JSplitPane |
getSplitPane()
Returns a reference to the split pane used to show bookmarks and layers. |
int |
getSplitPolicy()
Gets the viewer's split window policy. |
JTabbedPane |
getSplitTabs()
Returns a reference to the tabbed pane inside the split pane. |
PDFToolbar |
getToolbar()
Returns the navigation toolbar. |
static String |
getVersion()
Returns version string for jPDFViewer. |
int |
getZoomMode()
Get the current zoom mode. |
void |
handleAction(Action action)
This method will handle PDF actions initiated by a click on a link. |
boolean |
isSplitOpen()
Returns whether the split window is open or not. |
boolean |
isSplitVisible()
Returns the state of the split window. |
void |
loadPDF(InputStream inStream)
Load and display a PDF document using an InputStream. |
void |
loadPDF(String fileName)
Load and display a PDF document using a file name. |
void |
loadPDF(URL url)
Load and display a PDF document using a URL. |
void |
print(PrintSettings printSettings)
Prints the PDF document to a printer. |
void |
rotateCCW()
Rotates pages 90 degrees counter-clockwise. |
void |
rotateCW()
Rotates pages 90 degrees clockwise. |
void |
scrollToPage(int pageNumber,
int x,
int y)
Scroll to the given page and make sure that point (x,y) is visible on the page by scrolling to it if needed. |
static boolean |
setAppletKey(String key,
Applet applet)
Sets product key when running jPDFViewer in an applet. |
void |
setDocument(IPDFDocument pdfDoc)
Sets this bean's document. |
void |
setInvertMode(boolean invertMode)
Sets the page to paint in inverted mode: Black will show as white and white as black. |
static boolean |
setKey(String key)
Sets product key. |
void |
setPage(int pageNumber)
Changes the currently displayed page. |
void |
setPasswordHandler(IPassword pwdHandler)
Override the standard password handler with a user password handler. |
void |
setPrintSettings(PrintSettings printSettings)
Sets the print settings to be used when the print button is activated from the toolbar. |
void |
setRotation(int rotation)
Sets the current rotation. |
void |
setScale(int scale)
Changes the display scale for the PDF document. |
void |
setSplitOpen(boolean splitOpen)
Opens or closes the split window. |
void |
setSplitPolicy(int splitPolicy)
Sets the viewer's split window policy. |
void |
setSplitVisible(boolean visible,
boolean open)
Method to show / hide the split pane functionality. |
void |
setZoomMode(int zoomMode)
Sets the current zoom mode. |
void |
startMagnifyRect()
This method activates the magnification rectangle tool. |
void |
startTextSelection()
This methods activates the text selection tool. |
void |
stopTextSelection()
This method stops the text selection tool and activates the "hand" tool. |
void |
zoomToRect(Rectangle2D zoomRect)
|
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int SPLITPOLICY_USEDOCUMENTPAGEMODE
public static final int SPLITPOLICY_NEVER_VISIBLE
public static final int ZOOMMODE_NORMAL
public static final int ZOOMMODE_FITPAGE
public static final int ZOOMMODE_FITWIDTH
| Constructor Detail |
public PDFViewerBean()
| Method Detail |
public void setDocument(IPDFDocument pdfDoc)
pdfDoc - The new document.public void handleAction(Action action)
handleAction in interface IPDFActionHandleraction - Object describing the action.public AcroForm getAcroForm()
public IPDFDocument getDocument()
public void loadPDF(URL url)
throws PDFException
url - URL pointing to the location of the PDF document.
PDFExceptionpublic void clearDocument()
public void loadPDF(InputStream inStream)
throws PDFException
inStream - InputStream used to read the PDF document.
PDFException
public void loadPDF(String fileName)
throws PDFException
fileName - Name of the PDF document file.
PDFExceptionpublic void setScale(int scale)
scale - Magnification factor as a percentage. 100 is true size.public int getScale()
public PDFToolbar getToolbar()
public SelectToolbar getSelectToolbar()
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - The action event.public int getRotation()
public void setRotation(int rotation)
rotation - Rotation angle in degrees.public void rotateCW()
public void rotateCCW()
public int getPageNumber()
public JComponent getPageView(int pageNumber)
pageNumber - Number of the page to return. Pages are indexed starting at 1.
public int getPageCount()
public String[] getPasswords()
setPasswordHandler
getPasswords in interface IPassword
public void print(PrintSettings printSettings)
throws PDFPermissionException,
PrinterException
printSettings - Print job settings. Use this object to tell
jPDFViewer how to print the document. If null, the library will
print using default settings.
PDFPermissionException
PrinterExceptionpublic void setPrintSettings(PrintSettings printSettings)
printSettings - Print job settings. Use this object to tell
jPDFViewer how to print the document.public void setPage(int pageNumber)
pageNumber - Page to display. Pages are indexed starting at 1.public static String getVersion()
public void setPasswordHandler(IPassword pwdHandler)
pwdHandler - User object that implements IPasswordHandler.public IPassword getPasswordHandler()
public static boolean setKey(String key)
key - Product key.
public static boolean setAppletKey(String key,
Applet applet)
key - Product key.
public void setSplitVisible(boolean visible,
boolean open)
visible - The new split pane visibility.open - Determines whether the split pane should be open or closedpublic boolean isSplitVisible()
public boolean isSplitOpen()
public void setSplitOpen(boolean splitOpen)
splitOpen - Desired open state of the split window.
public void scrollToPage(int pageNumber,
int x,
int y)
pageNumber - the page number starting at 1.x - the horizontal position to scroll to on the pagey - the vertical position to scroll to on the pagepublic void documentChanged(DocumentEvent de)
documentChanged in interface IDocumentListenerpublic JScrollPane getScrollPane()
public JRootPane getRootPane()
public JTree getBookmarkTree()
public JTabbedPane getSplitTabs()
public JSplitPane getSplitPane()
public int getSplitPolicy()
public void setSplitPolicy(int splitPolicy)
splitPolicy - The new split window policy.
public int getPageByLocation(int x,
int y)
x - The x coordinate of the point.y - The y coordinate of the point.
public void setInvertMode(boolean invertMode)
invertMode - The new invert mode.public int getZoomMode()
public void setZoomMode(int zoomMode)
zoomMode - The new zoom mode. This value has to be either ZOOMMODE_NORMAL or ZOOMMODE_FITPAGE.
If zoomMode is ZOOMMODE_FITPAGE, the method will call setScale immediately to adjust the scale so that
the page fits in the display window optimally.public void zoomToRect(Rectangle2D zoomRect)
public TextSelection getSelectedText()
public void startMagnifyRect()
public void startTextSelection()
public void stopTextSelection()
public JPopupMenu getSelectContextMenu()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||