Printess was designed with flexible document sizes in mind and it’s easy to create so called Flex Designs. Flex Designs are needed wherever documents need to change their size while keeping the design intact such as phone cases.
To test Flex Designs one can anytime change the document size by use of the gripper to the right and the bottom of each Page. This changes the size of all pages in a document.
Later, document size may be controlled by the DOCUMENT_SIZE form field (Read more about the DOCUMENT_SIZE form fields here)
So how are flexible documents built?
There are several elements which make up a Flex Design:
Please also read the chapter on frame position and sizing.
Here are some examples:
First, let’s see an example using the Anchor control. We will create a background rectangle which should be in the bleed by 3mm on all edges, even if the document size changes. Here we can use the Anchor control and anchor the Frame on all 4 edges. Then one just needs to set the position for Left, Top, Right and Bottom to -3mm to position the bleed 3mm outside the documents page.
Here is an example making heavy use of %, %% and <% values:
This document can get changed in size. Have a look what happens if we drastically change the size of the document.
This is the same document but changed to a portrait-like size. For better understanding the position settings for each Frame are shown:
The dotted line will stay in the middle of the document and always goes from top to bottom. This was achieved by setting the anchor points to the top, left and bottom and setting its Left position to 50%.
The bar to the right has a fixed width of 1cm, its reference point was set to right and its Right position was set to 0cm and is anchored to the top, right and bottom. This makes sure it always goes from top to bottom and extends 1 cm into the document.
The triangle is anchored to the bottom right and has a width of 20% of the document width. Because its Height is set to 20%% it will use the width of the document as reference while letting the Frame expand and contract on the document base width only.
The circle in the middle has its reference point set to center and uses a position of 50% Left and 50% Top to always stay in the center. The Width and the Height are set to 40<%. This will either correspond to 40% of the width of the document or 40% of the height of the document, whatever is smaller.
Another useful Flex Feature is automatically moving Frames below a Multi Line text frame set to vertical Auto Frame Size mode, below built-in Multi Line text frames. Simply Group the Multi Line Text with the Frame below and when the Text is edited and expanded the Frame will adjust accordingly.
Styles are another way of implementing Flex Designs. In this business card example, one can enter a fax number, thus expanding the used Multi Line Text. This will then move the pink bar on the bottom down. Additionally, if the job title spreads over two lines the bar disappears completely to make room for the text.
This example was created using Named Frames and a Style assigned to the bar.
Start by giving the auto sized Multi Line text frame the name ‘main’. Click here to see how to give Frames a name.. Then create yourself a Style ‘.box’ like below and assign it to the pink bar.
.box {
visible: ${frame.main.bottom < 180 };
top: ${frame.main.bottom + 20}px
}
This will set the top of the pink bar to the bottom edge + 20px. As one can see ‘px’ was added after the literal ${…}. This is because frame.main.bottom just returns the pixel coordinates without any unit to allow for arithmetic operations. That’s why we need to add px after the curly bracket, to make it a valid value for a position.
Important Limitation: Note that this Style only works with Multi Line text frames as the positional source (as these are the only Frames which can expand) and it is limited to one dependency. So a Frame positioned by a Style cannot have another Frame dependent on its position.
Attention: Frame coordinates have px unit. All positions in literals will always be given in px which has the size of 96px/inch. So, if one needs inches here, simply divide the values by 96. If one needs centimeters multiply an additional 2.54.
The other function this Style serves is that if the bottom of the Multi Line Text gets below 180px the visible property will become false - making the pink bar invisible.
A good example on how to use Styles to react on the DOCUMENT_SIZE form field is the Printess example calendar. In this example we use conditional Styles to move Frames for different designs.