Configuration

The Drawing library provides options for specifying the basic parameters of the generated PDF file.

  • paperSize—Can be a paper format (for example, A4), an array of two numbers (for example, the width and height of the paper), or "auto". By default, paperSize is set to "auto" which means that the paper size is just enough to accommodate the drawing.

    The available paper sizes are A0-A10, B0-B10, C0-C10, Executive, Folio, Legal, Letter, Tabloid. If you specify numbers, the units of the specified numbers are treated as typographic points. A typographic point equals 1/72 of an inch. You can also use strings of the 297mm form. The supported units are mm, cm, in, and pt.

  • margin—Indicates the paper margins and has to be an object that contains top, left, right, and bottom numbers. The units of the specified numbers are treated as typographic points. By using strings, you can specify units. When paperSize is set to "auto", the dimensions are adjusted to include the margin.

  • landscape—Accepts Boolean values and defaults to false. If set to true, the paper dimensions rotate to ensure that the width corresponds to the longer side of the output file.

  • multiPage—Accepts Boolean values and defaults to false. If set to true, the support for the multiple-page output is enabled.

  • date—Specifies the date on which the document is created. Defaults to the current date and time (new Date()).

  • (Optional) title, author, subject, keywords, creator—Strings that need to be included in the PDF information dictionary.

In this article

 /