In order to use this function your block Type must be set to Textflow
In certain cases, you will want to allow your customers to personalize a small section of text found within a larger body of paragraph text, but you do not want to allow your customer to modify the text of the other parts of the paragraph. This personalized text will be inserted into the middle of the paragraph and the full paragraph text will flow according the “Textflow” controls set in the block.
To allow user to change only part of the text, you'll need to define the insertion points, define the label that appears for user and define the default text, if any. The code looks like this:
%Label|Default Text%
Code inserted into your style could look like this:
My favorite fruit is %Favorite Fruit|oranges%.
In this case, "My favorite fruit is" is static and the user can only change the fruit name itself. User would see "oranges" as default text. The period ending the sentence would move to accommodate the fruit name entered by user.
% | Marks the insertion points of text that user can change. One goes at the beginning and one goes at the end of what user can edit. |
| (Pipe Divider) | This control character separates the label from the default text in the code. |
Label | This is the label user will see when they attempt to change the text. |
Default Text |
This text will initially appear in the paragraph. User will be able to change this. |
In order to use this function your block Type must be set to Textflow
In certain cases, you may want certain text in a paragraph to be displayed with different font styling than the surrounding text.
The code for font formatting is as follows:
Change Font/Font Face |
<fontname={TimesNewRoman}> |
Change Font Color (Pantone) |
<fillcolor={Pantone Reflex Blue C 1.0}> |
Change Font Color (CMYK) | <fillcolor={0.1 0.3 0.4 0}> (Note: the decimals are the CMYK build percentages, range: 0-1) <fillcolor={cmyk 0.1 0.3 0.4 0}> (Note: the decimals are the CMYK build percentages, range: 0-1) |
Change Font Size |
<fontsize=14> or <fontsize={14}> |
Reset Font Settings |
<resetfont> (Note: this resets the font to the settings specified in the block in the PDF) |
Combining Font Settings | <fontname={TimesNewRoman} fillcolor={0 0 0 1}> |
In order to use this function your block Type must be set to Textflow
Usually during personalization, user can type any text they wish into the box. In some cases, you may want to force customers to select from a limited set of options. By creating a dropdown field, the customers must choose from the options presented in this dropdown. These options are
pre-populated in the style and user simply selects from the dropdown without having to type into the field. The populated text will flow according the “Textflow” controls set in the block.
To create a dropdown for user to select from, you'll need to define the dropdown, define the label that appears for user and define the options user can choose. The code looks like this:
%Dropdown Label:dropdown|{Option 1 Label|Option 1 Inserted Text\nOption 2 Label|Option 2 Inserted Text\nOption 3 Label|Option 3 Inserted Text}%
Code inserted into your style could look like this (we've added <nextline> to insert line breaks):
%Choose address:dropdown|{New York|Hardrock Cafe<nextline>1200 5th Ave.<nextline>New York, NY 10019\nChicago|Hardrock Cafe<nextline>100 Michigan Ave.<nextline>Chicago, IL 60609\nHollywood|Hardrock Cafe<nextline>629 Sunset Blvd.<nextline>Hollywood, CA 91114}%
% | Marks the beginning and the end of your dropdown code. |
Dropdown Label |
This is the label user will see when they select the block. |
| (Pipe Divider) | This control character separates the label from the options. |
Option Label | This is the label user will see when they select the block. |
| (Pipe Divider) | This control character separates the label from the text that will be inserted. |
Option Text | Text inserted into the document if option is selected from the dropdown. |
\n | Separates each dropdown selection. |
Your customer will see a dropdown with title "Choose address" containing three choices: New York, Chicago and Hollywood. When the customer makes a choice in the dropdown, the actual address is placed into the block in the document:
In order to use this function your block Type must be set to Textflow
Usually during personalization, user can type any text they wish into the box. In some cases, you may want to force customers to select from a limited set of options. By creating a dropdown field, the customers must choose from the options presented in this dropdown. These options are pre-populated in the style and user simply selects from the dropdown without having to type into the field. The populated text will flow according the “Textflow” controls set in the block.
To create a dropdown for user to select from, you'll need to define the dropdown, define the label that appears for user and define the options user can choose. The code looks like this:
%Dropdown Label:dropdown|{Option 1 Label|Option 1 Inserted Text\nOption 2 Label|Option 2 Inserted Text\nOption 3 Label|Option 3 Inserted Text}%
Code inserted into your style could look like this:
My favorite fruit is %Select fruit:dropdown|{Apples|apples\nOranges|oranges\nPlums|plums}%.
In this case the user will be shown a dropdown with:
label: Select Fruit
and choices:
Apples
Oranges
Plums
% | Marks the beginning and the end of your dropdown code. |
Dropdown Label |
This is the label user will see when they select the block. |
| (Pipe Divider) | This control character separates the label from the options. |
Option Label | This is the label user will see when they select the block. |
| (Pipe Divider) | This control character separates the label from the text that will be inserted. |
Option Text | Text inserted into the document if option is selected from the dropdown. |
\n | Separates each dropdown selection. |
In this practical example below, we have entered the dropdown text into a style with name "Fruit dropdown":
Your customer will see a dropdown with title "Select fruit" containing three choices: apples, oranges, and plums. When the customer makes a choice in the dropdown, the actual text is placed into the block in the document:
In certain cases you may want to use conditional inserts to force additional text to appear if a user types in a field and no additional text to appear if user leaves the field blank. Conditional inserts would still allow your text to flow and add/remove things like pipe dividers or line breaks in the paragraph block. For instance, if a user types in a cell phone number, a "C" to appear before the number.
In order to use this function your block Type must be set to Textflow, even if final text is only one line.
To implement this function, you'll use strings of code that look something like this:
%label:condition|{if:<verification>:<fieldname>:{<content>}}{else:{<content>}}%%fieldname|default content%
%cell:condition|{if:empty:Cell:{}}{else:{Cell\: }}%%Cell|555.555.5555%
or
%fieldname|default content%%label:condition|{if:<verification>:<fieldname>:{<content>}}{else:{<content>}}%
%Cell|555.555.5555%%cell:condition|{if:empty:Cell:{}}{else:{ cell}}%
The highlighted sections of the strings above should be changed. The rest are control characters needed for the function. There are many more possible code strings you could use to get your desired result.
Notes: "label" (cell) and "fieldname" (Cell) should not be exactly the same. Creating labels in all lowercase and fieldnames with an uppercase is the easiest way to handle this.
The <content> does not appear in the actual strings, because if "Cell" is empty, no content will be inserted.
The \ in Cell\: is acting as an escape character. The actual text inserted into the document will be "Cell:".
verification | Allowed verification types:
|
fieldname | The field to which the verification should be applied |
content | Specifies the text that shall be displayed on the evaluation branch (the if or the else branch) |
You can use tabs in PDFLib documents to get text to align.
To do this, first create a block where "Type" is set to "Textflow." Then set "Horizontal tab method" to "Ruler." This will make the field Ruler tabs visible.
Add a ruler tab under the Ruler tabs section and set it accordingly. The units of the tab ruler are points (1/72 inch) and are measured from the left edge of the block that was created. Tab leaders are not supported.
On the Design Server, create a Style for your tabs and place the appropriate code. Use "\t" to represent a tab in the Style. This a backslash and a lowercase t. You can press "Enter/Return" here for line breaks that will be inserted into the text shown to user by default.
Upload the template and assign the newly-created Style to the desired block in your template. The user will see the Style utilized when they attempt to personalize the template.
To utilize Tabs on the Flash-based Designer, follow the first three instructions of this page, and then place your code in as Default Text rather than as a Style. Use the code "<nextline>" to insert line breaks into your Default Text.
The resulting PDF.
The Print Science Designer can place text on a clipping path embedded in an image. This will allow you to place text on a circle for instance.
Note: option 'charspacing' is not supported along with this function.
First, create a TIF image containing the clipping path. You could also use a transparent image with only a clipping path created, just be sure to save the transparency if you do.
Tutorials for creating clipping paths in Photoshop can be found here, here and here.
In the Designer admin, navigate to Images and upload the image containing the clipping mask. Name it and assign it to the appropriate gallery. Be sure to take note of the Image ID assigned to the image in the Designer admin. You'll need to include the ID in your Style.
In the PDF template document, add a text block where the text will appear. Format it accordingly. The image with the clipping mask will be inserted into this text block. Create and format any additional blocks needed in the template.
In the Designer admin, navigate to the Styles section. Add a Style and give it a name. This new Style will control the display of the text on the clipping path.
For the Style itself, the format should be something like:
<clipping_path=[imageID] startoffset=[startoffset] text_position={[horizontal alignment] [vertical alignment]}>%name:[label]|[default text]%
imageID | ID of the image uploaded with the clipping path |
startoffset | The offset of the starting point of the text along its path as a percentage of the path length. Default: 0 |
text_position | The first value specifies the starting position of the text relative to the length of the path (left/center/right). Acceptable values are left, center, right, 0-100. Use 50 for center. The second value specifies the vertical position of each glyph relative to the path, i.e. which part of the glyph box will touch the path (bottom/center/top). Acceptable values are bottom, center, top, 0-100. Use 50 for center. |
The text used in this Style is (using numeric values):
<clipping_path=7537 startoffset=0 text_position={50 50}>%Variety:singleline|
ASSORTED MACARONS%
or (not using numeric values):
<clipping_path=7537 startoffset=0 text_position={
center center}>%Variety:singleline|ASSORTED MACARONS%
Create a Product and upload the template to it. Set any options for the blocks contained in the template. Be sure to assign the newly-created Style to the appropriate text block.
The Style has placed the image with the clipping path in the appropriate text block. Adjust the Style and/or the clipping mask as necessary to achieve the desired result.
When writing Styles, we use a number of control characters:
| { } : %
In certain cases, we may want to include one of these control characters as real text inside a paragraph custom property. For example, when might want to insert text into the middle of a paragraph that contains these control characters.
In this case, when the character is preceded by “\” like:
\:
then the character will not be seen as a control character.
For example, we want the text Cell: to appear if user types in a cell number. Using this Style:
%cell:condition|{if:empty:Cell:{}}{else:{Cell\: }}%%Cell|555.555.5555%
The final text would appear like this:
Cell: 555.555.5555