com.qoppa.pdfEditor
Class PDFEditorBean

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.qoppa.pdfViewer.PDFViewerBean
                      extended by com.qoppa.pdfNotes.PDFNotesBean
                          extended by com.qoppa.pdfEditor.PDFEditorBean
All Implemented Interfaces:
IDocumentListener, IPassword, IPDFSaver, IPDFActionHandler, IPDFOpener, ActionListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class PDFEditorBean
extends PDFNotesBean

PDFEditorBean is a component that can be used to display, annotate and edit PDF documents within a Java application or an applet. The bean can open PDF documents from files, URLs, InputStream and will display the document, allowing the user to navigate and annotate, edit or redact the document.

Documents can be saved to files, output stream and even to a web server, when running in a browser. The component provides extensive functionality "as is" and can be easily extended to provide a full PDF editor to your end users.

Author:
Qoppa Software
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.qoppa.pdfNotes.PDFNotesBean
PDFNotesBean.KeyInfoNotes
 
Nested classes/interfaces inherited from class com.qoppa.pdfViewer.PDFViewerBean
PDFViewerBean.KeyInfoViewer
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class com.qoppa.pdfNotes.PDFNotesBean
UNTITLED
 
Fields inherited from class com.qoppa.pdfViewer.PDFViewerBean
PAGEMODE_CONTINUOUS, PAGEMODE_COVER, PAGEMODE_COVER_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
PDFEditorBean()
          Create a new PDFEditorBean component.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Handle actions registered with this component.
 void applyRedactionAnnotation(Redaction redaction)
          Apply the redaction annotation to the document.
 void applyRedactionAnnotations()
          Apply redaction annotations to the document.
 void commitContentEditingChanges()
          Internal method, do not use.
 void documentChanged(DocumentEvent de)
          Handle content change events.
 BookmarkPanel getBookmarkPanel()
          Returns an interface to allow access to the bookmarks panel.
 PageViewPanelEditor getPageViewPanelEditor()
          Returns an interface to allow access to the page view panel.
static String getVersion()
          Returns version string for jPDFNotes.
 void paste()
          Override parent's paste method to handle pasting of content.
 boolean save()
          This method saves the current document, it is called when the Save button is pressed in the toolbar.
 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.
static boolean setAppletKey(String key, Applet applet)
          Sets the product key when running from an applet.
static boolean setKey(String key)
          Sets product key.
 void stopWidgetEditing()
          Override the method to make sure the content editing tool is also stopped, if active.
 
Methods inherited from class com.qoppa.pdfNotes.PDFNotesBean
activateOCR, addAnnotation, addAnnotation, addPDFListener, addSignatureField, addSignatureField, canPaste, close, enableThumbPaneEditing, exportAnnotsAsFDF, exportAnnotsAsFDF, exportAnnotsAsXFDF, exportAnnotsAsXFDF, getAnnotAlignmentToolBar, getAnnotationManager, getAnnotPropertiesToolBar, getAnnotToolbar, getCommentPanelNotes, getCurrentDocName, getCurrentDocPath, getEditToolbar, getMutableDocument, getNotesContextMenu, getPageRotation, getPageViewPanelNotes, getSelectToolbar, getSelectToolbarNotes, getSignaturePanelNotes, getThumbnailPanelNotes, getUndoManager, getWidgetHandler, handleAction, importAnnotsFromFDF, importAnnotsFromFDF, importAnnotsFromXFDF, importAnnotsFromXFDF, isCreateTempOnSave, isModified, isOpenPDFOnly, keyPressed, loadDocument, loadDocument, loadFDF, loadFile, loadPDF, loadPDF, loadPDF, loadPDF, loadTextDocument, loadXFDF, openFile, print, reloadDocument, removeAnnotation, removePDFListener, revert, save, saveDocument, saveDocument, setCommentComponentsVisible, setCreateTempOnSave, setDocument, setModified, setOpenPDFOnly, setPageRotation, setPDFSaver, signDocument, signDocument, startEdit, startEdit, startMeasurementCalibration
 
