Package org.opencms.pdftools
Class CmsPdfThumbnailLink
java.lang.Object
org.opencms.pdftools.CmsPdfThumbnailLink
Class to generate or parse a link to a PDF thumbnail.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Exception which is thrown when parsing a thumbnail link fails. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The marker string used to identify PDF thumbnails.static final String
The name of the request parameter for the thumbnail options.static final String
The name of the reqex for parsing the thumbnail URI path.static final Pattern
The compiled regular expression for matching thumbnail URI paths. -
Constructor Summary
ConstructorDescriptionCmsPdfThumbnailLink
(CmsObject cms, String link, String options) Parses a thumbnail link object from the given link path and options.CmsPdfThumbnailLink
(CmsObject cms, CmsResource pdfResource, int width, int height, String format) Creates a new thumbnail link for the given resource and options. -
Method Summary
-
Field Details
-
MARKER
The marker string used to identify PDF thumbnails.- See Also:
-
PARAM_OPTIONS
The name of the request parameter for the thumbnail options.- See Also:
-
REGEX
The name of the reqex for parsing the thumbnail URI path.- See Also:
-
REGEX_COMPILED
The compiled regular expression for matching thumbnail URI paths.
-
-
Constructor Details
-
CmsPdfThumbnailLink
public CmsPdfThumbnailLink(CmsObject cms, CmsResource pdfResource, int width, int height, String format) Creates a new thumbnail link for the given resource and options.- Parameters:
cms
- the current CMS contextpdfResource
- the PDF resource for which to create a thumbnail linkwidth
- thumbnail widthheight
- thumbnail heightformat
- the thumbnail image format (png, gif..,)
-
CmsPdfThumbnailLink
public CmsPdfThumbnailLink(CmsObject cms, String link, String options) throws CmsPdfThumbnailLink.ParseException, CmsException Parses a thumbnail link object from the given link path and options.- Parameters:
cms
- the current CMS contextlink
- the linkoptions
- the options- Throws:
CmsPdfThumbnailLink.ParseException
CmsException
-
-
Method Details
-
getFormat
Gets the image format.- Returns:
- the image format
-
getHeight
Returns the height.- Returns:
- the height
-
getLinkWithOptions
Gets the link, with the options appended as a request parameter.- Returns:
- the link with the options
-
getPage
Returns the page.- Returns:
- the page
-
getWidth
Returns the width.- Returns:
- the width
-