mlreportgen.dom.PDFPageHeader class

Package: mlreportgen.dom
Superclasses:

Page header definition for PDF document

Description

Add a header to the first page of a section or to odd pages, even pages, or both.

Construction

pdfHeader = PDFPageHeader() creates an empty page header based on the default PDF template.

pdfHeaderer = PDFPageHeader(pageType) creates a page header for the specified type of page, that is, odd, even, or first, based on the default PDF template.

PageHeader = PDFPageHeader(pageType,templatePath) creates a page header for the specified type of page based on the specified template.

pdfHeader = PDFPageHeader(pageType,templatePath,docPartTemplateName) creates a page header for the specified type of page, based on the specified document part template in the specified template.

pdfHeader = PDFPageHeader(pageType,templateSrc,docPartTemplateName) creates a page header for the specified type of page, based on the specified document part template used by the specified source. The source can be a document or a document part.

Input Arguments

expand all

Type of page header appears on, specified as one of these values:

  • default — Header for odd pages of the section, even pages if you do not specify an even-page header, and first page if you do not specify a first-page header.

  • first — Header for first page of a section.

  • even — Header for even pages in a section.

For example, to have a blank header appear on the first page of a section and a different header appear on the other pages, define two headers, one with pageType set to first and the other with pageType set to default.

Full path of footer template, specified as a character vector.

Name of this part’s template if it is stored in a template specified by the templatePath or templateSrc argument, specified as a character vector.

Document or document part object whose template contains the template for this document part, specified as an mlreportgen.dom.Document object for a document or an mlreportgen.dom.DocumentPart object for a document part.

Output Arguments

expand all

Page header for a PDF document, returned as an mlreportgen.dom.PDFPageHeader object.

Properties

expand all

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

This read-only property is the hole ID of the current hole in this document.

Type of the current template hole, specified as 'Inline' or 'Block'.

  • An inline hole is for document elements that a paragraph element can contain: Text, Image, LinkTarget, ExternalLink, InternalLink, CharEntity, AutoNumber.

  • A block hole can contain a Paragraph, Table, OrderedList, UnorderedList, DocumentPart, or Group.

This property applies to Word and PDF documents. For Word documents, the value is a DOCXPageLayout object that specifies the current page layout. For PDF documents, the value is a PDFPageLayout object if the document currently specifies a page layout. For HTML documents, the value is always [].

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.

Type of page header appears on, specified as one of these values:

  • default — Header for odd pages of the section, even pages if you do not specify an even-page header, and first page if you do not specify a first-page header.

  • first — Header for first page of a section.

  • even — Header for even pages in a section.

For example, to have a blank header appear on the first page and a different header appear on the other pages, define two headers, one with pageType set to first and the other with pageType set to default.

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

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.

Full path to template to use for this header, specified as a character vector.

Methods

Use PDFPageHeader methods as you use the corresponding Document methods.

Method

Purpose

append

Append one of these DOM objects to the header:

  • CustomElement

  • PDFPageLayout

  • FormalTable

  • Group

  • ExternalLink

  • Image

  • InternalLink

  • OrderedList

  • Paragraph

  • RawText

  • Table

  • Text

  • UnorderedList

close

Close header.

fill

Fill template hole.

moveToNextHole

Move to next template hole.

open

Open header.

Introduced in R2016a