org.dspace.app.mediafilter
Class XPDF2Thumbnail

java.lang.Object
  extended by org.dspace.app.mediafilter.MediaFilter
      extended by org.dspace.app.mediafilter.XPDF2Thumbnail
All Implemented Interfaces:
FormatFilter

public class XPDF2Thumbnail
extends MediaFilter

Thumbnail MediaFilter for PDF sources This filter generates thumbnail images for PDF documents, _including_ 3D PDF documents with 2D "poster" images. Since the PDFBox library does not understand these, and fails to render a lot of other PDFs, this filter forks a process running the "pdftoppm" program from the XPdf suite -- see http://www.foolabs.com/xpdf/ This is a suite of open-source PDF tools that has been widely ported to Unix platforms and the ones we use (pdftoppm, pdfinfo) even run on Win32. This was written for the FACADE project but it is not directly connected to any of the other FACADE-specific software. The FACADE UI expects to find thumbnail images for 3D PDFs generated by this filter. Requires DSpace config properties keys: xpdf.path.pdftoppm -- absolute path to "pdftoppm" executable (required!) xpdf.path.pdfinfo -- absolute path to "pdfinfo" executable (required!) thumbnail.maxwidth -- borrowed from thumbnails, max dim of generated image

Author:
Larry Stone
See Also:
MediaFilter

Constructor Summary
XPDF2Thumbnail()
           
 
Method Summary
 String getBundleName()
           
 String getDescription()
           
 InputStream getDestinationStream(InputStream sourceStream)
           
 String getFilteredName(String oldFilename)
          Get a filename for a newly created filtered bitstream
 String getFormatString()
           
 
Methods inherited from class org.dspace.app.mediafilter.MediaFilter
postProcessBitstream, preProcessBitstream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPDF2Thumbnail

public XPDF2Thumbnail()
Method Detail

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:
name of the bundle this filter will stick its generated Bitstreams

getFormatString

public String getFormatString()
Returns:
name of the bitstream format (say "HTML" or "Microsoft Word") returned by this filter look in the bitstream format registry or mediafilter.cfg for valid format strings.

getDescription

public String getDescription()
Returns:
string to describe the newly-generated Bitstream's - how it was produced is a good idea

getDestinationStream

public InputStream getDestinationStream(InputStream sourceStream)
                                 throws Exception
Parameters:
sourceStream - input stream
Returns:
result of filter's transformation, written out to a bitstream
Throws:
Exception


Copyright © 2010 DuraSpace. All Rights Reserved.