Package org.jpedal.examples.viewer
Enum Class ViewerCommands
- All Implemented Interfaces:
Serializable,Comparable<ViewerCommands>,Constable
An enum containing all the possible commands you can use with viewer.executeCommand()
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionShow the About dialog with the version details.Show a dialog to choose pages and an image, then let the user drag the area to place it in, then save the document (asking whether to overwrite the open file) and reopen it.Show a dialog to insert blank pages of a chosen size, then save the document (asking whether to overwrite the open file) and reopen it.Toggle auto scrolling, which scrolls the view when the mouse is dragged past its edge.Go back to the previous view in the history added byADDVIEW.Go back 1 page.Show a dialog to export a range of pages as images.Go to the page of a bookmark.Open the JPedal pricing page in the default browser.Set whether shapes and line art are recoloured along with the text when a text colour is set, then repaint.Identifies the Content menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Show the pages in a continuous vertical column and set the mouse to pan.Show the pages in a continuous column of facing pairs, fit to the page, and set the mouse to pan.Copy the highlighted text to the clipboard.Show a dialog to copy a page to another position, then save the document (asking whether to overwrite the open file) and reopen it.Show a dialog to crop pages, then save the document (asking whether to overwrite the open file) and reopen it.Identifies the whole Swing menu bar, for showing, hiding, enabling or disabling it.Clear all highlighted text and images.Show the document properties dialog.Downsample all images using the default settings, then save the document (asking whether to overwrite the open file) and reopen it.Identifies the Edit menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Show a dialog to embed a file in the document as an attachment, then save the document (asking whether to overwrite the open file) and reopen it.Close the document and the Viewer, saving the Viewer settings and warning about unsaved forms first.Identifies the Export menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Show a preview of the selected area as an image, which can be copied or saved.Show a dialog to extract the highlighted text.Show the pages as facing pairs, fit to the page, and set the mouse to pan.Go back 10 pages, stopping at the first page.Go forward 10 pages, stopping at the last page.Identifies the File menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Search the document.Go to the first page.Flatten all layers, removing hidden layers and making visible layers permanent, then save the document (asking whether to overwrite the open file) and reopen it.Go forward to the next view in the history added byADDVIEW.Go forward 1 page.Toggle full screen mode, if supported.Go to a page.Identifies the Go To menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Open the JPedal documentation in the default browser.Not used by the Viewer.Remove the version number from the window title.Clear the current text highlights, then highlight areas on a page.Show a dialog to extract the images embedded in a range of pages.Show a dialog to choose pages to keep, removing all the others, then save the document (asking whether to overwrite the open file) and reopen it.Go to the last page.Toggle the mouse between selecting text and panning the page.Show a dialog to move a page to another position, then save the document (asking whether to overwrite the open file) and reopen it.Open the next document in the recent documents list.Show the next search result, wrapping round to the first result.Show a dialog to combine several pages onto each page in a grid of rows and columns, then save the document (asking whether to overwrite the open file) and reopen it.No longer handled: does nothing.Open a file.Open the current file in the operating system's default application.Identifies the Open menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Open a PDF from a URL.Optimise image colour palettes to fit an indexed colour space, losslessly reducing image size, then save the document (asking whether to overwrite the open file) and reopen it.Show the pages in the page flow view, which needs JavaFX.Return the text grouping object for a page, decoding the page in the background if it is not the page being displayed.Identifies the Page Layout menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Set the mouse to pan the page.Not used by the Viewer.Show a PDF portfolio's files as a detailed list.Show a PDF portfolio's files as tiles.Identifies the Portfolio menu, which is only shown for PDF portfolios, in the Swing menu bar, for showing, hiding, enabling or disabling it.Show the preferences dialog.Open the previous document in the recent documents list.Show the previous search result, wrapping round to the last result.Show the print dialog for the open document.Show a dialog to choose pages, then let the user drag the area of text to redact, then save the document (asking whether to overwrite the open file) and reopen it.Show a dialog to choose pages to remove annotations from, then save the document (asking whether to overwrite the open file) and reopen it.Remove blank pages, then save the document (asking whether to overwrite the open file) and reopen it.Remove all bookmarks, then save the document (asking whether to overwrite the open file) and reopen it.Remove all digital signatures, then save the document (asking whether to overwrite the open file) and reopen it.Remove all embedded files, then save the document (asking whether to overwrite the open file) and reopen it.Remove the initial view settings, then save the document (asking whether to overwrite the open file) and reopen it.Remove all JavaScript, then save the document (asking whether to overwrite the open file) and reopen it.Remove all links, then save the document (asking whether to overwrite the open file) and reopen it.Remove the document metadata, then save the document (asking whether to overwrite the open file) and reopen it.Show a dialog to remove pages, then save the document (asking whether to overwrite the open file) and reopen it.Set the colour all text is drawn in, without repainting.Reverse the page order, then save the document (asking whether to overwrite the open file) and reopen it.Rotate the display 90 degrees anticlockwise.Show a dialog to rotate pages, then save the document (asking whether to overwrite the open file) and reopen it.Rotate the display 90 degrees clockwise.Rotate the display.Show a dialog to save the open file.Show a dialog to save the document after annotations have been added.Show a dialog to scale pages, then save the document (asking whether to overwrite the open file) and reopen it.Set the scaling.Scroll an area of a page into view.Highlight all the text on the current page.Toggle whether the first page is shown on its own in facing views, and save the setting.Set the background colour of the display area around the pages.Show a dialog to edit the document information, which is written to both the Info dictionary and the XMP metadata, then save the document (asking whether to overwrite the open file) and reopen it.Set whether lines thinner than 1 pixel are widened so they stay visible, then repaint.Set whether all shapes are drawn with a 1 pixel stroke after scaling, then repaint.Set whether interactive form fields are highlighted, then repaint.Show a dialog to set the page, page layout and page mode the document opens with, then save the document (asking whether to overwrite the open file) and reopen it.Set the page background colour and repaint.Set the threshold that decides which text is recoloured when a text colour is set.Set the colour all text is drawn in and repaint.Set the colour shown for pages that have not been drawn yet.Show the version number in the window title.Show the dialog to digitally sign the open file.Show one page at a time and set the mouse to select text.Let the user drag an area of the page to extract as an image.Show a dialog to extract the text from a range of pages.Set the mouse to select text.Show the Tip of the Day dialog.Identifies the Tools menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Show or hide part of the Viewer's GUI.Identifies the View menu in the Swing menu bar, for showing, hiding, enabling or disabling it.Open the IDRsolutions website in the default browser.Not used by the Viewer.No longer handled: does nothing.No longer handled: does nothing.Zoom in to the next preset scaling, up to 1000%.Zoom out to the next preset scaling, down to 25%. -
Method Summary
Modifier and TypeMethodDescriptionstatic ViewerCommandscreateFromID(int id) Returns the command with the given ID, which is the value of the matching constant inCommands.static ViewerCommandsReturns the enum constant of this class with the specified name.static ViewerCommands[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
ABOUT
Show the About dialog with the version details. Does nothing if arguments are passed. -
BITMAP
Show a dialog to export a range of pages as images. Does nothing if arguments are passed. -
IMAGES
Show a dialog to extract the images embedded in a range of pages. Does nothing if arguments are passed. -
TEXT
Show a dialog to extract the text from a range of pages. Does nothing if arguments are passed. -
SAVE
Show a dialog to save the open file. Does nothing if arguments are passed. -
PRINT
Show the print dialog for the open document. Does nothing if arguments are passed. -
EXIT
Close the document and the Viewer, saving the Viewer settings and warning about unsaved forms first. The JVM exits ifViewer.exitOnCloseis true. Does nothing if arguments are passed. -
AUTOSCROLL
Toggle auto scrolling, which scrolls the view when the mouse is dragged past its edge. Does nothing if arguments are passed. -
DOCINFO
Show the document properties dialog. Does nothing if arguments are passed. -
OPENFILE
Open a file. With no arguments a file chooser is shown. Otherwise, args are a File or String path, optionally followed by a String named destination to go to; an InputStream, optionally followed by a String file name; or a byte[] followed by a String file name. The file name's extension decides whether it is opened as a PDF or an image. -
BOOKMARK
Go to the page of a bookmark. The arg is the String bookmark title and must be passed. -
FIND
Search the document. With no arguments the search window is shown, filled in with any highlighted text. Otherwise, args are the String search term, optionally followed by all three of an Integer ofSearchTypeflags, a Boolean for whether the term holds several words to search for separately, and a Boolean for whether to search only the current page. If all 3 optional values aren't present only the first is used. -
SNAPSHOT
Let the user drag an area of the page to extract as an image. Only works in single page view. Returns a Boolean that is true while waiting for the user to drag the area. -
OPENURL
Open a PDF from a URL. With no arguments a dialog asks for the URL. Otherwise, the arg is the String URL. -
VISITWEBSITE
Open the IDRsolutions website in the default browser. Does nothing if arguments are passed. -
PREVIOUSDOCUMENT
Open the previous document in the recent documents list. Does nothing if arguments are passed. -
NEXTDOCUMENT
Open the next document in the recent documents list. Does nothing if arguments are passed. -
PREVIOUSRESULT
Show the previous search result, wrapping round to the last result. ReturnsCommands.SEARCH_RETURNED_TO_START,Commands.SEARCH_NOT_FOUND,Commands.FIRST_DOCUMENT_SEARCH_RESULT_NOW_SHOWNor null. Does nothing if arguments are passed. -
NEXTRESULT
Show the next search result, wrapping round to the first result. ReturnsCommands.SEARCH_RETURNED_TO_START,Commands.SEARCH_NOT_FOUND,Commands.FIRST_DOCUMENT_SEARCH_RESULT_NOW_SHOWNor null. Does nothing if arguments are passed. -
TIP
Show the Tip of the Day dialog. Does nothing if arguments are passed. -
PREFERENCES
Show the preferences dialog. Does nothing if arguments are passed. -
COPY
Copy the highlighted text to the clipboard. Arguments are ignored. -
SELECTALL
Highlight all the text on the current page. Only works in single page view. Arguments are ignored. -
DESELECTALL
Clear all highlighted text and images. Only works in single page view. Arguments are ignored. -
UPDATEGUILAYOUT
Show or hide part of the Viewer's GUI. Args are the String property name of the component and a Boolean for whether to show it. Does nothing unless exactly 2 arguments are passed. -
MOUSEMODE
Toggle the mouse between selecting text and panning the page. Not available in facing or page flow view. Does nothing if arguments are passed. -
PANMODE
Set the mouse to pan the page. Does nothing if arguments are passed. -
TEXTSELECT
Set the mouse to select text. Does nothing if arguments are passed. -
SEPARATECOVER
Toggle whether the first page is shown on its own in facing views, and save the setting. Does nothing if arguments are passed. -
EXTRACTTEXT
Show a dialog to extract the highlighted text. Does nothing if arguments are passed. -
EXTRACTASIMAGE
Show a preview of the selected area as an image, which can be copied or saved. Arguments are ignored. -
ROTATELEFT
Rotate the display 90 degrees anticlockwise. Arguments are ignored. -
ROTATERIGHT
Rotate the display 90 degrees clockwise. Arguments are ignored. -
OPENINSYSTEMDEFAULT
Open the current file in the operating system's default application. Optionally the arg is a String path of a different file to open. -
XREF
No longer handled: does nothing. There is no matching constant in Commands. -
OBJECTS
No longer handled: does nothing. There is no matching constant in Commands. -
SIGN
Show the dialog to digitally sign the open file. Does nothing if arguments are passed. -
XREFSTREAM
No longer handled: does nothing. There is no matching constant in Commands. -
FIRSTPAGE
Go to the first page. Does nothing if arguments are passed. -
FBACKPAGE
Go back 10 pages, stopping at the first page. Does nothing if arguments are passed. -
BACKPAGE
Go back 1 page. Optionally the arg is the number of pages to go back, as a String. -
FORWARDPAGE
Go forward 1 page. Optionally the arg is the number of pages to go forward, as a String. -
FFORWARDPAGE
Go forward 10 pages, stopping at the last page. Does nothing if arguments are passed. -
LASTPAGE
Go to the last page. Does nothing if arguments are passed. -
GOTO
Go to a page. With no arguments a dialog asks for the page number. Otherwise the arg is the page number as a String. -
SINGLE
Show one page at a time and set the mouse to select text. Does nothing if arguments are passed. -
CONTINUOUS
Show the pages in a continuous vertical column and set the mouse to pan. Does nothing if arguments are passed. -
CONTINUOUS_FACING
Show the pages in a continuous column of facing pairs, fit to the page, and set the mouse to pan. Does nothing if arguments are passed. -
FACING
Show the pages as facing pairs, fit to the page, and set the mouse to pan. Does nothing if arguments are passed. -
PAGEFLOW
Show the pages in the page flow view, which needs JavaFX. Does nothing if arguments are passed. -
FULLSCREEN
Toggle full screen mode, if supported. Does nothing if arguments are passed. -
ZOOMIN
Zoom in to the next preset scaling, up to 1000%. Does nothing if arguments are passed. -
ZOOMOUT
Zoom out to the next preset scaling, down to 25%. Does nothing if arguments are passed. -
PORTFOLIO_DETAIL
Show a PDF portfolio's files as a detailed list. Arguments are ignored. -
PORTFOLIO_TILES
Show a PDF portfolio's files as tiles. Arguments are ignored. -
ROTATION
Rotate the display. With no arguments the rotation selected in the toolbar is applied. Otherwise, the arg is the rotation in degrees as a String: 0, 90, 180 or 270. -
SCALING
Set the scaling. With no arguments the scaling selected in the toolbar is applied. Otherwise, the arg is the scaling as a percentage number or one of the toolbar's text options, such as "Fit Width". -
CURRENTMENU
Identifies the whole Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
CONTENTMENU
Identifies the Content menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
PDFMENU
Not used by the Viewer. Running it as a command does nothing. -
EXPORTMENU
Identifies the Export menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
WINDOWMENU
Not used by the Viewer. Running it as a command does nothing. -
PAGELAYOUTMENU
Identifies the Page Layout menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
EDITMENU
Identifies the Edit menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
GOTOMENU
Identifies the Go To menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
VIEWMENU
Identifies the View menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
OPENMENU
Identifies the Open menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
FILEMENU
Identifies the File menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
HELPFORUM
Not used by the Viewer. The Help menu is identified byHELP. Running it as a command does nothing. -
PORTFOLIOMENU
Identifies the Portfolio menu, which is only shown for PDF portfolios, in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
TOOLSMENU
Identifies the Tools menu in the Swing menu bar, for showing, hiding, enabling or disabling it. Running it as a command does nothing. -
SAVEFORM
Show a dialog to save the document after annotations have been added. If no annotation has been added, no file is written. Does nothing if arguments are passed. -
HIGHLIGHT
Clear the current text highlights, then highlight areas on a page. Args are an int[][] of {x, y, width, height} rectangles in PDF coordinates, the Integer page, and an optional Boolean, default true, where true highlights the rectangles and false highlights whole lines from the top left to the bottom right. With no arguments the highlights are only cleared. -
SCROLL
Scroll an area of a page into view. Args are an int[] {x, y, width, height} rectangle and an optional Integer page, default the current page. Does nothing with no arguments. -
ADDVIEW
-
FORWARD
Go forward to the next view in the history added byADDVIEW. Arguments are ignored. -
BACK
Go back to the previous view in the history added byADDVIEW. Arguments are ignored. -
PAGEGROUPING
Return the text grouping object for a page, decoding the page in the background if it is not the page being displayed. The arg is the Integer page. Returns null with no arguments or if an error occurs. -
SETPAGECOLOR
Set the page background colour and repaint. The arg is the colour as an Integer RGB value. -
SETUNDRAWNPAGECOLOR
Set the colour shown for pages that have not been drawn yet. The arg is the colour as an Integer RGB value. -
REPLACETEXTCOLOR
Set the colour all text is drawn in, without repainting. The arg is the colour as an Integer RGB value.SETTEXTCOLORdoes the same and repaints. -
SETTEXTCOLOR
Set the colour all text is drawn in and repaint. The arg is the colour as an Integer RGB value. -
CHANGELINEART
Set whether shapes and line art are recoloured along with the text when a text colour is set, then repaint. The arg is a Boolean. -
SETDISPLAYBACKGROUND
Set the background colour of the display area around the pages. The arg is the colour as an Integer RGB value. -
SETREPLACEMENTCOLORTHRESHOLD
Set the threshold that decides which text is recoloured when a text colour is set. The arg is the threshold as an Integer. -
SETENHANCEFRACTIONALLINES
Set whether lines thinner than 1 pixel are widened so they stay visible, then repaint. The arg is a Boolean. -
SETHIDELINEWEIGHTS
Set whether all shapes are drawn with a 1 pixel stroke after scaling, then repaint. The arg is a Boolean. -
SETHIGHLIGHTFORMFIELDS
Set whether interactive form fields are highlighted, then repaint. The arg is a Boolean. -
HELP
Open the JPedal documentation in the default browser. Does nothing if arguments are passed. -
BUY
Open the JPedal pricing page in the default browser. Does nothing if arguments are passed. -
HIDEVERSIONNUMBER
Remove the version number from the window title. Arguments are ignored. -
SHOWVERSIONNUMBER
Show the version number in the window title. Arguments are ignored. -
ADDPAGE
Show a dialog to insert blank pages of a chosen size, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
ADDIMAGE
Show a dialog to choose pages and an image, then let the user drag the area to place it in, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
COPYPAGE
Show a dialog to copy a page to another position, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
CROPPAGE
Show a dialog to crop pages, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
EMBEDFILE
Show a dialog to embed a file in the document as an attachment, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
ISOLATEPAGE
Show a dialog to choose pages to keep, removing all the others, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
NUP
Show a dialog to combine several pages onto each page in a grid of rows and columns, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEPAGE
Show a dialog to remove pages, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
ROTATEPAGE
Show a dialog to rotate pages, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
SCALEPAGE
Show a dialog to scale pages, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
SETDOCUMENTINFO
Show a dialog to edit the document information, which is written to both the Info dictionary and the XMP metadata, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
SETINITIALVIEW
Show a dialog to set the page, page layout and page mode the document opens with, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEBOOKMARKS
Remove all bookmarks, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEEMBEDDEDFILES
Remove all embedded files, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEINITIALVIEW
Remove the initial view settings, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEJAVASCRIPT
Remove all JavaScript, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVELINKS
Remove all links, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEMETADATA
Remove the document metadata, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
MOVEPAGE
Show a dialog to move a page to another position, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEANNOTATIONS
Show a dialog to choose pages to remove annotations from, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REVERSEPAGES
Reverse the page order, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REDACT
Show a dialog to choose pages, then let the user drag the area of text to redact, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
DOWNSAMPLEIMAGES
Downsample all images using the default settings, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
FLATTENLAYERS
Flatten all layers, removing hidden layers and making visible layers permanent, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
OPTIMIZECOLORPALETTE
Optimise image colour palettes to fit an indexed colour space, losslessly reducing image size, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEBLANKPAGES
Remove blank pages, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed. -
REMOVEDIGITALSIGNATURES
Remove all digital signatures, then save the document (asking whether to overwrite the open file) and reopen it. Does nothing if arguments are passed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
createFromID
Returns the command with the given ID, which is the value of the matching constant inCommands.- Parameters:
id- the command ID- Returns:
- the matching command, or null if no command has that ID
-