PTC ALD in Arbortext Styler > Components of Documents and Templates > Driving Page Layout > Page And Document Sequence Control > Document Sequence Control Streams
Document Sequence Control Streams
A document sequence control stream can be used to specify the page sequences that are available to the formatting process when formatting a content stream. Before formatting, use a template property to specify the document sequence that the template should use to drive the formatting. The fTemplate.documentSequence property should point to an fDocumentSequence object.
A document sequence control stream is a list of page sequences. Previously, the order in which the page sequences were declared in the control stream set the order they would appear in the output document. This changed significantly in Version 10.0 of PTC Arbortext Layout Developer. Now the document sequence specifies a default page sequence for the document. It then calls further page sequences using inline commands to achieve any type of page sequence dynamically. The default page sequence outputs the main content stream onto a very basic page. The inline page sequence commands then provide more appropriate page layouts.
There are two options for creating a document sequence control stream:
Create and edit by hand
Create the control stream using JavaScript with the createDocumentSequence() method on the fContent object
For example:
var docSeq;
docSeq = template.content.getDocumentSequence("myDocSequence");
if (!docSeq) docSeq = template.content.createDocumentSequence("myDocSequence");
This example follows the same pattern for creating any PTC Arbortext Layout Developer tag. It tests for the existence of the document sequence control stream myDocSequence. If it does not exist, a control stream of that name is created.
The getDocumentSequence() and createDocumentSequence() methods return a fDocumentSequence object.
The fDocumentSequence object provides a sequences property to list the page sequences that form the document sequence. The object also provides the addSequenceItem(), removeSequenceItem(), and clearSequenceItems() methods to manage the list.
Each item in the sequences array is an fDocumentSequenceItem object. This object calls a page sequence. It can also provide the parameters that control the page sequence, such as specifying page number formats, starting and ending conditions and setting page size.