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

      • getConvertImageFileType

        public int getConvertImageFileType()

        The format of the image file, default is PNG.


         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);
         

        Value: The type of the image file.


        Specifies output image format.

      • getExtractText

        public boolean getExtractText()
      • getFileExtension

        public String getFileExtension()

        Gets the extension of an output image.


         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();
         

      • getHeight

        public int getHeight()

        The height of an output image in pixels.


         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);
         

        Value: The height.
      • getWidth

        public int getWidth()

        The width of the output image in pixels.


         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);
         

        Value: The width.
      • setConvertImageFileType

        public void setConvertImageFileType(int value)

        The type of image file, default is PNG.

        The following example demonstrates how to get image representations of document in the specified file format.
        Parameters:
        value - a int.
      • setExtractText

        public void setExtractText(boolean value)
      • setHeight

        public void setHeight(int value)

        The image height.

        The following example demonstrates how to set the height of an image representations of the document in pixels.
        Parameters:
        value - a int.
      • setWidth

        public void setWidth(int value)

        The image width.

        The following example demonstrates how to set the width of an image representations of the document in pixels.
        Parameters:
        value - a int.