Main Content

mlreportgen.dom.PDFPageLayout class

Package: mlreportgen.dom
Superclasses:

Page format and layout for PDF document section

Description

Use an mlreportgen.dom.PDFPageLayout object to define the page format, headers, and footers of a PDF document section.

Construction

PageLayoutObj = PDFPageLayout() creates an empty document page layout object.

Output Arguments

expand all

Page format and layout for a PDF document section, returned as an mlreportgen.dom.PDFPageLayout object.

Properties

expand all

Children of this document element, specified as an array of DOM objects. This property is read-only.

Custom attributes of this document element, specified as an array of mlreportgen.dom.CustomAttribute objects. The custom attributes must be supported by the output format.

Number of the first page in a section, specified as an integer.

Type of hyphenation, specified as:

  • Boolean for on or off using a hyphen as the hyphenation character

  • A hyphenation character in the form of a character vector, for example, '-' for hyphen or ' ' for space

ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

You can define up to three page footers for a layout, one each for:

  • The first page of the section

  • Even pages

  • Odd pages

You can define up to three page headers for a layout, one each for:

  • The first page of the section

  • Even pages

  • Odd pages

Margin sizes for this layout, specified as an mlreportgen.dom.PageMargins object.

Type of page numbering to use, specified as one of these values.

ValueMeaningApplies To
DOCXPDF
'a'Lowercase alphabetic
'A'Uppercase alphabetic
'i'Lowercase Roman numerals
'I'Uppercase Roman numerals
'n'. 'N', '1', 'decimal'Arabic numerals
'numberInDash'Number with dashes on either side 
'hebrew1'Hebrew numerals 
'hebrew2'Hebrew alphabetic 
'arabicAlpha'Arabic alphabetic 
'arabicAbjad'Arabic abjad numerals 
'thaiLetters'Thai letters 
'thaiNumbers'Thai numerals  
'thaiCounting'Thai counting system 

Size and orientation of pages in this layout, specified as an mlreportgen.dom.PageSize object.

Parent of this document element, specified as a DOM object. This property is read-only.

Option to create a section break for this layout, specified as one of these values:

  • 'Next Page'— Start the section on the next page.

  • 'Odd Page'— Start the section on an odd page.

  • 'Even Page'— Start the section on an even page.

Formats to apply to this layout, specified as an array of format objects. The formats you specify using this property override the same formats defined by the style applied with the StyleName property. Formats that do not apply to a page layout are ignored.

This property does not apply to page layouts.

Tag for this document element, specified as a character vector or string scalar.

The DOM generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specifying your own tag value can help you to identify where an issue occurred during document generation.

Watermark to apply to this section, specified as an mlreportgen.dom.Watermark object.

Examples

collapse all

Create a PDF report using the default template. Open the document and assign the CurrentPageLayout property to a variable. Change the left and right margins for this layout.

import mlreportgen.dom.*;
d = Document('mydoc','pdf');

open(d);
s = d.CurrentPageLayout;
s.PageMargins.Left = '2in';
s.PageMargins.Right = '2in';
p = Paragraph('Hello World');
append(d,p);

close(d);
rptview(d.OutputPath);
Introduced in R2016a