com.aspose.eps.device

Class ImageDevice

    • Field Detail

      • TRANSPARENT

        public static final String TRANSPARENT

        "Transparent" property key.

      • BACKGROUND

        public static final String BACKGROUND

        "Background" property key.

      • BACKGROUND_COLOR

        public static final String BACKGROUND_COLOR

        "Background color" property key.

      • PAGE_SIZE

        public static final String PAGE_SIZE

        "Page size" property key.

      • PAGE_MARGINS

        public static final String PAGE_MARGINS

        "Page margins" property key.

      • ORIENTATION

        public static final String ORIENTATION

        "Orientation" property key.

      • FIT_TO_PAGE

        public static final String FIT_TO_PAGE

        "Fit content to page" property key.

      • EMBED_FONTS

        public static final String EMBED_FONTS

        "Embed font in document.

      • EMIT_WARNINGS

        public static final String EMIT_WARNINGS

        "Emit warnings" property key.

      • EMIT_ERRORS

        public static final String EMIT_ERRORS

        "Emit errors" property key.

    • Constructor Detail

      • ImageDevice

        public ImageDevice()

        Initializes new instance of ImageDevice.

      • ImageDevice

        public ImageDevice(Dimension size)

        Initializes new instance of ImageDevice with specified size of a page.

        Parameters:
        size - Page size.
      • ImageDevice

        public ImageDevice(Dimension size,
                           ImageFormat imageFormat)

        Initializes new instance of ImageDevice with specified size of a page and image format.

        Parameters:
        size - Page size.
        imageFormat - Format of the image.
    • Method Detail

      • getFormat

        public ImageFormat getFormat()

        Gets image format.

        Returns:
        An image format.
      • renew

        public void renew()

        Reset device to initial state for whole document.

        Overrides:
        renew in class Device
      • setSaveOptions

        public void setSaveOptions(SaveOptions options)

        Specifies options for managing rendering process.

        Overrides:
        setSaveOptions in class Device
        Parameters:
        options - Rendering options.
      • setProperties

        public void setProperties(UserProperties props)

        Specifies device properties.

        Overrides:
        setProperties in class Device
        Parameters:
        props - Device properties.
      • getProperties

        public UserProperties getProperties()

        Gets device properties including metadata.

        Overrides:
        getProperties in class Device
        Returns:
        Device properties.
      • getProperty

        public String getProperty(String key)

        Gets a value of string property.

        Overrides:
        getProperty in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • getPropertyColor

        public Color getPropertyColor(String key)

        Gets a value of color property.

        Overrides:
        getPropertyColor in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • getPropertyRectangle

        public Rectangle getPropertyRectangle(String key)

        Gets a value of rectangle property.

        Overrides:
        getPropertyRectangle in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • getPropertyMargins

        public Insets getPropertyMargins(String key)

        Gets a value of margins property.

        Overrides:
        getPropertyMargins in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • getPropertySize

        public Dimension getPropertySize(String key)

        Gets a value of size property.

        Overrides:
        getPropertySize in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • getPropertyInt

        public int getPropertyInt(String key)

        Gets a value of integer property.

        Overrides:
        getPropertyInt in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • getPropertyDouble

        public double getPropertyDouble(String key)

        Gets a value of double property.

        Overrides:
        getPropertyDouble in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • isProperty

        public boolean isProperty(String key)

        Gets a value of boolean property.

        Overrides:
        isProperty in class Device
        Parameters:
        key - The name of property.
        Returns:
        The property value.
      • getCreator

        public String getCreator()

        Gets creator of resulting device output.

        Overrides:
        getCreator in class Device
        Returns:
        The creator.
      • setCreator

        public void setCreator(String creator)

        Specifies creator of resulting device output.

        Overrides:
        setCreator in class Device
        Parameters:
        creator - The creator.
      • getSize

        public Dimension getSize()

        Gets a size of the page.

        Overrides:
        getSize in class Device
        Returns:
        Size of the page.
      • setSize

        public void setSize(Dimension size)

        Specifies a size of the page.

        Overrides:
        setSize in class Device
        Parameters:
        size - Size of the page.
      • getBackground

        public Color getBackground()

        Gets current background of the page.

        Overrides:
        getBackground in class Device
        Returns:
        Current background.
      • setBackground

        public void setBackground(Color bkgrd)

        Specifies current background of the page.

        Overrides:
        setBackground in class Device
        Parameters:
        bkgrd - A background.
      • getOpacity

        public float getOpacity()

        Gets current opacity.

        Overrides:
        getOpacity in class Device
        Returns:
        Current opacity.
      • setOpacity

        public void setOpacity(float opacity)

        Specifies current opacity.

        Overrides:
        setOpacity in class Device
        Parameters:
        opacity - An opacity.
      • getStroke

        public Stroke getStroke()

        Gets current stroke.

        Overrides:
        getStroke in class Device
        Returns:
        Current stroke.
      • setStroke

        public void setStroke(Stroke stroke)

        Specifies current stroke.

        Overrides:
        setStroke in class Device
        Parameters:
        stroke - A stroke.
      • getPaint

        public Paint getPaint()

        Gets current paint.

        Overrides:
        getPaint in class Device
        Returns:
        Current paint.
      • setPaint

        public void setPaint(Paint paint)

        Specifies current paint.

        Overrides:
        setPaint in class Device
        Parameters:
        paint - A paint.
      • getFont

        public ITrFont getFont()

        Gets current font.

        Overrides:
        getFont in class Device
        Returns:
        Current font.
      • setFont

        public void setFont(ITrFont font)

        Specifies current font.

        Overrides:
        setFont in class Device
        Parameters:
        font - A font.
      • getCharTM

        public AffineTransform getCharTM()

        Gets current characters transform.

        Overrides:
        getCharTM in class Device
        Returns:
        Current characters transform.
      • setCharTM

        public void setCharTM(AffineTransform charTM)

        Specifies current characters transform.

        Overrides:
        setCharTM in class Device
        Parameters:
        charTM - Characters transform.
      • getTextStrokeWidth

        public float getTextStrokeWidth()

        Gets current text stroke width.

        Overrides:
        getTextStrokeWidth in class Device
        Returns:
        Current text stroke width.
      • setTextStrokeWidth

        public void setTextStrokeWidth(float tsw)

        Specifies current text stroke width.

        Overrides:
        setTextStrokeWidth in class Device
        Parameters:
        tsw - Text stroke width.
      • startDocument

        public void startDocument()

        Makes necessary preparation of device before start rendering of document.

        Overrides:
        startDocument in class Device
      • endDocument

        public void endDocument()

        Makes necessary preparation of device after the document has been rendered.

        Overrides:
        endDocument in class Device
      • dispose

        public void dispose()

        Disposes the device.

        Overrides:
        dispose in class Device
      • isDirectRGB

        public boolean isDirectRGB()

        Indicates whether device uses direct RGB mode, that is RGB.

        Overrides:
        isDirectRGB in class Device
        Returns:
        True if direct RGB mode and false otherwise, that is BGR.
      • reset

        public void reset()

        Reset the device to initial state for a page.

        Overrides:
        reset in class Device
      • openPage

        public boolean openPage(String title)

        Makes necessary preparation of the device before page rendering.

        Specified by:
        openPage in interface IMultiPageDevice
        Parameters:
        title - The page title.
        Returns:
        Always true.
      • openPage

        public boolean openPage(float width,
                                float height)

        Makes necessary preparation of the device before page rendering.

        Specified by:
        openPage in interface IMultiPageDevice
        Parameters:
        width - A width of the page.
        height - A height of the page.
        Returns:
        Always true.
      • closePage

        public void closePage()

        Makes necessary preparation of the device after page has been rendered.

        Specified by:
        closePage in interface IMultiPageDevice
      • getCurrentPageNumber

        public int getCurrentPageNumber()

        Gets current page number.

        Specified by:
        getCurrentPageNumber in interface IMultiPageDevice
        Returns:
        Current page number.
      • create

        public Device create()

        Creates a copy of this device.

        Overrides:
        create in class Device
        Returns:
        Copy of this device.
      • initClip

        public void initClip()

        Initializes a clip of the device

        Overrides:
        initClip in class Device
      • draw

        public void draw(Shape s)

        Draws a path.

        Overrides:
        draw in class Device
        Parameters:
        s - A path to be drawn.
      • fill

        public void fill(Shape s)

        Fills a path.

        Overrides:
        fill in class Device
        Parameters:
        s - A path to be filled.
      • drawImage

        public void drawImage(BufferedImage image,
                              AffineTransform transform,
                              Color bkg)

        Draws an image with assigned transform and background.

        Overrides:
        drawImage in class Device
        Parameters:
        image - An image to be drawn.
        transform - A transform.
        bkg - A background color.
      • drawString

        public void drawString(String str,
                               float x,
                               float y)

        Draws a string at given point.

        Overrides:
        drawString in class Device
        Parameters:
        str - A string to be drawn.
        x - X coordinate of point.
        y - Y coordinate of point.
      • setTransform

        public void setTransform(AffineTransform transform)

        Specifies current transform.

        Overrides:
        setTransform in class Device
        Parameters:
        transform - A transform.
      • transform

        public void transform(AffineTransform transform)

        Transforms the current transformation matrix. Calls writeTransform(Transform).

        Overrides:
        transform in class Device
        Parameters:
        transform - Transform to be applied.
      • translate

        public void translate(double x,
                              double y)

        Translates the current transformation matrix. Calls writeTransform(Transform).

        Overrides:
        translate in class Device
        Parameters:
        x - Translation in X axis.
        y - Translation in Y axis.
      • rotate

        public void rotate(double theta)

        Rotate the current transform over the Z-axis. Calls writeTransform(Transform). Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.

        Overrides:
        rotate in class Device
        Parameters:
        theta - radians over which to rotate
      • scale

        public void scale(double sx,
                          double sy)

        Scales the current transformation matrix. Calls writeTransform(Transform).

        Overrides:
        scale in class Device
        Parameters:
        sx - A scale in X axis.
        sy - A scale in Y axis.
      • shear

        public void shear(double shx,
                          double shy)

        Shears the current transformation matrix. Calls writeTransform(Transform).

        Overrides:
        shear in class Device
        Parameters:
        shx - A shear in X axis.
        shy - A shear in Y axis.
      • setClip

        public void setClip(Shape path)

        Specifies clip shape.

        Overrides:
        setClip in class Device
        Parameters:
        path - Path that is used for clipping.
      • writeComment

        public void writeComment(String comment)

        Writes a comment.

        Overrides:
        writeComment in class Device
        Parameters:
        comment - A comment to be written.
      • toString

        public String toString()

        Returns the name of device type.

        Overrides:
        toString in class Device
        Returns:
        Type name.
      • writeString

        public void writeString(ITrFont font,
                                String str)

        Writes out string with specified font.

        Overrides:
        writeString in class Device
        Parameters:
        font - Specified font.
        str - The string.
      • getImagesBytes

        public byte[][] getImagesBytes()

        Gets resulting images in bytes.

        Returns:
        Images bytes. One byte array for one page.