margins([top], [right], [bottom], [left], [pageNumber])

Sets the margins of a given page. If 1 value is given, all 4 sides are set equally. If 4 values are given, the current page will be adjusted. Optionally a page number or name can be given to set the margins of a specific page. Calling the function without any values will return the margins for the current page.

Type: function

Parameter(s):

  • top {Number} Optional:

    Top margin or all if only one.

  • right {Number} Optional:

    Right margin.

  • bottom {Number} Optional:

    Bottom margin.

  • left {Number} Optional:

    Left margin.

  • pageNumber {Number} Optional:

    Page number, page name or page object of the page with margins to set; current page if left blank.

Returns:

  • {Object}:

    Current page margins with the properties: top, right, bottom, left.