Class OutputProfiler.RasterizingAction

    • Constructor Detail

      • RasterizingAction

        public RasterizingAction()
    • Method Detail

      • getDPI

        public float getDPI()
        Get the preferred resolution for any images generated by this class, as set by setDPI(float). The default is 200
        Returns:
        the dpi
      • setDPI

        public void setDPI​(float dpi)
        Set the preferred resolution for any images generated by this class.
        Parameters:
        dpi - the dots per inch. Any value greater than one, typically between 150-300.
      • setMaxPixels

        public void setMaxPixels​(long max)
        Set the maximum number of pixels for any image generated by this class. If the number of pixels at the chosen DPI would be greater than this value, the resolution will be reduced. This is safety check to ensure rendering pages with a very large physical size (eg A0) does not cause out-of-memory.
        Parameters:
        max - the maximum number of pixels. Usually a very large number, we'll accept anything above 16384
      • setCompressionOptions

        public void setCompressionOptions​(String options)
        Set the options to be used for image compression. This is intentionally vague, but at this point the valid parameters are the same that can be passed into the PDFImage(Image,String) constructor.
        Since:
        2.26.2
      • getMaxPixels

        public long getMaxPixels()
        Return the maximum number of pixels for images generated by this class, as set by setMaxPixels(long). The default is 9287256, which is the equivalent of an A4 page rendered at 310dpi.
        Returns:
        the maximum number of pixels
      • setColorModel

        public void setColorModel​(ColorModel colorModel)
        Set the ColorModel for rasterizing. The default is ColorModel.getRGBdefault() and this is usually the best option. If the page to be rasterized contains no color content, it will be automatically converted to an 8-bit grayscale model if the model passed into this method is not already grayscale.
        Parameters:
        colorModel - the color modell
      • rasterize

        public void rasterize​(OutputProfiler profiler,
                              PDFPage page,
                              OutputProfile pageProfile,
                              ProfileComplianceException ei)
        Rasterize the page, converting its content to a bitmap
        Parameters:
        profiler - the profiler that is running this operation
        page - the page
        pageProfile - the profile which should be populated by any features on the resulting page
        ei - the exception that triggered the need to rasterize. May be null.