Package org.dspace.app.mediafilter
Class PDFBoxThumbnail
- java.lang.Object
-
- org.dspace.app.mediafilter.MediaFilter
-
- org.dspace.app.mediafilter.PDFBoxThumbnail
-
- All Implemented Interfaces:
FormatFilter,SelfRegisterInputFormats
public class PDFBoxThumbnail extends MediaFilter implements SelfRegisterInputFormats
Create JPEG thumbnails from PDF cover page using PDFBox. Based on JPEGFilter: Filter image bitstreams, scaling the image to be within the bounds of thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be no bigger than. Creates only JPEGs.- Author:
- Ivan Masár helix84@centrum.sk, Jason Sherman jsherman@usao.edu
-
-
Constructor Summary
Constructors Constructor Description PDFBoxThumbnail()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBundleName()StringgetDescription()InputStreamgetDestinationStream(Item currentItem, InputStream source, boolean verbose)Read the source stream and produce the filtered content.StringgetFilteredName(String oldFilename)Get a filename for a newly created filtered bitstreamStringgetFormatString()String[]getInputDescriptions()String[]getInputExtensions()String[]getInputMIMETypes()-
Methods inherited from class org.dspace.app.mediafilter.MediaFilter
postProcessBitstream, preProcessBitstream
-
-
-
-
Method Detail
-
getFilteredName
public String getFilteredName(String oldFilename)
Description copied from interface:FormatFilterGet a filename for a newly created filtered bitstream- Specified by:
getFilteredNamein interfaceFormatFilter- Parameters:
oldFilename- name of source bitstream- Returns:
- filename generated by the filter - for example, document.pdf becomes document.pdf.txt
-
getBundleName
public String getBundleName()
- Specified by:
getBundleNamein interfaceFormatFilter- Returns:
- String bundle name
-
getFormatString
public String getFormatString()
- Specified by:
getFormatStringin interfaceFormatFilter- Returns:
- String bitstreamformat
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceFormatFilter- Returns:
- String description
-
getDestinationStream
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) throws Exception
Description copied from interface:FormatFilterRead the source stream and produce the filtered content.- Specified by:
getDestinationStreamin interfaceFormatFilter- Parameters:
currentItem- itemsource- source input streamverbose- verbose mode- Returns:
- InputStream the resulting input stream
- Throws:
Exception- if error
-
getInputMIMETypes
public String[] getInputMIMETypes()
- Specified by:
getInputMIMETypesin interfaceSelfRegisterInputFormats
-
getInputDescriptions
public String[] getInputDescriptions()
- Specified by:
getInputDescriptionsin interfaceSelfRegisterInputFormats
-
getInputExtensions
public String[] getInputExtensions()
- Specified by:
getInputExtensionsin interfaceSelfRegisterInputFormats
-
-