FOM Reference > Display > fDisplay interface
  
fDisplay interface
This object represents a read only view of the current page, and can be accessed using the global property "display".
FormatTreeFlags enumeration
Flags to be used with generateFormatTree() on fDisplay.
The FormatTreeFlags enumeration has the following constants of type int.
FORMATTREE_DEFAULT = 0
Default information only (table/block name, id, restart, hidden, midtop, startPara, endPara, numColumns, row, rowSpan, column, columnSpan, numColumns).
FORMATTREE_SOURCE_POS = 1
Show source position (sourcePosStart and sourcePosEnd).
FORMATTREE_PAGE_COORDINATES = 2
Co-ordinates on the page, shown in millimetres (x1, y1, x2, y2, ybase).
FORMATTREE_TABLE_FLAGS = 4
Show table information (columnFooter, columnFooterEnd, headerStart, header, headerEnd, widthOverlap).
FORMATTREE_ROTATE = 8
Indicate whether a rotation has been applied (rotation).
FORMATTREE_KEEPS = 16
Show keep information (keepPrioritySoFar, rowkeepPrevious, rowKeepNext, rowWidow, rowOrphan, headerKeepTogether, headKeepEnd, rowKeepTopTogether).
FORMATTREE_FRAME = 32
Show frame information (frame, frameStartColumn, frameEndColumn).
FORMATTREE_MISC_FLAGS = 64
Miscellaneous flags (ignore, endOfStreamOnly, breakAcross, balanceBefore, hyphenated, startSpaceIgnored, balancing).
DisplayModes enumeration
Display operating modes for the current document.
The DisplayModes enumeration has the following constants of type int.
MODE_DOCUMENT = 0
Macro: td
A mode for a graphical representation of the pages contained in the document.
MODE_PAGE = 1
Macro: tp
A mode for editing frames and layers.
MODE_TEXT = 2
Macro: tt
A mode for editing text streams.
MODE_GRAPHICS = 3
Macro: tg
A mode for editing object graphics.
MODE_PREVIEW = 5
Macro: tv
A preview mode for the formatted page.
SVGGuides enumeration
Flags to specify which guides to output with generateSVG().
The SVGGuides enumeration has the following constants of type int.
GUIDES_FRAME = 1
Output frame guides
GUIDES_FRAME_COLUMN = 2
Output frame column guides
GUIDES_TABLE = 4
Output table guides
GUIDES_TABLE_CELL = 8
Output table cell guides
GUIDES_BLOCK = 16
Output block guides
GUIDES_BLOCK_REGION = 32
Output block region guides
GUIDES_LINE = 64
Output line guides
GUIDES_STYLE = 128
Output style guide markers
currentFrame attribute
The current frame being formatted, or null if not formatting.
currentFrame
Access
read-only
Returns
fdFrame
currentPage attribute
This current page being displayed or formatted.
currentPage
Access
read-only
Returns
fdPage
editStream attribute
The object representing the stream being edited (the stream in the yellow bar).
editStream
Access
read-only
Returns
fdEditStream
indexReferences attribute
An array of the index references found during formatting.
indexReferences
Access
read-only
Returns
fdIndexReference[]
mode attribute
The current display mode for the document.
mode
Access
read-write
Returns
int
printerDrawLevel attribute
Which elements of the page get drawn when printing.
printerDrawLevel
Access
read-only
Returns
fDrawLevel
screenDrawLevel attribute
Which elements of the page get drawn on screen.
screenDrawLevel
Access
read-only
Returns
fDrawLevel
streams attribute
An array of the streams formatted so far.
streams
Access
read-only
Returns
fdStream[]
generateFormatTree method
Shows the tree of formatted items on the page in XML, with optional information to be shown set using flags.
generateFormatTreestreamoutputflagsprettyPrint
Parameters
fStreamstream
The name of the stream containing the content to show.
Stringoutput
The destination file for the XML output.
intflags
Set which types of information to be output for each item. Possible values are in fContent.FormatTreeFlags.
boolprettyPrint
Toggle indenting and line breaks in XML output.
Returns
void. None.
generateSVG method
Draws the current page as SVG, either saving it to a file if an output is specified, or returning the SVG content as a string.
generateSVGoutputPathfilenamewriteFileflags
Parameters
StringoutputPath
The location to create files referred to in the SVG.
Stringfilename
If the writeFile parameter is false, this will be used to as a prefix for the href attribute when referring to any files written to the outputPath location. Otherwise it will be used as the destination filename for the SVG output itself, relative to the outputPath parameter.
booleanwriteFile
If true, the SVG will be written out to the filename specified in the filename parameter. Otherwise, the SVG will be returned as a string. This defaults to false.
intflags
Which guides should be generated into the SVG. This value defaults to all guides.
Returns
String. The SVG representing the current page, if the writeFile parameter is false.