Main Content

mlreportgen.dom.FOProperties class

Package: mlreportgen.dom

Array of FO properties for formatting PDF output

Description

Creates an object that contains one or more Extensible Stylesheet Language (XSL) formatting objects (FO) for PDF output. Specify the formats using mlreportgen.dom.FOProperty. For information on FO properties, see www.w3.org/2002/08/XSLFOsummary.html.

Note

Use FOProperties objects only for FO properties not supported by other DOM format objects. Most DOM format objects work for all output types. Using FOProperty objects makes your report application specific to PDF output.

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

Creation

Input Arguments

expand all

FO property, specified as anmlreportgen.dom.FOProperty object or as an array or cell array of mlreportgen.dom.FOProperty objects.

Properties

expand all

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.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

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

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

FO properties, specified as an array of mlreportgen.dom.FOProperty objects.

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.

Attributes:

GetAccess
public
SetAccess
public
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');

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(FOProperty('break-before','page'))};
append(d, list);

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

Version History

Introduced in R2016a