Main Content

mlreportgen.dom.FOProperty Class

Namespace: mlreportgen.dom

FO property for PDF output

Description

Creates an object that specifies an XML Style Sheet Language (XSL) Formatting Object (FO) property. The DOM API uses FO objects to format PDF output. Use this object with mlreportgen.FOProperties to apply FO properties not supported by DOM format objects. For more information, see w3.org/2002/08//XSLFOsummary.html.

The mlreportgen.dom.FOProperty class is a handle class.

Creation

Description

prop = FOProperty(Name,Value) creates an FO format property having the specified name and value.

example

Input Arguments

expand all

FO property name, specified as a character vector or string scalar.

Property value for the corresponding property name, specified as a character vector or string scalar.

Properties

expand all

Document element name, specified as a character vector or string scalar.

Attributes:

NonCopyable
true

Data Types: char | string

Property value for the corresponding property name, specified as a character vector or string scalar.

Parent of mlreportgen.dom.FOProperty object, specified as a document element object. A document element must have only one parent.

Attributes:

SetAccess
private
NonCopyable
true

Children of mlreportgen.dom.FOProperty object, specified as an array of document element objects. This property contains the document element objects appended using the append method.

Attributes:

SetAccess
private
NonCopyable
true

Tag for the mlreportgen.dom.FOProperty object, specified as a character vector or string scalar. The DOM API 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. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Object identifier for the mlreportgen.dom.FOProperty object, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Examples

collapse all

This example shows how to apply an FO property to a List object. Using the DOM API, you can set a page break property on a paragraph using PageBreakBefore. However, you cannot use the PageBreakBefore property on a list. Instead, for PDF output, you can use the FO property 'break-before' with the value 'page'.

import mlreportgen.dom.*

d = Document('Break Before List','pdf');

listbreak = FOProperty('break-before','page');
p = Paragraph('First Page');
p.Style = {PageBreakBefore};
append(d,p);

p = Paragraph('Second Page');
p.Style = {PageBreakBefore};
append(d,p);

list = UnorderedList({'Earl Grey','Jasmine','Honeybush'});
list.Style = {FOProperties(listbreak)};
append(d,list);

close(d);
rptview(d.OutputPath);

Version History

Introduced in R2016a