Documentation

mlreportgen.dom.PDFPageHeader class

Package: mlreportgen.dom

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

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

pdfPageHeaderObj = PDFPageHeader(pageType,templatePath) creates an empty page header for the specified type of page based on the specified template.

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

pdfPageHeaderObj = PDFPageHeader(pageType,templateSrc,docPartTemplateName) creates an empty 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

pageType — Type of pages header appears on[] (default) | default | first | even

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

  • default— Header appears on odd pages in a section and the first page, if there are no page headers defined with pageType set to first.

  • first— Header appears only on the first page of a section.

  • even— Header appears on even pages in a section.

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

templatePath — Full path of header templatestring

Full path of footer template, specified as a string.

docPartTemplateName — Document part template namestring

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

templateSrc — Document or document part that holds the document part templatemlreportgen.dom.Document object | mlreportgen.dom.DocumentPart object

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 a mlreportgen.dom.DocumentPart object for a document part.

Output Arguments

expand all

pdfPageHeaderObj — Page header for PDF documentmlreportgen.dom.PDFPageHeader object

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

Properties

expand all

ChildrenChildren of this objectcell array of objects

This read-only property lists child elements of this object.

CurrentHoleIdID of current hole in documentstring

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

CurrentHoleTypeType of current hole'Inline' | 'Block'

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.

CurrentPageLayoutCurrent page layout of this documentmlreportgen.dom.DOCXPageLayout object | mlreportgen.dom.PDFPageLayout object

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 [].

IdID for document elementstring

A session-unique ID is generated as part of document element creation. You can specify an ID to replace the generated ID.

PageTypeType of pages header appears on[] (default) | default | first | even

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

  • default— Header appears on odd pages in a section and the first page, if there are no page headers defined with pageType set to first.

  • first— Header appears only on the first page of a section.

  • even— Header appears on even pages in a section.

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

ParentParent of document elementDOM object

This read-only property lists the parent of this document element.

TagTag for document elementstring

Tag for document element, specified as a string.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

TemplatePathFull path to template for headerstring

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

Methods

Use PDFPageHeader methods like 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

Was this topic helpful?