Class PdfjsViewerUtil

java.lang.Object
com.saperion.ngc.viewer.pdfjs.PdfjsViewerUtil
All Implemented Interfaces:
Serializable

public final class PdfjsViewerUtil extends Object implements Serializable
Utility methods for PdfjsViewerImpl and pdfjsViewerWindow.jsp.
See Also:
  • Field Details

  • Constructor Details

    • PdfjsViewerUtil

      public PdfjsViewerUtil(jakarta.servlet.http.HttpServletRequest request)
  • Method Details

    • isImage

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

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

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

      public boolean canRender(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 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, 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(String name)
      Parameters:
      name - name of the temporary element to display
      Returns:
      the mode the temporary document must be displayed
    • setRenderTargetInBean

      public void setRenderTargetInBean(OpenDocumentBean bean)
      Adds a parameter 'targetFormat' in the bean, which will cause the ViewDocumentServlet to render the element as PDF.
      Parameters:
      bean - OpenDocumentBean of the viewer
    • removeRenderTargetInBean

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

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