Sub Documents are the Swiss Army Knives of complex tasks in Printess.
Sub Documents are especially useful in the following situations:
One has to imagine a Sub Document as one of the pages of another document placed into the main document like an image. The magic thing is: it’s not an image, but a personalizable document.
Essentially every document can be a Sub Document. Just create another document. Simply go back to the main document and switch to the Sub Document tab, then all other documents are shown with their first page as icons in the Sub Document Feature tab.
The small folder icon beside the document name will switch to this Sub Document. Click on the icon to insert the Sub Document into your document. Once inserted you can adjust the size of it and much like an image, you can fit, fill or crop it in its frame. (Read more about Sub Document fitting here!)
A Sub Document also has the option to select from one of its pages (Spreads). This is done by giving each spread in the Sub Document a unique name and enabling Show as Form Field in the Sub Document Frame Feature tab. (Read more about Sub Page selection here.).
One interesting aspect of selecting a page of a Sub Document on the Buyer Side, is that if you use text or image Frames and switch on Show as Form Fields for personalizable features, the Buyer can select a Page and this will also define the user interface shown, as only the Frames on the selected page will show its form fields. This clearly does not work with general document form fields created in the Resource tab, as they are global to all pages.
Normally one would like to create their design on a flat surface. Once the design is done a good product preview will sell the item.
This can be achieved by warping the main document into a product preview.
In this designable drinking glass document, the Buyer designs his document essentially in a Sub-Document with the de-rolled printable area as document size.
When the Buyer is happy with his design he can switch to the Preview Document, where the design is placed as a Sub Document warped on the glass front and back by cropping and using the Mug Warp feature.
The same principle applies to creating a document for printing, besides the printing area, the document may need to contain a barcode for the production workflow, a human readable customer name and a preview of the finalized product for quality control. Printess can achieve all of this in one simple Template!
Our example document Chocolate Bars shows a very nice example of a configurable chocolate bar where the Photorealistic Preview itself is the configuration interface. This example also uses the Spread Selection form field to change the Sub Documents between Banana or Strawberry - really impressive!
Please have a look at the Chocolate Bar Example which is available in the Create New Document screen. If you look under the hood of this document you will see that the design itself is still just a simple, flat, very easy to maintain document.
Sometimes one needs a graphical element which is also a functional block of the document. Lets have a look at a simple example. A typically formatted price tag with an input box to change the price.
As this cannot be achieved with a single text frame, the solution is to create a Sub Document for the price tag and break up the price into the big number and the small cents number.
Adding a Document form field and two small script literals makes this price tag functional:
This splits the price by . and selects the portion before it at index ].
The cents are done the same way except that in this case the second portion at index  is taken.
Grid Style Calendar
Printess enables for incredibly complex building blocks, which can then be used across several pages. One of the more intricate but powerful examples can be found in the Calendar Grid Style example one can create at the New Document tab.
Have a look into the month Sub Document. Not only can it calculate the existing days of a month in any given year but it can take data from an events table full of holidays and birthdays, and its design is completely controlled via Styles. Please read more about how the calendar was done in the Scripting section of the manual.
Please have a look at our Children’s Book example where a Sub Document is used to propagate the hair style throughout the document.
In the same chapter we also talk about the Retro Sign example. This example also makes extensive use of Sub Documents to create convenient features likes holes, varnishing and corner cuts in the document.