com.aspose.eps.device

Class PdfDevice

    • Field Detail

      • VERSION

        public static final String VERSION

        "Version" property key.

      • 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" property key.

      • EMBED_FONTS_AS

        public static final String EMBED_FONTS_AS

        "What font type is used for embedding" property key.

      • COMPRESS

        public static final String COMPRESS

        "Compress" property key.

      • WRITE_IMAGES_AS

        public static final String WRITE_IMAGES_AS

        "Format of images" property key.

      • AUTHOR

        public static final String AUTHOR

        "Author" property key.

      • TITLE

        public static final String TITLE

        "Title" property key.

      • SUBJECT

        public static final String SUBJECT

        "Subject" property key.

      • KEYWORDS

        public static final String KEYWORDS

        "Keywords" property key.

      • 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

      • PdfDevice

        public PdfDevice(OutputStream ros)

        Initializes new instance of PdfDevice with an output stream.

        Parameters:
        ros - An output stream.
      • PdfDevice

        public PdfDevice(OutputStream ros,
                         Dimension size)

        Initializes new instance of PdfDevice with an output stream.

        Parameters:
        ros - An output stream.
        size - Page size.
    • Method Detail

      • getProperties

        public UserProperties getProperties()

        Gets device properties including metadata.

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

        public void setProperties(Properties props)

        Specifies device properties including metadata.

        Parameters:
        props - Device properties.
      • renew

        public void renew()

        Reset device to initial state for whole document. Used for reseting output stream.

        Overrides:
        renew in class Device
      • 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 graphics context. If on creation restoreOnDispose was true, writeGraphicsRestore() will be called.

        Overrides:
        dispose in class Device
      • reset

        public void reset()

        If page device parameters will be set this method allows to return writing stream back the begining of 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:
        The number of current page.
      • updatePageParameters

        public void updatePageParameters(IMultiPageDevice device)

        Updates page parameters from other multi-paged device.

        Specified by:
        updatePageParameters in interface IMultiPageDevice
        Parameters:
        device - Another instance of the same device.
      • 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 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 the current transform. Since most output formats do not implement this functionality, the inverse transform of the currentTransform is calculated and multiplied by the transform to be set. The result is then forwarded by a call to writeTransform(Transform).

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

        public void transform(AffineTransform transform)

        Transforms the current transform. 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.
      • setPaint

        public void setPaint(Paint paint)

        Specifies current paint.

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

        public void clipRect(float x,
                             float y,
                             float width,
                             float height)

        Clips rectangle. Calls clip(Rectangle2D).

        Parameters:
        x - The x-coordinate.
        y - The y-coordinate.
        width - The rectangle width.
        height - The rectangle height.
      • 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.
      • clip

        public void clip(Shape s)

        Clips using given shape. Dispatches to writeClip(Rectangle), writeClip(Rectangle2D) or writeClip(Shape).

        Parameters:
        s - Shape used for clipping.
      • setFont

        public void setFont(ITrFont font)

        Specifies current font.

        Overrides:
        setFont in class Device
        Parameters:
        font - A font.
      • 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.