[]
Initializes a new instance of the PdfDocument class.
An optional object containing initialization settings.
Gets a value that indicates whether the pages buffering mode is enabled which means that the document's pages can be iterated over using pageIndex and bufferedPageRange.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor. This property can be set to false only if both header and footer are invisible.
The default value is true.
Gets a value that indicates whether the document compression is enabled.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor.
The default value is true.
Gets an object that represents the current page settings (read-only).
Gets a value that specifies whether the window's title bar should display the document title taken from IPdfDocumentInfo.title. If false, the name of the PDF file should be displayed.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor.
The default value is false.
Gets the document object.
Gets an object that represents a footer, the page area positioned right above the bottom margin.
Gets an object that represents a header, the page area positioned right below the top margin.
Gets the height of the area, in points.
Gets or sets the document information, such as author name, document's creation date and so on.
Gets a value that represents the default natural language of the document.
The language code is a 2-character ISO 639 language code (e.g. "en" for English or "ja" for Japanese) followed by an optional 2-character ISO 3166 country code (e.g. "US" for the United States or "JP" for Japan). For example: "en", "en-US", "ja-JP".
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor.
The default value is undefined which means that the document does not have the default natural language.
Gets or sets the spacing between each line of text, in points.
The default value is 0.
Gets the PDF owner password.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor.
Gets or sets the index of the current page within the buffered pages range.
Use the bufferedPageRange method to get the range of buffered pages.
Gets an object that represents the default page settings for the pages added automatically and for the addPage method.
Gets an object that provides ability to draw paths.
Gets an object that represents PDF file permissions.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor. Changing the property after creating PdfDocument will not have any effect.
Gets a value that indicates that the document conforms to Tagged PDF conventions. For a document to be recognized as a Tagged PDF document this value must be true.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor.
Note: tagged PDF requires document version 1.4 or higher.
The default value is false.
Gets the PDF user password.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor.
Gets PDF file version.
This property can be assigned using the IPdfDocumentOptions object passed to the PdfDocument constructor.
The default version is PdfVersion.v1_3.
Gets the width of the area, in points.
Gets or sets the X-coordinate (in points) of the current point in the text flow used to draw a text or an image.
Gets or sets the Y-coordinate (in points) of the current point in the text flow used to draw a text or an image.
Adds a new page with the given settings.
If the settings parameter is omitted, then pageSettings will be used instead.
Page settings.
The PdfDocument object.
Adds the tag element to the document’s structure tree.
Theelement to add to the document’s structure tree.
The PdfDocument object.
Marks content as an artifact.
For example:
doc.artifact(() => doc.drawText('Artifact'));
A callback function that will be automatically executed within a beginArtifact/endArtifact block.
Artifact options.
The IPdfTagContent object that repesents a reference to the marked content.
Begins marking content as an PDF artifact. Each call of beginArtifact() should be enclosed with endArtifact.
For example:
doc.beginArtifact(); doc.drawText('Artifact'); doc.endArtifact();
Artifact options.
The PdfPageArea object.
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).
The marking tag.
Tag content options.
The IPdfTagContent object that repesents a reference to the marked content.
Gets the range of buffered pages.
A IPdfBufferedPageRange object that represents the range of buffered pages.
Disposes the document.
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.
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.
The x-coordinate of the point to draw the image at, in points.
The y-coordinate of the point to draw the image at, in points.
Determines the image drawing options.
The PdfPageArea object.
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.
A string containing the URL to get the SVG image from or the data URI containing a base64 encoded SVG image.
The x-coordinate of the point to draw the image at, in points.
The y-coordinate of the point to draw the image at, in points.
Determines the SVG image drawing options.
The PdfPageArea object.
Draws a string with the given options and returns the measurement information.
If options.pen, options.brush or options.font are omitted, the current document's pen, brush or font are used (see PdfDocument.setPen, PdfDocument.setBrush, and PdfDocument.setFont).
The string is drawn within the rectangular area for which top-left corner, width and height are defined by the x, y, options.width and options.height values. If x and y are not provided, the PdfDocument.x and PdfDocument.y properties are used instead.
The text is wrapped and clipped automatically within the area. If options.height is not provided and the text exceeds the bottom body edge, then a new page will be added to accommodate the text.
Finally, the method updates the value of the PdfDocument.x and PdfDocument.y properties. Hence, any subsequent text or image starts below this point (depending on the value of options.continued).
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.
The text to draw.
The X-coordinate of the point to draw the text at, in points.
The Y-coordinate of the point to draw the text at, in points.
Determines the text drawing options.
A IPdfTextMeasurementInfo object determines the measurement information.
Finishes the document rendering.
Ends marking content as an PDF artifact.
For example:
doc.beginArtifact(); doc.drawText('Artifact'); doc.endArtifact();
The PdfPageArea object.
Ends the tag content marking.
For example:
let content = doc.beginTagContent(wijmo.pdf.PdfTagType.P); doc.drawText('Hello, world!'); doc.endTagContent();
The PdfPageArea object.
Gets the line height with a given font.
If font is not specified, then font used in the current document is used.
Font to get the line height.
The line height, in points.
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.
Text to measure.
Font to be applied on the text.
Determines the text drawing options.
A IPdfTextMeasurementInfo object determines the measurement information.
Moves down the y by a given number of lines using the given font or, using the font of current document, if not specified.
Number of lines to move down.
Font to calculate the line height.
The PdfPageArea object.
Moves up the y by a given number of lines using the given font or, using the font of current document, if not specified.
Number of lines to move up.
Font to calculate the line height.
The PdfPageArea object.
Raises the end event.
A PdfDocumentEndedEventArgs object that contains the event data.
Registers a font from a source and associates it with a given font family name and font attributes.
The font to register.
The PdfDocument object.
Registers a font from a URL asynchronously and associates it with a given font family name and font attributes.
The callback function takes a IPdfFontFile object as a parameter.
The font to register.
A callback function which will be called, when the font has been registered.
Restores the state from the stack and applies it to the graphic context.
The PdfDocument object.
Rotates the graphic context clockwise by a specified angle.
The rotation angle, in degrees.
The Point of rotation, in points. If it is not provided, then the top left corner is used.
Saves the state of the graphic context (including current pen, brush and transformation state) and pushes it onto stack.
The PdfDocument object.
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.
The factor to scale the X dimension.
The factor to scale the Y dimension. If it is not provided, it is assumed to be equal to xFactor.
The Point to scale around, in points. If it is not provided, then the top left corner is used.
The PdfPageArea object.
Sets the default document brush. This brush will be used by the PdfPaths.fill, PdfPaths.fillAndStroke and drawText methods, if no specific brush is provided.
The brush argument can accept the following values:
The PdfDocument object.
Sets the document font.
If exact font with given style and weight properties is not found then,
The font object to set.
The PdfDocument object.
Sets the default document pen. This pen will be used by the PdfPaths.stroke, PdfPaths.fillAndStroke and drawText methods, if no specific pen is provided.
The pen argument can accept the following values:
The PdfDocument object.
Creates a tag element that represents an item in the document's structure tree.
For example:
// Mark some text as a paragraph. let content = doc.beginTagContent(wijmo.pdf.PdfTagType.P); doc.drawText('Hello, world!'); doc.endTagContent(); // Create the tag element and add content to it. let tag = doc.tag(wijmo.pdf.PdfTagType.P); tag.add(content); // Add the tag element to the document's structure tree. doc.addTag(tag);
The same, using a callback function:
doc.addTag(doc.tag(wijmo.pdf.PdfTagType.P, () => doc.drawText('Hello, world! ')));
The type of a tag element.
An optional child element or array of child elements.
An optional IPdfTagOptions object used to configure the element.
The following child types are supported:
The IPdfTag tag element.
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);
The marking tag.
A callback function that will be automatically executed within a beginTagContent/endTagContent block.
Tag content options.
The IPdfTagContent object that repesents a reference to the marked content.
Transforms the graphic context with given six numbers which represents a 3x3 transformation matrix.
A transformation matrix is written as follows:
a | b | 0 |
c | d | 0 |
e | f | 1 |
Value of the first row and first column.
Value of the first row and second column.
Value of the second row and first column.
Value of the second row and second column.
Value of the third row and first column.
Value of the third row and second column.
The PdfPageArea object.
Translates the graphic context with a given distance.
The distance to translate along the X-axis, in points.
The distance to translate along the Y-axis, in points.
The PdfPageArea object.
Occurs when the document has been rendered.
Occurs when a new page is added to the document.
Represents a PDF document object, based on PDFKit JavaScript library.