Class ThumbnailManager

java.lang.Object
com.logicaldoc.core.document.thumbnail.ThumbnailManager

@Component("thumbnailManager") public class ThumbnailManager extends Object
Manager class used to handle document thumbnails
Since:
4.5
Author:
Marco Meschieri - LogicalDOC
  • Field Details

  • Constructor Details

    • ThumbnailManager

      public ThumbnailManager()
  • Method Details

    • createTumbnail

      public void createTumbnail(Document document, String fileVersion, String sid) throws IOException
      Creates the thumbnail for the specified document and file version. The thumbnail is an image rendering of the first page only.
      Parameters:
      document - The document to be treated
      fileVersion - The file version(optional)
      sid - The session identifier(optional)
      Throws:
      IOException - in case an error happens during image creation
    • createTumbnail

      public void createTumbnail(Document document, String sid) throws IOException
      Creates the thumbnail for the specified document
      Parameters:
      document - The document to be treated
      sid - The session identifier (optional)
      Throws:
      IOException - raised in case the thumbnail file cannot be created
    • createTumbnail

      public void createTumbnail(Document document, String fileVersion, int size, Integer quality, String sid) throws IOException
      Creates the thumbnail for the specified document and file version using given size and quality. The thumbnail is an image rendering of the first page only.
      Parameters:
      document - The document to be treated
      fileVersion - The file version(optional)
      size - The thumbnail size
      quality - Compression quality(0..100, 100 is maximum quality). If not specified the standard thumbnail quality will be used.
      sid - The session identifier(optional)
      Throws:
      IOException - in case an error happens during image creation
    • createTile

      public void createTile(Document document, String fileVersion, String sid) throws IOException
      Creates the tile for the specified document and file version. The tile is an image rendering of the first page only.
      Parameters:
      document - The document to be treated
      fileVersion - The file version(optional)
      sid - The session identifier(optional)
      Throws:
      IOException - in case an error happens during image creation
    • createMobile

      public void createMobile(Document document, String fileVersion, String sid) throws IOException
      Creates the mobile image for the specified document and file version. The mobile is an image rendering of the first page only.
      Parameters:
      document - The document to be treated
      fileVersion - The file version(optional)
      sid - The session identifier(optional)
      Throws:
      IOException - in case an error happens during image creation
    • getBuilder

      public ThumbnailBuilder getBuilder(String filename)
      Loads the proper builder for the passed file name
      Parameters:
      filename - the filename to be rendered
      Returns:
      the right thumbnail builder for the given file name
    • init

      @PostConstruct public void init()
      Initializes the builders map
    • getBuilders

      public Map<String,ThumbnailBuilder> getBuilders()
    • setStore

      public void setStore(Store store)