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.SerializableUtility methods forPdfjsViewerImpland pdfjsViewerWindow.jsp.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringUSE_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 booleancanRender(java.lang.String filename)java.lang.StringgetAdditionalParams()java.lang.StringgetAdobePluginOptions()Returns the options for the Adobe Plugin as set in the configuration file.PdfjsViewerDisplayModegetDisplayMode(OpenDocumentBean bean)Returns the way the current element must be displayed.PdfjsViewerDisplayModegetDisplayMode(OpenDocumentBean bean, java.lang.String name)Returns the way the current element must be displayed.PdfjsViewerDisplayModegetDisplayModeForTemporaryDocs(java.lang.String name)booleanisImage(java.lang.String filename)booleanisMp4(java.lang.String filename)booleanisPdf(java.lang.String filename)voidremoveRenderTargetInBean(OpenDocumentBean bean)Removes the 'targetFormat' parameter from the bean.voidsetRenderTargetInBean(OpenDocumentBean bean)Adds a parameter 'targetFormat' in the bean, which will cause theViewDocumentServletto 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-OpenDocumentBeanof 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-OpenDocumentBeanof 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 theViewDocumentServletto render the element as PDF.- Parameters:
bean-OpenDocumentBeanof the viewer
-
removeRenderTargetInBean
public void removeRenderTargetInBean(OpenDocumentBean bean)
Removes the 'targetFormat' parameter from the bean.- Parameters:
bean-OpenDocumentBeanof the viewer
-
getAdditionalParams
public java.lang.String getAdditionalParams()
- Returns:
- Additional parameters for viewer.html URL.
-
-