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.
Modifier and Type | Class and Description |
---|---|
static class |
PDFEditorBean.KeyInfoEditor
This is the Main-Class for the jPDFEditor.jar that can generate server key
requests, validate a key, and display server information.
|
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, SPLITPOLICY_VISIBLE, 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.
|
boolean |
addOutputPreviewListener(OutputPreviewListener listener)
Adds an OutputPreviewListener to be notified when output preview mode is 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 |
commitEdits()
This method will commit any edits that are currently in progress.
|
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.
|
PDFDocument |
getDocument()
Returns the PDF document currently displayed.
|
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.
|
static void |
loadLicense(InputStream licenseStream)
Method to load a license file from an inputstream.
|
static void |
loadLicense(String licenseFile)
Method to load a license file.
|
void |
paste()
Override parent's paste method to handle pasting of content.
|
boolean |
removeCompareListener(CompareListener listener)
Removes the CompareListener.
|
boolean |
removeOutputPreviewListener(OutputPreviewListener listener)
Removes the OutputPreviewListener.
|
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.
|
boolean |
setOutputPreview(ColorSpace outputCS,
boolean simOverprint,
Color background)
This method will set the output color space that jPDFEditor should render to.
|
void |
setRulerSettings(RulerSettings rulerSettings)
Sets the ruler settings.
|
static boolean |
setWebstartKey(String key)
Sets the product key when running from Web Start.
|
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 |
startOutputPreview(List<NamedColorSpace> namedColorSpaces,
OutputPreviewOptions options)
Starts Output Preview mode which allows the simulation of overprint, color spaces, and background colors.
|
void |
stopCompareOverlay()
Stops overlay comparison mode.
|
boolean |
stopCompareSideBySide()
Stops side by side comparison mode.
|
void |
stopOutputPreview()
Stops Output Preview mode which allows the simulation of overprint, color spaces, and background colors.
|
activateOCR, addAnnotation, addAnnotation, addNotify, addPDFListener, addSignatureField, addSignatureField, canPaste, enableSpellChecking, getAnnotAlignmentToolBar, getAnnotationManager, getAnnotPropertiesToolBar, getAnnotToolbar, getAttachmentPanel, getCommentPanel, getEditToolbar, getGridSettings, getMutableDocument, getPageViewPanel, getRulerSettings, getSelectToolbar, getSignaturePanel, getTextAnnotPropertiesToolBar, getThumbnailPanel, getUndoManager, handleAction, isModified, isOpenPDFOnly, keyPressed, loadDocument, loadDocument, loadFDF, loadPDF, loadPDF, loadPDF, loadPDF, loadTextDocument, loadXFDF, openFile, print, reloadDocument, removeAnnotation, removeNotify, removePDFListener, revert, save, saveDocument, saveDocument, setCommentComponentsVisible, setDocument, setModified, setOpenPDFOnly, setPageMode, setPDFSaver, showSignWarning, signDocument, signDocument, signDocument, startEdit, startMeasurementCalibration
addAnnotationToSelection, addHistoryListener, clearDocument, closeAdvancedSearch, closeSearch, deselectAnnotation, getAcroForm, getBookmarkPanel, getContentTreePanel, getCurrentLocation, getDestinationPanel, getEmailHandler, getInitialViewSettings, getLayerPanel, getLocationHistory, getPageByLocation, getPageCount, getPageMode, getPageNumber, getPageView, getPasswordHandler, getPasswords, getRightSplitPolicy, getRootPane, getRotation, getScale2D, getScrollPane, getSecurityPanel, getSelectedText, getSplitPolicy, getSubmitActionEmailHandler, getTagPanel, getToolbar, getToolbarButtonGroup, getWatermark, getWindowHandler, getZoomMode, gotoNextView, gotoPreviousView, isCommentComponentsVisible, isCreateLinksFromURLs, isFieldsHighlight, isIncrementalLoading, isRightSplitOpen, isSplitOpen, isTouchEnabled, keyReleased, keyTyped, openFile, releaseTileImages, removeHistoryListener, rotateCCW, rotateCW, scrollToAnnotation, scrollToPage, scrollToPage, selectAnnotation, setCreateLinksFromURLs, setEmailHandler, setFieldsHighlight, setHorzDividerLocation, setIncrementalLoad, setInvertColorsMode, setLeftDividerLocation, setLocationHistory, setPage, setPasswordHandler, setPDFOpener, setPrintSettings, setRightDividerLocation, setRightSplitOpen, setRightSplitPolicy, setRightSplitVisible, setRotation, setScale2D, setScreenResolution, setSnapshotHandler, setSplitOpen, setSplitPolicy, setSplitVisible, setSubmitActionEmailHandler, setTextSelectionColors, setTouchEnabled, setVertDividerLocation, setWatermark, setWindowHandler, setZoomMode, showError, showMessage, startAdvancedSearch, startAdvancedSearch, startLoupeTool, startMagnifyRect, startSearch, startTextSelection, stopTextSelection, zoomToRect
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
addAncestorListener, 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, 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 void loadLicense(InputStream licenseStream) throws LicenseException
licenseStream
- The input stream for the license file contents.LicenseException
- If there are any problems with the license filepublic static void loadLicense(String licenseFile) throws LicenseException, IOException
licenseFile
- The full path to the license file.LicenseException
- If there are any problems with the license fileIOException
public static boolean setAppletKey(String key, Applet applet)
key
- Product keyapplet
- The applet that we are running in.public static boolean setWebstartKey(String key)
key
- Product keypublic PDFDocument getDocument()
getDocument
in class PDFViewerBean
public void actionPerformed(ActionEvent ae)
actionPerformed
in interface ActionListener
actionPerformed
in class PDFNotesBean
ae
- The action event.public PageViewPanelEditor getPageViewPanelEditor()
public void paste()
paste
in class PDFNotesBean
public void documentChanged(DocumentEvent de)
documentChanged
in interface IDocumentListener
documentChanged
in class PDFNotesBean
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 boolean setOutputPreview(ColorSpace outputCS, boolean simOverprint, Color background)
outputCS
- The output color space to render the content to.simOverprint
- Flag indicating whether the renderer should simulate overprinting.public void startOutputPreview(List<NamedColorSpace> namedColorSpaces, OutputPreviewOptions options)
namedColorSpaces
- A List of NamedColorSpace
objects.options
- The initial Output Preview settings.public void stopOutputPreview()
public void commitEdits()
commitEdits
in class PDFNotesBean
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
- The CompareListener.public boolean removeCompareListener(CompareListener listener)
listener
- The CompareListener.public boolean addOutputPreviewListener(OutputPreviewListener listener)
listener
- The OutputPreviewListener.public boolean removeOutputPreviewListener(OutputPreviewListener listener)
listener
- The OutputPreviewListener.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.