com.aspose.pdf.devices

Class JpegDevice



  • public final class JpegDevice
    extends ImageDevice

    Represents image device that helps to save pdf document pages into jpeg.

    • Constructor Detail

      • JpegDevice

        public JpegDevice()

        Initializes a new instance of the JpegDevice class with default resolution and maximum quality.

      • JpegDevice

        public JpegDevice(Resolution resolution)

        Initializes a new instance of the JpegDevice class.

        Parameters:
        resolution - Resolution for the result image file, see Resolution class.
      • JpegDevice

        public JpegDevice(int quality)

        Initializes a new instance of the JpegDevice class.

        Parameters:
        quality - Specifies the level of compression for an image. The range of useful values for the quality is from 0 to 100. The lower the number specified, the higher the compression and therefore the lower the quality of the image. Zero would give you the lowest quality image and 100 the highest.
      • JpegDevice

        public JpegDevice(Resolution resolution,
                          int quality)

        Initializes a new instance of the JpegDevice class.

        Parameters:
        resolution - Resolution for the result image file, see Resolution class.
        quality - Specifies the level of compression for an image. The range of useful values for the quality is from 0 to 100. The lower the number specified, the higher the compression and therefore the lower the quality of the image. Zero would give you the lowest quality image and 100 the highest.
      • JpegDevice

        public JpegDevice(int width,
                          int height)

        Initializes a new instance of the JpegDevice class with provided image dimensions, default resolution (=150) and maximum quality.

        Parameters:
        width - Image output width.
        height - Image output height.
      • JpegDevice

        public JpegDevice(PageSize pageSize)

        Initializes a new instance of the JpegDevice class with provided page size, default resolution (=150) and maximum quality.

        Parameters:
        pageSize - Page size of the output image.
      • JpegDevice

        public JpegDevice(int width,
                          int height,
                          Resolution resolution)

        Initializes a new instance of the JpegDevice class with provided image dimensions, resolution and maximum quality.

        Parameters:
        width - Image output width.
        height - Image output height.
        resolution - Resolution for the result image file, see Resolution class.
      • JpegDevice

        public JpegDevice(PageSize pageSize,
                          Resolution resolution)

        Initializes a new instance of the JpegDevice class with provided page size, resolution and maximum quality.

        Parameters:
        pageSize - Page size of the output image.
        resolution - Resolution for the result image file, see Resolution class.
      • JpegDevice

        public JpegDevice(int width,
                          int height,
                          Resolution resolution,
                          int quality)

        Initializes a new instance of the JpegDevice class with provided image dimensions, resolution and quality.

        Parameters:
        width - Image output width.
        height - Image output height.
        resolution - Resolution for the result image file, see Resolution class.
        quality - Specifies the level of compression for an image. The range of useful values for the quality is from 0 to 100. The lower the number specified, the higher the compression and therefore the lower the quality of the image. Zero would give you the lowest quality image and 100 the highest.
      • JpegDevice

        public JpegDevice(PageSize pageSize,
                          Resolution resolution,
                          int quality)

        Initializes a new instance of the JpegDevice class with provided page size, resolution and quality.

        Parameters:
        pageSize - Page size of the output image.
        resolution - Resolution for the result image file, see Resolution class.
        quality - Specifies the level of compression for an image. The range of useful values for the quality is from 0 to 100. The lower the number specified, the higher the compression and therefore the lower the quality of the image. Zero would give you the lowest quality image and 100 the highest.
    • Method Detail

      • processInternal

        public void processInternal(Page page,
                                    com.aspose.ms.System.IO.Stream output)

        Converts the page into jpeg and saves it in the output stream.

        Specified by:
        processInternal in class PageDevice
        Parameters:
        page - The page to convert.
        output - Output stream with jpeg image.
      • process

        public void process(Page page,
                            OutputStream output)

        Converts the page into jpeg and saves it in the output stream.

        Overrides:
        process in class PageDevice
        Parameters:
        page - The page to convert.
        output - Output stream with jpeg image.