Class ThumbnailPanel

  • public class ThumbnailPanel
    extends SidePanelFactory

    Creates a SidePanel that displays the page thumbnails. Since release 2.10.2 the Thumbnail panel can also be used to reorder, delete and insert pages or entire documents. Modifying a document in this way requires the EncryptionHandler on the document grants the "Assemble" right.

    It's also possible to add custom actions to a ThumbnailPanel by adding features implementing ThumbnailPanel.ThumbnailSelectionAction. These will be available via keyboard shortcut or the popup menu on the panel.

    The following initialization parameters can be specified to configure this feature.
    editabletrue or false, for setEditable(). Default is true
    draggabletrue or false, for setDraggable(). Default is true
    scrollFollowtrue or false, for setScrollFollow(). Default is true
    usePageLabelstrue or false, for setUsePageLabels(). Default is true
    thumbnailSizenumber, for setThumbnailSize(). Default is 100
    The name of this feature is ShowHideThumbnails

    This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

    See Also:
    • Constructor Detail

      • ThumbnailPanel

        public ThumbnailPanel()
        Create a new ThumbnailPanel
    • Method Detail

      • setEditable

        public void setEditable​(boolean editmode)
        Determine whether SidePanels created by this factory allow pages to be edited in any way - either reordered via dragging or through any editing ThumbnailPanel.ThumbnailSelectionAction. The default is true, but this may be overridden by the PDF itself if it is encrypted and doesn't allow editing. s* Pages may not be edited if the PDF is not yet fully loaded.
        editmode - true if SidePanels created by this Factory allow alterations to the PDF
      • setDraggable

        public void setDraggable​(boolean draggable)
        Determines whether SidePanels created by this factory can be edited by dragging pages around or dragging new documents in. This is distinct from setEditable(boolean) - if that flag is true but this flag false, the document can still be edited by other means via the Thumbnail panel. The default is true
        draggable - if the PDF can be edited by dragging
      • setScrollFollow

        public void setScrollFollow​(boolean follow)
        Set whether the thumbnail panel should scroll to follow the currently selected page or not. The default is true.
        follow - whether to follow the currently selected page in the viewport
      • setUsePageLabels

        public void setUsePageLabels​(boolean uselabels)
        Set whether to number the pages using the "page labels" if defined on this PDF, or whether to always use the physical page number. The default is true.
        uselabels - if true, use the page labels if defined
        See Also:
        PDF.getPageLabel(int), PageNumber.setUsePageLabels(boolean)
      • setThumbnailSize

        public void setThumbnailSize​(int thumbnailsize)
        Set the size of the longest dimension of each thumbnail. The default is 100, although this can be changed by the "thumbnailSize" property or via the user-interface while running the viewer.