|
|||||||||||
| 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
com.qoppa.pdfNotes.PDFNotesBean
PDFNotesBean is a component that can be used to display and annotate 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 navigate and add annotations to the document.
The bean can save the document to a file but also allows the host application to define a custom 'saver' to be able to save the document somewhere different than a file (database, server, etc). The bean can be extended and the save method overridden to get the same effect.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Field Summary | |
static String |
UNTITLED
Deprecated. |
| Fields inherited from class com.qoppa.pdfViewer.PDFViewerBean |
PAGEMODE_CONTINUOUS, PAGEMODE_FACING, PAGEMODE_FACING_CONTINUOUS, PAGEMODE_SINGLEPAGE, SPLITPOLICY_NEVER_VISIBLE, SPLITPOLICY_USEDOCUMENTPAGEMODE, ZOOMMODE_FITPAGE, ZOOMMODE_FITWIDTH, ZOOMMODE_NORMAL |
| 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 | |
PDFNotesBean()
Construct a PDFNotesBean. |
|
| Method Summary | |
void |
actionPerformed(ActionEvent ae)
This method handles actions from the toolbars in the bean. |
void |
addAnnotation(Annotation newAnnot,
int pageIndex)
Add an annotation to the document programmatically. |
void |
addPDFListener(IPDFListener listener)
Adds a PDF Listener object to receive notifications when a new document is opened. |
void |
addSignatureField()
This method starts the signature field creation process. |
SignatureField |
addSignatureField(String fieldName,
Rectangle2D bounds,
int pageIndex)
Add a signature field to a page in the currently loaded document. |
boolean |
close(boolean checkSave)
This method closes the current document. |
void |
documentChanged(DocumentEvent de)
Internal method, do not use. |
void |
enableThumbPaneEditing(boolean enable)
Turn thumb pane editing on or off. |
void |
exportAnnotsAsFDF(OutputStream outStream,
String pathToPDFFile)
Deprecated. Use getMutableDocument().exportAnnotsAsFDF() instead |
void |
exportAnnotsAsFDF(String fileName)
Deprecated. Use getMutableDocument().exportAnnotsAFDF() instead |
void |
exportAnnotsAsXFDF(OutputStream outStream,
String pathToPDFFile)
Deprecated. Use getMutableDocument().exportAnnotsAsXFDF() instead |
void |
exportAnnotsAsXFDF(String fileName)
Deprecated. Use getMutableDocument().exportAnnotsAsXFDF() instead |
AnnotationManager |
getAnnotationManager()
Returns the object that manages annotation selection for this viewer. |
AnnotToolbar |
getAnnotToolbar()
Returns the annotation tools toolbar. |
CommentPanelNotes |
getCommentPanelNotes()
Returns an interface to allow access to the comment panel. |
String |
getCurrentDocName()
Deprecated. Use getDocument().getPDFSource().getName() |
String |
getCurrentDocPath()
Deprecated. Use getDocument().getPDFSource().getPath() |
EditToolbar |
getEditToolbar()
Returns the standard toolbar. |
MutableDocument |
getMutableDocument()
This method returns a mutable PDF document, that is, a document that can be modified by the calling applications. |
PageViewContextMenuNotes |
getNotesContextMenu()
Deprecated. Use getPageViewPanel.getPageContextMenu() |
int |
getPageRotation(int pageIndex)
Deprecated. This method has moved to the MutableDocument interface. |
PageViewPanelNotes |
getPageViewPanelNotes()
Returns an interface to allow access to the comment panel. |
SignaturePanelNotes |
getSignaturePanelNotes()
Returns an interface to allow access to the signature panel. |
static String |
getVersion()
Returns version string for jPDFNotes. |
void |
handleAction(Action action)
This method overrides the PDFViewerBean handleAction to take care of actions that are specific to jPDFNotes, such as saving the document. |
void |
importAnnotsFromFDF(InputStream inStream)
Deprecated. Use getMutableDocument().importAnnotsFromFDF() instead |
void |
importAnnotsFromFDF(String fileName)
Deprecated. Use getMutableDocument().importAnnotsFromFDF() instead |
void |
importAnnotsFromXFDF(InputStream inStream)
Deprecated. Use getMutableDocument().importAnnotsFromXFDF() instead |
void |
importAnnotsFromXFDF(String fileName)
Deprecated. Use getMutableDocument().importAnnotsFromXFDF() instead |
boolean |
isCreateTempOnSave()
Returns whether or not a temporary file will be created during a save operation. |
boolean |
isModified()
Returns whether this document has been modified or not. |
boolean |
isOpenPDFOnly()
Returns whether the user is allowed to open PDF files only. |
void |
keyPressed(KeyEvent e)
Handle key pressed events. |
void |
loadDocument(InputStream inStream,
String formatName)
Open a document from an input stream. |
void |
loadDocument(String fileName)
Method to open files of PDF, JPEG, TIFF and PNG types. |
void |
loadFDF(String fileName)
Load an FDF file. |
void |
loadFile(String fileName)
Deprecated. Use loadDocument (String fileName) instead |
void |
loadPDF(InputStream inStream)
Load and display a PDF document using an InputStream. |
void |
loadPDF(PDFSource pdfSource)
Load and display a PDF document using a PDFSource object |
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 |
loadTextDocument(String fileName,
TextToPDFSettings settings)
Method to open text files . |
void |
loadXFDF(String fileName)
Load an XFDF file. |
void |
openFile(PDFViewerBean viewerBean)
This method is called whenever the user presses the file open button. |
void |
paste()
this method checks the clipboard and pastes any object that it can handle into the document. |
void |
print(PrintSettings printSettings)
Prints the PDF document to a printer. |
void |
reloadDocument()
Reloads a document into the viewer. |
void |
removeAnnotation(Annotation annot,
int pageIndex)
Remove an annotation from the document programmatically. |
void |
revert()
Reverts the loaded document to the original document. |
boolean |
save()
This method saves the current document by calling the currently registered PDF Saver's save method. |
boolean |
save(PDFNotesBean notesBean,
String docName,
File pdfFile)
This method saves the pdf to a file. |
boolean |
saveAs()
This method implements the standard 'Save As...' function by prompting for a new file name and calling the save method with this file name. |
void |
saveDocument(OutputStream outStream)
Saves this document to an output stream. |
void |
saveDocument(String fileName)
Saves this document to a file. |
static boolean |
setAppletKey(String key,
Applet applet)
Sets the product key when running from an applet. |
void |
setCommentComponentsVisible(boolean visible)
This method will set hiding of comments components on and off. |
void |
setCreateTempOnSave(boolean createTempOnSave)
Sets whether or not a temporary file is to be created during a save operation. |
void |
setDocument(IPDFDocument pdfDoc)
Sets this bean's document. |
static boolean |
setKey(String key)
Sets product key. |
void |
setModified(boolean modified)
Flag this document as modified. |
void |
setOpenPDFOnly(boolean openPDFOnly)
Sets a flag to determine whether the user can open PDF files only, or is allowed to open image files in JPEG, TIFF or PNG formats. |
void |
setPageRotation(int pageIndex,
int degrees)
Deprecated. This method has moved to the MutableDocument interface. |
void |
setPDFSaver(IPDFSaver saver)
This method allows the host application to override the default PDF Saver, the class that saves the document when the save toolbar button is pressed. |
void |
signDocument(SignatureField signField)
Starts the signing GUI for a given signature field. |
void |
signDocument(SignatureField signField,
SigningInformation signingInfo,
File outputFile)
This method will sign and save the document. |
void |
startEdit(Annotation annot,
boolean useDefault)
This method starts an annotation editor appropriate to the type of annotation passed to it. |
void |
startMeasurementCalibration()
This method begins the process of calibrating the scale used with the Distance, Perimeter, and Area measuring tools. |
void |
stopWidgetEditing()
Stops any field editing currently in progress. |
| 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 String UNTITLED
| Constructor Detail |
public PDFNotesBean()
| Method Detail |
public static String getVersion()
public static boolean setKey(String key)
key - Product key.
public static boolean setAppletKey(String key,
Applet applet)
key - Product keyapplet - The applet that we are running in.public EditToolbar getEditToolbar()
public void reloadDocument()
public void removeAnnotation(Annotation annot,
int pageIndex)
throws PDFException
annot - The annotation to be removedpageIndex - The page where the annotation is currently displayed, pageIndex starts at 0.
PDFExceptionpublic AnnotToolbar getAnnotToolbar()
public void enableThumbPaneEditing(boolean enable)
enable - Flag indicating whether to enable the editing.public void actionPerformed(ActionEvent ae)
actionPerformed in interface ActionListeneractionPerformed in class PDFViewerBeanae - The action event.public MutableDocument getMutableDocument()
public void startEdit(Annotation annot,
boolean useDefault)
annot - An annotation object.public void revert()
public boolean close(boolean checkSave)
checkSave - Tells the method whether to ask the user to save the
current document if it has been modified.
public void setDocument(IPDFDocument pdfDoc)
setDocument in class PDFViewerBeanpdfDoc - The new document.public void setCommentComponentsVisible(boolean visible)
PDFViewerBean
setCommentComponentsVisible in class PDFViewerBeanvisible - Comment visibility flag
public boolean save(PDFNotesBean notesBean,
String docName,
File pdfFile)
This method fulfills the IPDFSaver interface and will be called by the Save button on the toolbar unless the saver has been set by the host application.
This method can be overridden by a class that extends PDFNotesBean to customize saving behavior. Alternatively, a host application can call setPDFSaver with an object that implements IPDFSaver to use a custom saver. After setPDFSaver is called, all save functions will use the saver supplied by the host application.
save in interface IPDFSavernotesBean - Reference to the PDFNotesBean that holds the document.docName - The name of the PDF document, normally the file name.pdfFile - A reference to a file object if the PDF was loaded from a file,
null if the PDF was opened from a URL or an InputStream.
save(),
saveAs()
public void saveDocument(String fileName)
throws PDFException,
IOException
fileName - Name of the file to save the document.
PDFException
IOException
public void exportAnnotsAsFDF(OutputStream outStream,
String pathToPDFFile)
throws PDFException,
IOException
outStream - The output stream to write the data to.pathToPDFFile - is the relative path from the fdf file to the pdf file name. This parameter can be left null.
This parameter is used to fill the pdf file name entry in the FDF file, the file entry will be set to pathToPDFFile + fileName
The file entry is used when you open an fdf file to be able to locate the corresponding pdf file.
Example of pathToPDFFile ../qoppa/mydir
PDFException
IOException
public void exportAnnotsAsXFDF(OutputStream outStream,
String pathToPDFFile)
throws PDFException,
IOException
outStream - The output stream to write the data to.pathToPDFFile - is the relative path from the xfdf file to the pdf file name. This parameter can be left null.
This parameter is used to fill the pdf file name entry in the XFDF file, the file entry will be set to pathToPDFFile + fileName
The file entry is used when you open an xfdf file to be able to locate the corresponding pdf file.
Example of pathToPDFFile ../qoppa/mydir
PDFException
IOException
public void exportAnnotsAsFDF(String fileName)
throws PDFException
fileName - The name of the file to export the data to.
PDFException
public void exportAnnotsAsXFDF(String fileName)
throws PDFException
fileName - The name of the file to export the data to.
PDFException
public void importAnnotsFromFDF(InputStream inStream)
throws PDFException
inStream - The input stream in FDF format to read the data from.
PDFException
public void importAnnotsFromFDF(String fileName)
throws PDFException
fileName - The name of the XFDF file to import the data from.
PDFException
public void importAnnotsFromXFDF(InputStream inStream)
throws PDFException
inStream - The input stream in XFDF format to read the data from.
PDFException
public void importAnnotsFromXFDF(String fileName)
throws PDFException
fileName - The name of the FDF file to import the data from.
PDFException
public void saveDocument(OutputStream outStream)
throws IOException,
PDFException
outStream - OutputStream where the document will be written to.
IOException
PDFExceptionpublic boolean saveAs()
save(),
save(PDFNotesBean, String, File)public boolean save()
public void loadPDF(PDFSource pdfSource)
throws PDFException
loadPDF in class PDFViewerBeanpdfSource - Object that implements the PDFSource interface.
PDFException
public void loadPDF(InputStream inStream)
throws PDFException
loadPDF in class PDFViewerBeaninStream - InputStream used to read the PDF document.
PDFException
public void loadFDF(String fileName)
throws PDFException
fileName - Name of the FDF document file.
PDFException
public void loadXFDF(String fileName)
throws PDFException
fileName - Name of the xFDF document file.
PDFException
public void loadPDF(String fileName)
throws PDFException
loadPDF in class PDFViewerBeanfileName - Name of the PDF document file.
PDFException
public void loadPDF(URL url)
throws PDFException
loadPDF in class PDFViewerBeanurl - URL pointing to the location of the PDF document.
PDFException
public void print(PrintSettings printSettings)
throws PDFPermissionException,
PrinterException
PDFViewerBean
print in class PDFViewerBeanprintSettings - 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 setPDFSaver(IPDFSaver saver)
saver - A reference to an object that implements the IPDFSaver interface.public void addPDFListener(IPDFListener listener)
listener - The new listener.public String getCurrentDocName()
public String getCurrentDocPath()
public void setModified(boolean modified)
modified - Flag indicating whether this document has been modified.public boolean isModified()
public void documentChanged(DocumentEvent de)
documentChanged in interface IDocumentListenerdocumentChanged in class PDFViewerBeanpublic void stopWidgetEditing()
public void addAnnotation(Annotation newAnnot,
int pageIndex)
throws PDFException
newAnnot - The new annotation.pageIndex - The page at which to add the annotation, pageIndex starts at 0.
PDFException
public SignatureField addSignatureField(String fieldName,
Rectangle2D bounds,
int pageIndex)
throws PDFException
signDocument.
fieldName - The name of the field.bounds - The bounds on the page for the field. If bounds are set to (0,0,0,0) then the signature is invisible.pageIndex - The page number.
PDFExceptionpublic void addSignatureField()
public void signDocument(SignatureField signField)
throws PDFException
signField - The signature field to apply the signature to.
PDFException
public void signDocument(SignatureField signField,
SigningInformation signingInfo,
File outputFile)
throws PDFException
signField - The signature field to apply the signature to.signingInfo - The signature information.outputFile - The output file to save the document to. If this is null, the document will be saved to
the current file.
PDFExceptionpublic void handleAction(Action action)
handleAction in interface IPDFActionHandlerhandleAction in class PDFViewerBeanaction - Object describing the action.
public void setPageRotation(int pageIndex,
int degrees)
pageIndex - The page index, 0 based.degrees - The new page rotation, in degreespublic int getPageRotation(int pageIndex)
pageIndex - The page index, 0 based.
public void openFile(PDFViewerBean viewerBean)
throws PDFException
openFile in interface IPDFOpeneropenFile in class PDFViewerBeanviewerBean - The PDFViewerBean object that initiated the open file action.
PDFException
public void loadDocument(InputStream inStream,
String formatName)
throws PDFException,
IOException
inStream - The input stream to read the document from.formatName - The name of the format of the input content data. Valid format names are pdf, tiff,
tif, png, jpg, jpeg and jpe and are case insensitive.
PDFException
IOException
public void loadFile(String fileName)
throws PDFException,
IOException
fileName - The name of the file to open.
PDFException
IOException
public void loadDocument(String fileName)
throws PDFException,
IOException
fileName - The name of the file to open.
PDFException
IOException
public void loadTextDocument(String fileName,
TextToPDFSettings settings)
throws PDFException,
IOException
fileName - The name of the file to open.settings - The settings to use when converting the text file to PDF.
PDFException
IOExceptionpublic boolean isOpenPDFOnly()
public void setOpenPDFOnly(boolean openPDFOnly)
openPDFOnly - The new value of the flag.public PageViewContextMenuNotes getNotesContextMenu()
public void keyPressed(KeyEvent e)
PDFViewerBean
keyPressed in interface KeyListenerkeyPressed in class PDFViewerBeanpublic void paste()
public void startMeasurementCalibration()
This method does nothing if a document is open since this feature requires a document.
public AnnotationManager getAnnotationManager()
PDFViewerBean
getAnnotationManager in class PDFViewerBeanpublic boolean isCreateTempOnSave()
public void setCreateTempOnSave(boolean createTempOnSave)
createTempOnSave - public PageViewPanelNotes getPageViewPanelNotes()
getCommentPanel(), but this
method specifies that the return implements CommentPanelNotes
public CommentPanelNotes getCommentPanelNotes()
getCommentPanel(), but this
method specifies that the return implements CommentPanelNotes
public SignaturePanelNotes getSignaturePanelNotes()
getSignaturePanel(), but this
method specifies that the return implements SignaturePanelNotes
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||