Main Content

mlreportgen.dom.FOProperties class

Package: mlreportgen.dom
Superclasses:

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.

Construction

props = FOProperties(prop) creates an FOProperties object based on mlreportgen.dom.CSSProperty objects. The mlreportgen.dom.FOProperty object specifies the CSS format to use and its value.

Input Arguments

expand all

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

Output Arguments

expand all

FO properties, returned as an mlreportgen.dom.FOProperties object.

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.

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

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.

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);
Introduced in R2016a