Methods inherited from class com.qoppa.pdfViewer.PDFViewerBean
addAnnotationToSelection, addHistoryListener, clearDocument, closeTextSearch, deselectAnnotation, getAcroForm, getAttachmentPanel, getCommentPanel, getCurrentLocation, getDocument, getInitialViewSettings, getLayerPanel, getLocationHistory, getPageByLocation, getPageCount, getPageMode, getPageNumber, getPageView, getPageViewPanel, getPasswordHandler, getPasswords, getRootPane, getRotation, getScale, getScale2D, getScrollPane, getSelectedText, getSelectTextContextMenu, getSignaturePanel, getSplitPolicy, getSubmitActionEmailHandler, getThumbnailPanel, getToolbar, getToolbarButtonGroup, getViewerContextMenu, getWatermark, getZoomMode, gotoNextView, gotoPreviousView, isAttachmentsTabSelected, isBookmarksTabSelected, isCommentComponentsVisible, isCommentsTabSelected, isCommentsVisible, isFieldsHighlight, isIncrementalLoading, isLayersTabSelected, isPagesTabSelected, isSignaturesTabSelected, isSplitOpen, keyReleased, keyTyped, openFile, removeHistoryListener, rotateCCW, rotateCW, scrollToAnnotation, scrollToPage, scrollToPage, selectAnnotation, setCommentsVisible, setFieldsHighlight, setHorzDividerLocation, setIncrementalLoad, setInvertColorsMode, setLocationHistory, setPage, setPageMode, setPasswordHandler, setPDFOpener, setPrintSettings, setRotation, setScale, setScale2D, setSnapshotHandler, setSplitOpen, setSplitPolicy, setSplitVisible, setSplitVisible, setSubmitActionEmailHandler, setTabCommentsVisible, setTextSelectionColors, setVertDividerLocation, setWatermark, setZoomMode, showError, showMessage, showTabAttachments, showTabBookmarks, showTabLayers, showTabSignature, showTabThumbnails, startLoupeTool, startMagnifyRect, startTextSearch, startTextSearch, startTextSelection, stopTextSelection, zoomToRect
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDFEditorBean

public PDFEditorBean()
Create a new PDFEditorBean component.

Method Detail

getVersion

public static String getVersion()
Returns version string for jPDFNotes. If this is the demo version, the return string will contain 'Demo Version' at the end.


setKey

public static boolean setKey(String key)
Sets product key. Use this method after purchasing to remove evaluation restrictions.

Parameters:
key - Product key.

setAppletKey

public static boolean setAppletKey(String key,
                                   Applet applet)
Sets the product key when running from an applet. Use this method after purchasing to remove evaluation restrictions.

Parameters:
key - Product key
applet - The applet that we are running in.

actionPerformed

public void actionPerformed(ActionEvent ae)
Handle actions registered with this component. This fulfills the ActionListener interface to handle actions from buttons related to content editing and redaction.

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class PDFNotesBean
Parameters:
ae - The action event.

getPageViewPanelEditor

public PageViewPanelEditor getPageViewPanelEditor()
Returns an interface to allow access to the page view panel. The interface provides methods to access the PopupMenus which appear on the page.

Returns:
Interface to the page view panel

stopWidgetEditing

public void stopWidgetEditing()
Override the method to make sure the content editing tool is also stopped, if active.

Overrides:
stopWidgetEditing in class PDFNotesBean

paste

public void paste()
Override parent's paste method to handle pasting of content.

Overrides:
paste in class PDFNotesBean

documentChanged

public void documentChanged(DocumentEvent de)
Handle content change events.

Specified by:
documentChanged in interface IDocumentListener
Overrides:
documentChanged in class PDFNotesBean

commitContentEditingChanges

public void commitContentEditingChanges()
Internal method, do not use.


applyRedactionAnnotations

public void applyRedactionAnnotations()
                               throws PDFException
Apply redaction annotations to the document.

Throws:
PDFException

applyRedactionAnnotation

public void applyRedactionAnnotation(Redaction redaction)
                              throws PDFException
Apply the redaction annotation to the document.

Throws:
PDFException

save

public boolean save()
Description copied from class: PDFNotesBean
This method saves the current document, it is called when the Save button is pressed in the toolbar.

Overrides:
save in class PDFNotesBean
Returns:
true if the document was saved properly, false if there were any errors.

saveAs

public boolean saveAs()
Description copied from class: PDFNotesBean
This method implements the standard 'Save As...' function by prompting for a new file name and calling the save method with this file name.

Overrides:
saveAs in class PDFNotesBean
Returns:
true if the document was saved properly, false if there were any errors or if user canceled.
See Also:
PDFNotesBean.save(), PDFNotesBean.save(PDFNotesBean, String, File)

getBookmarkPanel

public BookmarkPanel getBookmarkPanel()
Description copied from class: PDFViewerBean
Returns an interface to allow access to the bookmarks panel. The interface provides methods to access the panel's toolbar as well as the bookmark tree.

Overrides:
getBookmarkPanel in class PDFViewerBean
Returns:
Interface to the bookmark panel