Class PdfjsViewerUtil

  • All Implemented Interfaces:
    java.io.Serializable

    public final class PdfjsViewerUtil
    extends java.lang.Object
    implements java.io.Serializable
    Utility methods for PdfjsViewerImpl and pdfjsViewerWindow.jsp.
    See Also:
    Serialized Form
    • Field Detail

      • USE_EMBED_PDF_MODE

        public static final java.lang.String USE_EMBED_PDF_MODE
        See Also:
        Constant Field Values
    • Constructor Detail

      • PdfjsViewerUtil

        public PdfjsViewerUtil​(javax.servlet.http.HttpServletRequest request)
    • Method Detail

      • isImage

        public boolean isImage​(java.lang.String filename)
        Parameters:
        filename - filename of element to display
        Returns:
        true if element is an image (jpg, gif, png)
      • isPdf

        public boolean isPdf​(java.lang.String filename)
        Parameters:
        filename - filename of element to display
        Returns:
        true if element is a pdf
      • isMp4

        public boolean isMp4​(java.lang.String filename)
        Parameters:
        filename - filename of element to display
        Returns:
        true if element is a mp4 video
      • canRender

        public boolean canRender​(java.lang.String filename)
        Parameters:
        filename - filename of element to display
        Returns:
        true if the render engine can render this type of file
      • getDisplayMode

        public PdfjsViewerDisplayMode getDisplayMode​(OpenDocumentBean bean)
        Returns the way the current element must be displayed. Additionally, if required an attribute named 'targetFormat' is added to the bean, which is read by the ViewDocumentServlet. If a target format is set, the servlet will render the element before delivering it.
        Parameters:
        bean - OpenDocumentBean of the viewer
        Returns:
        the mode the document must be displayed
      • getAdobePluginOptions

        public java.lang.String getAdobePluginOptions()
        Returns the options for the Adobe Plugin as set in the configuration file.
        Returns:
        options for Adobe Plugin
      • getDisplayMode

        public PdfjsViewerDisplayMode getDisplayMode​(OpenDocumentBean bean,
                                                     java.lang.String name)
        Returns the way the current element must be displayed. Additionally, if required an attribute named 'targetFormat' is added to the bean, which is read by the ViewDocumentServlet. If a target format is set, the servlet will render the element before delivering it.
        Parameters:
        name - the name of the file to get the display-mode for
        bean - OpenDocumentBean of the viewer
        Returns:
        the mode the document must be displayed
      • getDisplayModeForTemporaryDocs

        public PdfjsViewerDisplayMode getDisplayModeForTemporaryDocs​(java.lang.String name)
        Parameters:
        name - name of the temporary element to display
        Returns:
        the mode the temporary document must be displayed
      • removeRenderTargetInBean

        public void removeRenderTargetInBean​(OpenDocumentBean bean)
        Removes the 'targetFormat' parameter from the bean.
        Parameters:
        bean - OpenDocumentBean of the viewer
      • getAdditionalParams

        public java.lang.String getAdditionalParams()
        Returns:
        Additional parameters for viewer.html URL.