com.groupdocs.viewer.converter.options

Class ImageOptions



  • public class ImageOptions
    extends RenderOptions

    Provides options for rendering documents as image.

    • Constructor Detail

      • ImageOptions

        public ImageOptions()

        Initialize new instance of image options

    • Method Detail

      • getFileExtension

        @Deprecated
        public String getFileExtension()
        Deprecated. 

        Gets the extension of an output image.

        Example:
        The following example demonstrates how to get file extension from an ImageOptions object.

         ImageOptions options = new ImageOptions();
         options.setConvertImageFileType(ConvertImageFileType.BMP);
         // fileExtension string will be equal to ".bmp"
         String fileExtension = options.getFileExtension();
         

        Deprecated:
        This property is obsolete and will be removed after v19.2.

        Returns:
        The file extension.
      • setConvertImageFileType

        public void setConvertImageFileType(int value)

        The format of the image file, default is PNG.

        Note:
        Specifies output image format.

        Example:
        The following example demonstrates how to render the document into JPG image type.

         ViewerConfig config = new ViewerConfig();
         ViewerImageHandler imageHandler = new ViewerImageHandler(config);
        
         ImageOptions options = new ImageOptions();
         options.setConvertImageFileType(ConvertImageFileType.JPG);
         String guid = "C:\storage\document.doc";
        
         List<PageImage> pages = imageHandler.getPages(guid, options);
         

        Parameters:
        value - The type of the image file.
      • setExtractText

        public void setExtractText(boolean value)

        Indicates whether the document text with coordinates should be extracted into the file data.

        Note:
        This option might be useful when you want to add selectable text layer over the image.
        Parameters:
        value - Whether the document text with coordinates should be extracted into the file data.
      • setHeight

        public void setHeight(int value)

        The height of an output image in pixels.

        Example:
        The following example demonstrates how to set the height of an output image in pixels.

         ViewerConfig config = new ViewerConfig();
         ViewerImageHandler imageHandler = new ViewerImageHandler(config);
         String guid = "C:\storage\document.doc";
        
         ImageOptions options = new ImageOptions();
         options.setHeight(1000);
        
         List<PageImage> pages = imageHandler.getPages(guid, options);
         

        Parameters:
        value - The height.
      • setWidth

        public void setWidth(int value)

        The width of the output image in pixels.

        Example:
        The following example demonstrates how to set the width of an output image in pixels.

         ViewerConfig config = new ViewerConfig();
         ViewerImageHandler imageHandler = new ViewerImageHandler(config);
         String guid = "C:\storage\document.doc";
        
         ImageOptions options = new ImageOptions();
         options.setWidth(800);
        
         List<PageImage> pages = imageHandler.getPages(guid, options);
         

        Parameters:
        value - The width.