org.pdfsam.guiclient.business.thumbnails.creators
Interface ThumbnailsCreator

All Known Implementing Classes:
AbstractThumbnailCreator

public interface ThumbnailsCreator

Interface for thumbnails creators that can be used to fill thumbnails of the JVisualPdfPageSelectionPanel.

Author:
Andrea Vacondio

Field Summary
static float DEFAULT_RESIZE_PERCENTAGE
          Default resize percentage 20%
 
Method Summary
 void clean(long id)
          clean the thumbnails generation with the given id
 java.lang.String getCreatorIdentifier()
           
 java.lang.String getCreatorName()
           
 java.awt.image.BufferedImage getPageImage(java.io.File inputFile, java.lang.String password, int page)
           
 java.awt.image.BufferedImage getPageImage(java.io.File fileName, java.lang.String password, int page, int rotation)
           
 java.awt.image.BufferedImage getPageImage(java.lang.String fileName, java.lang.String password, int page)
           
 java.awt.image.BufferedImage getPageImage(java.lang.String fileName, java.lang.String password, int page, int rotation)
           
 int getResolution()
           
 java.awt.image.BufferedImage getThumbnail(java.io.File inputFile, java.lang.String password, int page, float resizePercentage)
           
 java.awt.image.BufferedImage getThumbnail(java.lang.String fileName, java.lang.String password, int page, float resizePercentage)
           
 void initThumbnailsPanel(java.io.File inputFile, java.lang.String password, JVisualPdfPageSelectionPanel panel, long id, java.util.List<DocumentPage> template)
          Initialize the input panel.
 void initThumbnailsPanel(java.lang.String fileName, java.lang.String password, JVisualPdfPageSelectionPanel panel, long id, java.util.List<DocumentPage> template)
          Initialize the input panel.
 

Field Detail

DEFAULT_RESIZE_PERCENTAGE

static final float DEFAULT_RESIZE_PERCENTAGE
Default resize percentage 20%

See Also:
Constant Field Values
Method Detail

getThumbnail

java.awt.image.BufferedImage getThumbnail(java.lang.String fileName,
                                          java.lang.String password,
                                          int page,
                                          float resizePercentage)
                                          throws ThumbnailCreationException
Parameters:
fileName - pdf document
password - document password or null if no password is needed
page - page nmber
resizePercentage - resize level
Returns:
a thumbnail of the given page
Throws:
ThumbnailCreationException

getPageImage

java.awt.image.BufferedImage getPageImage(java.lang.String fileName,
                                          java.lang.String password,
                                          int page)
                                          throws ThumbnailCreationException
Parameters:
fileName - pdf document
password - document password or null if no password is needed
page -
Returns:
an image version of the given page
Throws:
ThumbnailCreationException

getPageImage

java.awt.image.BufferedImage getPageImage(java.lang.String fileName,
                                          java.lang.String password,
                                          int page,
                                          int rotation)
                                          throws ThumbnailCreationException
Parameters:
fileName -
password -
page -
rotation - page rotation in degrees
Returns:
the image
Throws:
ThumbnailCreationException

getThumbnail

java.awt.image.BufferedImage getThumbnail(java.io.File inputFile,
                                          java.lang.String password,
                                          int page,
                                          float resizePercentage)
                                          throws ThumbnailCreationException
Parameters:
inputFile - pdf document
password - document password or null if no password is needed
page - page nmber
resizePercentage - resize level
Returns:
a thumbnail of the given page
Throws:
ThumbnailCreationException

getPageImage

java.awt.image.BufferedImage getPageImage(java.io.File inputFile,
                                          java.lang.String password,
                                          int page)
                                          throws ThumbnailCreationException
Parameters:
inputFile - pdf document
password - document password or null if no password is needed
page -
Returns:
an image version of the given page
Throws:
ThumbnailCreationException

getPageImage

java.awt.image.BufferedImage getPageImage(java.io.File fileName,
                                          java.lang.String password,
                                          int page,
                                          int rotation)
                                          throws ThumbnailCreationException
Parameters:
fileName -
password -
page -
rotation - page rotation in degrees
Returns:
the image
Throws:
ThumbnailCreationException

initThumbnailsPanel

void initThumbnailsPanel(java.io.File inputFile,
                         java.lang.String password,
                         JVisualPdfPageSelectionPanel panel,
                         long id,
                         java.util.List<DocumentPage> template)
                         throws ThumbnailCreationException
Initialize the input panel. Set the document properties on the panel and starts previews generation.

Parameters:
inputFile - pdf document
password - document password or null if no password is needed
panel -
id - Id for this thumbnails generation
template - template for the document pages (order, rotation infos..)
Throws:
ThumbnailCreationException

initThumbnailsPanel

void initThumbnailsPanel(java.lang.String fileName,
                         java.lang.String password,
                         JVisualPdfPageSelectionPanel panel,
                         long id,
                         java.util.List<DocumentPage> template)
                         throws ThumbnailCreationException
Initialize the input panel. Set the document properties on the panel and starts previews generation.

Parameters:
fileName -
password - document password or null if no password is needed
panel -
id - Id for this thumbnails generation
template - template for the document pages (order, rotation infos..)
Throws:
ThumbnailCreationException

getResolution

int getResolution()
Returns:
resolution of the created thumbnails

clean

void clean(long id)
clean the thumbnails generation with the given id

Parameters:
id -

getCreatorName

java.lang.String getCreatorName()
Returns:
the Name of the creator

getCreatorIdentifier

java.lang.String getCreatorIdentifier()
Returns:
a unique identifier for the creator.