Package com.saperion.ngc.viewer.pdfjs
Class PdfjsViewerUtil
- java.lang.Object
-
- com.saperion.ngc.viewer.pdfjs.PdfjsViewerUtil
-
- All Implemented Interfaces:
java.io.Serializable
public final class PdfjsViewerUtil extends java.lang.Object implements java.io.Serializable
Utility methods forPdfjsViewerImpl
and pdfjsViewerWindow.jsp.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
USE_EMBED_PDF_MODE
-
Constructor Summary
Constructors Constructor Description PdfjsViewerUtil(javax.servlet.http.HttpServletRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRender(java.lang.String filename)
java.lang.String
getAdditionalParams()
java.lang.String
getAdobePluginOptions()
Returns the options for the Adobe Plugin as set in the configuration file.PdfjsViewerDisplayMode
getDisplayMode(OpenDocumentBean bean)
Returns the way the current element must be displayed.PdfjsViewerDisplayMode
getDisplayMode(OpenDocumentBean bean, java.lang.String name)
Returns the way the current element must be displayed.PdfjsViewerDisplayMode
getDisplayModeForTemporaryDocs(java.lang.String name)
boolean
isImage(java.lang.String filename)
boolean
isMp4(java.lang.String filename)
boolean
isPdf(java.lang.String filename)
void
removeRenderTargetInBean(OpenDocumentBean bean)
Removes the 'targetFormat' parameter from the bean.void
setRenderTargetInBean(OpenDocumentBean bean)
Adds a parameter 'targetFormat' in the bean, which will cause theViewDocumentServlet
to render the element as PDF.
-
-
-
Field Detail
-
USE_EMBED_PDF_MODE
public static final java.lang.String USE_EMBED_PDF_MODE
- See Also:
- Constant Field Values
-
-
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 theViewDocumentServlet
. 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 theViewDocumentServlet
. 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 forbean
-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
-
setRenderTargetInBean
public void setRenderTargetInBean(OpenDocumentBean bean)
Adds a parameter 'targetFormat' in the bean, which will cause theViewDocumentServlet
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 java.lang.String getAdditionalParams()
- Returns:
- Additional parameters for viewer.html URL.
-
-