public class PDFEditorBean extends PDFNotesBean
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.
PDFNotesBean.KeyInfoNotes
PDFViewerBean.KeyInfoViewer
JComponent.AccessibleJComponent
Component.BaselineResizeBehavior
Modifier and Type | Field and Description |
---|---|
static int |
MODE_COMPARE_OVERLAY
Overlay comparison mode.
|
static int |
MODE_COMPARE_SIDEBYSIDE
Side by side comparison mode.
|
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
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
PDFEditorBean()
Create a new PDFEditorBean component.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent ae)
Handle actions registered with this component.
|
boolean |
addCompareListener(CompareListener listener)
Adds a CompareListener to be notified when comparison modes are started or stopped.
|
void |
applyRedactionAnnotation(Redaction redaction)
Apply the redaction annotation to the document.
|
void |
applyRedactionAnnotations()
Apply redaction annotations to the document.
|
boolean |
close(boolean checkSave)
This method closes the current document.
|
void |
commitContentEditingChanges()
Internal method, do not use.
|
void |
documentChanged(DocumentEvent de)
Handle content change events.
|
BookmarkPanelEditor |
getBookmarkPanelEditor()
Returns an interface to allow access to the bookmarks panel.
|
PDFDocument |
getCompareDocument()
Gets the PDFDocument that is overlayed or in side by side comparison with the current document.
|
CompareOverlayOptions |
getOverlayOptions()
Get the current overlay options.
|
PageViewPanelEditor |
getPageViewPanelEditor()
Returns an interface to allow access to the page view panel.
|
static String |
getVersion()
Returns version string for jPDFNotes.
|
boolean |
isCompareOverlay()
Returns true if overlay comparison mode is active.
|
boolean |
isCompareSidebySide()
Returns true if side by side comparison is active.
|
void |
paste()
Override parent's paste method to handle pasting of content.
|
boolean |
removeCompareListener(CompareListener listener)
Removes the CompareListener.
|
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.
|
void |
setGridSettings(GridSettings gridSettings)
Sets the grid settings.
|
static boolean |
setKey(String key)
Sets product key.
|
void |
setOutputPreview(ColorSpace outputCS,
boolean simOverprint)
This method will set the output color space that jPDFEditor should render to.
|
void |
setRulerSettings(RulerSettings rulerSettings)
Sets the ruler settings.
|
void |
startCompare(PDFDocument comparePDF,
int mode,
CompareOverlayOptions overlayOptions)
Starts a comparison between the current document and a second document in the specified mode (one of PDFEditorBean.MODE_COMPARE_OVERLAY or PDFEditorBean.MODE_COMPARE_SIDEBYSIDE).
|
void |
stopCompareOverlay()
Stops overlay comparison mode.
|
boolean |
stopCompareSideBySide()
Stops side by side comparison mode.
|
void |
stopWidgetEditing()
Override the method to make sure the content editing tool is also stopped, if active.
|
activateOCR, addAnnotation, addAnnotation, addPDFListener, addSignatureField, addSignatureField, canPaste, getAnnotAlignmentToolBar, getAnnotationManager, getAnnotationManagerNotes, getAnnotPropertiesToolBar, getAnnotToolbar, getCommentPanelNotes, getEditToolbar, getGridSettings, getMutableDocument, getPageViewPanelNotes, getRulerSettings, getSelectToolbar, getSelectToolbarNotes, getSignaturePanelNotes, getTextAnnotPropertiesToolBar, getThumbnailPanelNotes, getUndoManager, getWidgetHandler, handleAction, isModified, isOpenPDFOnly, keyPressed, loadDocument, loadDocument, loadFDF, loadPDF, loadPDF, loadPDF, loadPDF, loadTextDocument, loadXFDF, openFile, print, reloadDocument, removeAnnotation, removePDFListener, revert, save, saveDocument, saveDocument, setCommentComponentsVisible, setDocument, setModified, setOpenPDFOnly, setPDFSaver, signDocument, signDocument, startEdit, startMeasurementCalibration
addAnnotationToSelection, addHistoryListener, clearDocument, closeTextSearch, deselectAnnotation, getAcroForm, getAttachmentPanel, getBookmarkPanel, getCommentPanel, getCurrentLocation, getDocument, getInitialViewSettings, getLayerPanel, getLocationHistory, getPageByLocation, getPageCount, getPageMode, getPageNumber, getPageView, getPageViewPanel, getPasswordHandler, getPasswords, getRootPane, getRotation, getScale2D, getScrollPane, getSelectedText, getSignaturePanel, getSplitPolicy, getSubmitActionEmailHandler, getThumbnailPanel, getToolbar, getToolbarButtonGroup, getWatermark, getZoomMode, gotoNextView, gotoPreviousView, isCommentComponentsVisible, isFieldsHighlight, isIncrementalLoading, isSplitOpen, keyReleased, keyTyped, openFile, removeHistoryListener, rotateCCW, rotateCW, scrollToAnnotation, scrollToPage, scrollToPage, selectAnnotation, setFieldsHighlight, setHorzDividerLocation, setIncrementalLoad, setInvertColorsMode, setLocationHistory, setPage, setPageMode, setPasswordHandler, setPDFOpener, setPrintSettings, setRotation, setScale2D, setScreenResolution, setSnapshotHandler, setSplitOpen, setSplitPolicy, setSplitVisible, setSubmitActionEmailHandler, setTextSelectionColors, setVertDividerLocation, setWatermark, setZoomMode, showError, showMessage, startLoupeTool, startMagnifyRect, startTextSearch, startTextSearch, startTextSelection, stopTextSelection, zoomToRect
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
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, hide, 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
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, transferFocusDownCycle, validate
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, 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, transferFocusBackward, transferFocusUpCycle
public static final int MODE_COMPARE_OVERLAY
public static final int MODE_COMPARE_SIDEBYSIDE
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 void actionPerformed(ActionEvent ae)
actionPerformed
in interface ActionListener
actionPerformed
in class PDFNotesBean
ae
- The action event.public PageViewPanelEditor getPageViewPanelEditor()
public void stopWidgetEditing()
stopWidgetEditing
in class PDFNotesBean
public void paste()
paste
in class PDFNotesBean
public void documentChanged(DocumentEvent de)
documentChanged
in interface IDocumentListener
documentChanged
in class PDFNotesBean
public void commitContentEditingChanges()
public void applyRedactionAnnotations() throws PDFException
PDFException
public void applyRedactionAnnotation(Redaction redaction) throws PDFException
PDFException
public boolean save()
PDFNotesBean
save
in class PDFNotesBean
public boolean saveAs()
PDFNotesBean
saveAs
in class PDFNotesBean
PDFNotesBean.save()
,
PDFNotesBean.save(PDFNotesBean, String, File)
public BookmarkPanelEditor getBookmarkPanelEditor()
public void setOutputPreview(ColorSpace outputCS, boolean simOverprint)
outputCS
- The output color space to render the content to.simOverprint
- Flag indicating whether the renderer should simulate overprinting.public void stopCompareOverlay()
public boolean isCompareOverlay()
public PDFDocument getCompareDocument()
public boolean stopCompareSideBySide()
public boolean isCompareSidebySide()
public boolean close(boolean checkSave)
PDFNotesBean
close
in class PDFNotesBean
checkSave
- Tells the method whether to ask the user to save the
current document if it has been modified.public void startCompare(PDFDocument comparePDF, int mode, CompareOverlayOptions overlayOptions)
comparePDF
- The document to overlay or compare side by side.mode
- The comparison mode. One of PDFEditorBean.MODE_COMPARE_OVERLAY or PDFEditorBean.MODE_COMPARE_SIDEBYSIDE.overlayOptions
- Optionally specify the settings for overlay mode. If left null, default settings will be used.public CompareOverlayOptions getOverlayOptions()
public boolean addCompareListener(CompareListener listener)
listener
- public boolean removeCompareListener(CompareListener listener)
listener
- public void setGridSettings(GridSettings gridSettings)
setGridSettings
in class PDFNotesBean
gridSettings
- The new GridSettings or null to hide the grid.public void setRulerSettings(RulerSettings rulerSettings)
setRulerSettings
in class PDFNotesBean
rulerSettings
- The new settings for the rulers, or null to hide the rulers.