com.aspose.tex.rendering

Class PdfDevice

    • Constructor Detail

      • PdfDevice

        public PdfDevice()

        Creates new instance. The output file will be written to the output working directory taking the job name as a file name.

      • PdfDevice

        public PdfDevice(OutputStream stream)

        Creates new instance. The output file will be written to specified stream.

        Parameters:
        stream - The stream to write the output file to.
      • PdfDevice

        protected PdfDevice(PdfDevice device)

        Clone constructor. Initializes this device with another device.

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

      • init

        public void init()

        Initializes device.

        Specified by:
        init in class Device
      • getPageCount

        public int getPageCount()

        Gets the number of pages.

        Specified by:
        getPageCount in class Device
        Returns:
        The number of pages.
      • isReady

        public boolean isReady()

        Shows if device is ready for output.

        Specified by:
        isReady in class Device
        Returns:
        True if device is ready to receive output. Otherwise, False.
      • getDestinationName

        public String getDestinationName()

        Gets destination name: output file name or device description.

        Specified by:
        getDestinationName in class Device
        Returns:
        Destination name: output file name or device description.
      • create

        public Device create()

        Creates a copy of this device.

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

        public void dispose()

        Disposes the device.

        Overrides:
        dispose in class Device
      • startDocument

        public void startDocument()

        Starts the whole document.

        Specified by:
        startDocument in class Device
      • endDocument

        public void endDocument()

        Finalizes the whole document.

        Specified by:
        endDocument in class Device
      • startPage

        public void startPage(float width,
                              float height)

        Starts a new page.

        Specified by:
        startPage in class Device
        Parameters:
        width - The page width.
        height - The page height.
      • endPage

        public void endPage()

        Finalizes a page.

        Specified by:
        endPage in class Device
      • addHyperlink

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

        Sets the hyperlink with a URI as its target.

        Specified by:
        addHyperlink in class Device
        Parameters:
        activeRect - The active rectangle of the link.
        border - The link border.
        targetUri - The target URI.
      • addBookmark

        public void addBookmark(String name,
                                Point2D position)

        Adds the bookmark identified by the name.

        Specified by:
        addBookmark in interface IInteractiveDevice
        Parameters:
        name - The bookmark name.
        position - The bookmark position.
      • setTransform

        public void setTransform(AffineTransform matrix)

        Sets the current coordinate space transformation.

        Specified by:
        setTransform in class Device
        Parameters:
        matrix - The transformation matrix.
      • setClip

        public void setClip(Shape path)

        Sets the current clip path.

        Specified by:
        setClip in class Device
        Parameters:
        path - The clip path.
      • setStroke

        public void setStroke(ColoredStroke value)

        Sets the current stroke.

        Overrides:
        setStroke in class Device
        Parameters:
        value - The new current stroke.
      • getFill

        public Color getFill()

        Gets the current fill color.

        Overrides:
        getFill in class Device
        Returns:
        The current fill color.
      • setFill

        public void setFill(Color value)

        Sets the current fill color.

        Overrides:
        setFill in class Device
        Parameters:
        value - The new current fill color.
      • getStrokeOpacity

        public float getStrokeOpacity()

        Gets the current stroke opacity.

        Overrides:
        getStrokeOpacity in class Device
        Returns:
        The current stroke opacity.
      • setStrokeOpacity

        public void setStrokeOpacity(float value)

        Sets the current stroke opacity.

        Overrides:
        setStrokeOpacity in class Device
        Parameters:
        value - The current stroke opacity.
      • getFillOpacity

        public float getFillOpacity()

        Gets the current fill opacity.

        Overrides:
        getFillOpacity in class Device
        Returns:
        The current fill opacity.
      • setFillOpacity

        public void setFillOpacity(float value)

        Sets the current fill opacity.

        Overrides:
        setFillOpacity in class Device
        Parameters:
        value - The current fill opacity.
      • drawString

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

        Draws a text string.

        Specified by:
        drawString in class Device
        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 void drawPath(Shape path)

        Draws a path.

        Specified by:
        drawPath in class Device
        Parameters:
        path - A path to draw.
      • fillPath

        public void fillPath(Shape path)

        Fills a path.

        Specified by:
        fillPath in class Device
        Parameters:
        path - A path to fill.
      • showImage

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

        Shows a raster image.

        Specified by:
        showImage in class Device
        Parameters:
        origin - The bottom-left corner of the shown image.
        size - The size of the shown image.
        imageData - The image data.