com.aspose.tex.rendering

Class Device

  • Direct Known Subclasses:
    ImageDevice, PdfDevice, SvgDevice, XpsDevice


    public abstract class Device
    extends Object

    Implements the interface for outputting text and graphic content to abstract device. Rendering is performed page by page.

    • Constructor Detail

      • Device

        public Device()

        Creates a new instance.

      • Device

        protected Device(Device device)

        Clone constructor. Initializes this device with another device.

        Parameters:
        device - The device to clone.
    • Method Detail

      • init

        public abstract void init()

        Initializes device.

      • getPageCount

        public abstract int getPageCount()

        Gets the number of pages.

        Returns:
        The number of pages.
      • isReady

        public abstract boolean isReady()

        Shows if device is ready for output.

        Returns:
        True if device is ready to receive output. Otherwise, False.
      • getDestinationName

        public abstract String getDestinationName()

        Gets destination name: output file name or device description.

        Returns:
        Destination name: output file name or device description.
      • create

        public Device create()

        Creates a copy of this device.

        Returns:
        Copy of this device.
      • dispose

        public void dispose()

        Disposes the device.

      • startDocument

        public abstract void startDocument()

        Starts the whole document.

      • endDocument

        public abstract void endDocument()

        Finalizes the whole document.

      • startPage

        public abstract void startPage(float width,
                                       float height)

        Starts a new page.

        Parameters:
        width - The page width.
        height - The page height.
      • endPage

        public abstract void endPage()

        Finalizes a page.

      • addHyperlink

        public abstract void addHyperlink(Rectangle2D activeRect,
                                          ColoredStroke border,
                                          String targetUri)

        Sets the hyperlink with a URI as its target.

        Parameters:
        activeRect - The active rectangle of the link.
        border - The link border.
        targetUri - The target URI.
      • setTransform

        public abstract void setTransform(AffineTransform matrix)

        Sets the current coordinate space transformation.

        Parameters:
        matrix - The transformation matrix.
      • setClip

        public abstract void setClip(Shape path)

        Sets the current clip path.

        Parameters:
        path - The clip path.
      • getStroke

        public ColoredStroke getStroke()

        Gets the current stroke.

        Returns:
        The current stroke.
      • setStroke

        public void setStroke(ColoredStroke value)

        Sets the current stroke.

        Parameters:
        value - The new current stroke.
      • getFill

        public Color getFill()

        Gets the current fill color.

        Returns:
        The current fill color.
      • setFill

        public void setFill(Color value)

        Sets the current fill color.

        Parameters:
        value - The new current fill color.
      • getStrokeOpacity

        public float getStrokeOpacity()

        Gets the current stroke opacity.

        Returns:
        The current stroke opacity.
      • setStrokeOpacity

        public void setStrokeOpacity(float value)

        Sets the current stroke opacity.

        Parameters:
        value - The current stroke opacity.
      • getFillOpacity

        public float getFillOpacity()

        Gets the current fill opacity.

        Returns:
        The current fill opacity.
      • setFillOpacity

        public void setFillOpacity(float value)

        Sets the current fill opacity.

        Parameters:
        value - The current fill opacity.
      • saveGraphicsState

        protected void saveGraphicsState()

        Saves the current graphics state.

      • restoreGraphicsState

        protected void restoreGraphicsState()

        Rolls back to the graphics state previously saved.

      • drawString

        public abstract void drawString(String str,
                                        float originX,
                                        float originY,
                                        List<GlyphData> charInfos)

        Draws a text string.

        Parameters:
        str - The string.
        originX - The x coordinate of the origin.
        originY - The x coordinate of the origin.
        charInfos - Glyph data required for precise typesetting of a text string.
      • drawPath

        public abstract void drawPath(Shape path)

        Draws a path.

        Parameters:
        path - A path to draw.
      • fillPath

        public abstract void fillPath(Shape path)

        Fills a path.

        Parameters:
        path - A path to fill.
      • showImage

        public abstract void showImage(Point2D origin,
                                       Dimension2D size,
                                       byte[] imageData)

        Shows a raster image.

        Parameters:
        origin - The bottom-left corner of the shown image.
        size - The size of the shown image.
        imageData - The image data.