[]
        
(Showing Draft Content)

PdfRunningTitle Class

PdfRunningTitle Class

Represents a running title of the page, like header and footer.

This class is not intended to be instantiated in your code.

Heirarchy

Constructors

constructor

Properties

declarative

Gets or sets an object that provides the ability to setup the running title content declaratively.

document

document: PdfDocument

Gets the document object.

height

height: number

Gets or sets the height of the running title, in points. To hide the running title, set this property to 0. Changing this property has no effect on previous drawings; they will not be resized or clipped.

The default value is 24.

lineGap

lineGap: number

Gets or sets the spacing between each line of text, in points.

The default value is 0.

paths

paths: PdfPaths

Gets an object that provides ability to draw paths.

width

width: number

Gets the width of the area, in points.

x

x: number

Gets or sets the X-coordinate (in points) of the current point in the text flow used to draw a text or an image.

y

y: number

Gets or sets the Y-coordinate (in points) of the current point in the text flow used to draw a text or an image.

Methods

artifact

beginArtifact

beginTagContent

  • Begins marking the content with the given tag and returns the tag content element, an object which represent a reference to the marked content. The tag content element can be incorporated into the document's structure tree by adding to a tag element. Each call of beginTagContent() should be enclosed with endTagContent.

    For example:

    let content = doc.beginTagContent(wijmo.pdf.PdfTagType.P);
    doc.drawText('Hello, world!');
    doc.endTagContent();
    
    let tag = doc.tag(wijmo.pdf.PdfTagType.P);
    tag.add(content);
    doc.addTag(tag);
    

    Note: Marking tag content will automatically end current marking of tag content (and any descendent marking).

    Parameters

    Returns IPdfTagContent

    The IPdfTagContent object that repesents a reference to the marked content.

drawImage

  • Draws an image in JPG or PNG format with the given options.

    If x and y are not defined, then x and y are used instead.

    Finally, if the image was drawn in the text flow, the method updates y. Hence, any subsequent text or image starts below this point.

    Parameters

    • src: string | IPdfImage

      A string containing the URL to get the image from, or the data URI containing a base64 encoded image, or a wijmo.pdf.IPdfImage object returned by the openImage method.

    • Optional x: number

      The x-coordinate of the point to draw the image at, in points.

    • Optional y: number

      The y-coordinate of the point to draw the image at, in points.

    • Optional options: IPdfImageDrawSettings

      Determines the image drawing options.

    Returns PdfPageArea

    The PdfPageArea object.

drawSvg

  • Draws a SVG image with the given options.

    If x and y are not defined, then x and y are used instead.

    The method uses the values of the width and height attributes of the outermost svg element to determine the scale factor according to the options.width and options.height properties. If any of these attributes are omitted then scaling is not performed and the image will be rendered in its original size.

    Finally, if the image was drawn in the text flow, the method updates y. Hence, any subsequent text or image starts below this point. The increment value is defined by the options.height property or by the outermost svg element's height attribute, which comes first. If none of them is provided then y will stay unchanged.

    The method supports a limited set of SVG features and provided primarily for rendering wijmo 5 chart controls.

    Parameters

    • url: string

      A string containing the URL to get the SVG image from or the data URI containing a base64 encoded SVG image.

    • Optional x: number

      The x-coordinate of the point to draw the image at, in points.

    • Optional y: number

      The y-coordinate of the point to draw the image at, in points.

    • Optional options: IPdfSvgDrawSettings

      Determines the SVG image drawing options.

    Returns PdfPageArea

    The PdfPageArea object.

endArtifact

endTagContent

  • Ends the tag content marking.

    For example:

    let content = doc.beginTagContent(wijmo.pdf.PdfTagType.P);
    doc.drawText('Hello, world!');
    doc.endTagContent();
    

    Returns PdfPageArea

    The PdfPageArea object.

lineHeight

  • lineHeight(font?: PdfFont): number
  • Gets the line height with a given font.

    If font is not specified, then font used in the current document is used.

    Parameters

    • Optional font: PdfFont

      Font to get the line height.

    Returns number

    The line height, in points.

measureText

  • Measures a text with the given font and text drawing options without rendering it.

    If font is not specified, then the font used in the current document is used.

    The method uses the same text rendering engine as drawText, so it is tied up in the same way to x and the right page margin, if options.width is not provided. The measurement result doesn't reflect the fact that text can be split into multiple pages or columns; the text is treated as a single block.

    Parameters

    Returns IPdfTextMeasurementInfo

    A IPdfTextMeasurementInfo object determines the measurement information.

moveDown

  • Moves down the y by a given number of lines using the given font or, using the font of current document, if not specified.

    Parameters

    • Optional lines: number

      Number of lines to move down.

    • Optional font: PdfFont

      Font to calculate the line height.

    Returns PdfPageArea

    The PdfPageArea object.

moveUp

  • Moves up the y by a given number of lines using the given font or, using the font of current document, if not specified.

    Parameters

    • Optional lines: number

      Number of lines to move up.

    • Optional font: PdfFont

      Font to calculate the line height.

    Returns PdfPageArea

    The PdfPageArea object.

openImage

  • Opens an image in JPG or PNG format.

    Parameters

    • url: string

      A string containing the URL to get the image from or the data URI containing a base64 encoded image.

    Returns IPdfImage

    The IPdfImage object containing image data.

rotate

  • Rotates the graphic context clockwise by a specified angle.

    Parameters

    • angle: number

      The rotation angle, in degrees.

    • Optional origin: Point

      The Point of rotation, in points. If it is not provided, then the top left corner is used.

    Returns PdfPageArea

scale

  • Scales the graphic context by a specified scaling factor.

    The scaling factor value within the range [0, 1] indicates that the size will be decreased. The scaling factor value greater than 1 indicates that the size will be increased.

    Parameters

    • xFactor: number

      The factor to scale the X dimension.

    • Optional yFactor: number

      The factor to scale the Y dimension. If it is not provided, it is assumed to be equal to xFactor.

    • Optional origin: Point

      The Point to scale around, in points. If it is not provided, then the top left corner is used.

    Returns PdfPageArea

    The PdfPageArea object.

tagContent

  • Marks content with the given tag and returns the tag content element, an object which represent a reference to the marked content. The tag content element can be incorporated into the document's structure tree by adding to a tag element.

    For example:

    let content = doc.tagContent(wijmo.pdf.PdfTagType.P, () => doc.drawText('Hello, world!'));
    
    let tag = doc.tag(wijmo.pdf.PdfTagType.P);
    tag.add(content);
    doc.addTag(tag);
    

    Parameters

    Returns IPdfTagContent

    The IPdfTagContent object that repesents a reference to the marked content.

transform

  • transform(a: number, b: number, c: number, d: number, e: number, f: number): PdfPageArea
  • Transforms the graphic context with given six numbers which represents a 3x3 transformation matrix.

    A transformation matrix is written as follows:

    ab0
    cd0
    ef1

    Parameters

    • a: number

      Value of the first row and first column.

    • b: number

      Value of the first row and second column.

    • c: number

      Value of the second row and first column.

    • d: number

      Value of the second row and second column.

    • e: number

      Value of the third row and first column.

    • f: number

      Value of the third row and second column.

    Returns PdfPageArea

    The PdfPageArea object.

translate

  • Translates the graphic context with a given distance.

    Parameters

    • x: number

      The distance to translate along the X-axis, in points.

    • y: number

      The distance to translate along the Y-axis, in points.

    Returns PdfPageArea

    The PdfPageArea object.