Class PDFBoxThumbnail

java.lang.Object
org.dspace.app.mediafilter.MediaFilter
org.dspace.app.mediafilter.PDFBoxThumbnail
All Implemented Interfaces:
FormatFilter

public class PDFBoxThumbnail extends MediaFilter
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 Details

    • PDFBoxThumbnail

      public PDFBoxThumbnail()
  • Method Details

    • getFilteredName

      public String getFilteredName(String oldFilename)
      Description copied from interface: FormatFilter
      Get a filename for a newly created filtered bitstream
      Parameters:
      oldFilename - name of source bitstream
      Returns:
      filename generated by the filter - for example, document.pdf becomes document.pdf.txt
    • getBundleName

      public String getBundleName()
      Returns:
      String bundle name
    • getFormatString

      public String getFormatString()
      Returns:
      String bitstreamformat
    • getDescription

      public String getDescription()
      Returns:
      String description
    • getDestinationStream

      public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) throws Exception
      Description copied from interface: FormatFilter
      Read the source stream and produce the filtered content.
      Parameters:
      currentItem - item
      source - source input stream
      verbose - verbose mode
      Returns:
      InputStream the resulting input stream
      Throws:
      Exception - if error