Table of Contents
List of Figures
This document gives a detailed overview of PageDNA’s Variable Imprint Templates, referred to as "Styles". The audience for this document is anyone who builds and/or maintains Styles for an online ordering site. We assume you already have an overview of our software – see PageDNA Software Overview for more information.
The term ‘Partners’ in this document refers to PageDNA software development allies – such as you – who build and maintain ordering sites. We will refer to the company a particular ordering site is built for as the ‘Customer’, and we will denote a generalized employee using the site to order products as the ‘End User’.
At the heart of the PageDNA system is the Variable Input Printing Engine and Renderer, or "VIPER" for short. VIPER is a sophisticated typesetting engine that creates industry-standard EPS Postscript™ files conforming precisely to your customer’s corporate identity standards. VIPER uses these EPS files to create GIF proofs of each item for the user to review while ordering. After the user approves the imprint and completes their order, PageDNA software emails the order (including EPS files) to the manufacturer to use in manufacturing, and sends an order receipt to the end user who requested the items.
Each variable-imprint (or "templated") product you include on your Customer's ordering site will need a set of specifications so that VIPER knows how exactly to typeset the product. These specifications are collected in a text file known as a "Style". Each side of a product with variable imprint requires its own Style - a two-sided business card would therefore need two different Styles.
A Style file contains information such as the document size, which fonts to use, location and properties of blocks of text, and often also includes logic to handle custom typesetting situations. This document contains all of the information you need to learn to create these master templates.
Generally speaking, the person building Styles for an SOS site is a desktop publishing professional with a firm grasp of the customer's corporate identity design and a solid working knowledge of desktop publishing tools such as QuarkXpress or Adobe Illustrator. The more real-world typesetting you have encountered in the past for a particular customer, the better qualified you will be able to design Styles for your customer.
If you are building a site for a new corporate customer, maintaining solid communication with a Brand Manager or a contact at the design firm is paramount. Not only does this demonstrate to your customer that you are dedicated to creating a superior product, but this will also minimize your site maintenance tasks down the road.
Following is a list of equipment and software you will need to build Styles:
Approved Corporate Identity Template Files (e.g., Illustrator files)
Pre-printed Masters or "shells" for each item (if applicable)
Desktop Publishing Setup, including:
Computer with Internet Access
Laser Printer (large enough to print largest item at full size, with borders)
Software to open and print Template and VIPER EPS Files (e.g., Illustrator)
Adobe Type Manager
Any Postscript fonts used in Corporate Identity Template Files
Pica stick or similar point-based measuring tool (e.g., a loupe)
Light table (optional, a bright light also will work)
FTP client (optional)
Scanner (optional)
We recommend configuring sites and building Styles at or near the same time. Stated simply, sites and Styles go hand in hand. Any fields included on the Imprint page (PERSONAL template) of your Customer’s ordering site will be available for use on the imprint of your items, so it is helpful to have this page completed first. See the Site Specification document for a detailed overview of this process.
We recommend that you begin building Styles using the following sequence of tasks, which will be explored in greater detail within this document:
Procedure 2.1. Style Building
Gather Specifications
Open and print Identity Template
Determine document size
Determine Fonts
Identify Blocks
Create GIF image of "shell" or Master image (if necessary)
Identity Custom Typesetting Situations
Identify any other special situations (sub-logos, custom colors, etc.)
Create Style File
Open Style File with Style Editor Gold
Define Document Size
Define Fonts
Upload any necessary fonts to VIPER
Define Blocks
Alter Phone Words (if necessary)
Upload "shell" or master image, if necessary
Upload EPS sub-logos, if necessary
Configure custom typesetting rules
Test Style
Rough Cut: Place Mock Orders using Ordering Site
Final Polish: Test EPS files using Style Editor Gold
Following are instructions on How to report a style / layout concern.
If there is an order showing the issue, simply send us the tracking number(s) so we can investigate and help you out.
If you have a problem that you encounter during testing, following are best practices to report a problem:
Visit the site and recreate the problem. Generate a proof showing the problem.
Click "Edit Imprint Information" at the bottom of the 'Proofs' page or the 'Shipping' page if the problem is for a Static Item.
Cut and paste the web address from the Imprint page into an email to support@PageDNA.com
Describe the problem succinctly
Cancel your order by clicking "Cancel" or by close your web-browser.
This will allow us to re-create the problem you encountered.
Lastly, if you are getting a syntax error or "red screen" error when testing, you can email the contents of your blocks section (along with the name of your site and the 'tag' for your item) to us at support@PageDNA.com.
The old carpenter adage "Measure twice, cut once" also applies to building Styles. Specifications for your style are gathered directly from the master corporate identity template for each item and recorded for later retrieval.
If the following instructions are followed, your style file will precisely match your customer's customer identity templates.
Procedure 4.1. Instructions for Ensuring Your Style File is Matched to Your Customer's Identity Templates
Open and Print Corporate Identity Template
To get started, open the Corporate Identity Template you wish to create a Style for – the business card, for example. Make sure you have all required fonts installed on your machine. Place a hairline border (0.25 points) around the item border and then print a hard copy of the item at regular size.
When first learning to build Styles, you may find it helpful to record measurements onto a printout of the item you are building. Down the road, you may wish to bypass this intermediate step, programming Styles in real-time directly from the Corporate Identity template.
VIPER needs to know the full size of your document, measured in points. If your product is a standard horizontally aligned business card, the document size is likely 3.5" x 2". This translates into points as (252, 144). A vertically aligned business card would be recorded as (144, 252). Other standard document sizes include letterhead (612, 794) and envelopes (684, 297). Be sure to measure the document value directly from the template, as your customer may be using a custom document size. Do not measure from a printed item. Record this value.
Each bit of text on your item that has a different typeface, font size, leading value, or tracking value is a separate, distinct font to VIPER.
Explore the Corporate Identity template using the Text tool of your desktop publishing tool (e.g., Illustrator), clicking around within various blocks of text while monitoring the font properties display. Each and every time you identify a bit of text having unique properties, you will need to record the following:
Font name
Point size
Leading (space above line, in points)
Tracking (space between characters)
Horizontal/vertical scaling (rare)
If a font is used multiple times in different locations on your item, you need only define the font one time.
Next to each area using a particular font on your printout, write a simple label indicating which font is used in that section. You may wish to circle the text using a particular font and draw a line linking it to the appropriate font definition if the same font is used in multiple locations.
If you are having a difficult time identifying a particular font used on your sample, you may wish to consult the online resource Identifont
Text blocks are groups of lines of text that act together as a group. Blocks of text grow together and flow together. Examine your Corporate Identity template and you should be able to readily identify one or more blocks of text. For example, Address Lines, Phones, and Name/Title information are often grouped together.
VIPER needs to know where the blocks are located on your item, which fields are included in each block, and how the block behaves as more lines are added or removed.
For each block, you will record the following:
Block Text Alignment
Horizontal justification (left, right, or center)
Horizontal anchor (left of block, right of block, or center of block)
Vertical anchor (bottom, middle, top, or top baseline)
Block Position
Fields included in block
Determine Block Text Alignment
A block of text may be horizontally justified to the left, the right from the center. This property is easy to identify upon first glance. Justification controls how the lines of text line up with each other within a block.
Now moving onto the vertical plane, a block of text may grow (meaning, expand vertically when new lines are added) from the bottom, from the middle, or from the top. Just as there is a vertical anchor, there is a horizontal anchor as well. As lines within the block get longer, one side of block will stay fixed. Figure 1 shows Horizontal Justification, and Horizontal Alignment. To discover the anchor point for a line, you may need to add a line of text to a block using in your page layout program. Alternatively, you may wish to consult the Corporate Identity standards guidebook if necessary.
To determine the position for a block of text, you need to keep in mind the Block Alignment (determined above). The Alignment determines which coordinates you need to measure. Block location coordinates are measured in points from the lower left corner of your document to the point the block grows from.
First, determine the horizontal block position. This is the distance, in points, from the left edge of your item to the left, center, or right of your block – whichever the block uses for justification. For example, if your block of text is center justified, measure and record the horizontal distance in points from the left side of the item to the horizontal center of the block.
Next, measure and record the vertical anchor point. If your item grows up from the bottom, this is the vertical distance from the lower edge of the item to the baseline of the lowest line of text. If your block grows vertically from the middle, this is the middle of the block. Lastly, if your block grows from the top, you have two options to choose from: you can measure to the baseline of the top line of text, or you can measure to the actual top of characters in the top line. Which system you use does not matter – use the system that makes the most sense to you for each block, but remember which system you used to measure this dimension.
Determine Fields Included in the Block
You will need to carefully note all fields that are included in the block (e.g., First and Last Name, Title 1, Title 2, City, State, ZIP, etc.). This likely may include fields that do not appear in the Corporate Identity template. Make sure you understand all of the possible fields that may be included within each block. For example, on a business card there is often room for several phone numbers. Are these all included in the same block?
Create EPS file containing any static imagery (if necessary)
If you have a fixed image on your item that is NOT preprinted on the master or 'shell', you can opt to have VIPER include this image or images in the EPS files generated by VIPER.
To accomplish this, create an EPS document having the exact dimensions of your item (ie., 3.5" x 2" for a business card). Place the EPS graphics inside this bounding box in the exact position they need to appear at for this item, and then save this EPS file for later upload into your style file.
Ensure that you convert any fonts to paths and also check that there aren't any hidden objects floating in or outside your EPS file.
Create GIF image of "shell" or Master image (if necessary)
Many corporate stationery items use "shells" or pre-printed masters during the manufacturing process. These pre-printed masters often feature the corporate logo or other invariable information.
Your end users will want to see an accurate representation of their items while proofing. To accommodate this, PageDNA has built a feature into the VIPER software to support something we call combine images. Quite simply, combine images are combined with the variable imprint information before the GIF proof is shown to the user in the web browser. This combine image acts as a sort of "virtual master". Note that these images in no way affect the EPS file generated by VIPER; they are only used to create realistic proofs.
Following is an overview of the process for creating a combine image for your item:
Obtain high-resolution raster image of master:
Export precise image of master from DTP software (preferred)
Scan real-world physical master
Crop image precisely to document border (if necessary)
Resize image to appropriate proofing size and remove any artifacts
See notes below for sizing information
Save as GIF file and store for later use when building your Style
![]() | Choosing a Size for Combine Images |
|---|---|
Business cards are generally proofed at 200% size, requiring a 7" x 4"(72 DPI) combine image. Larger items such as letterhead are generally saved at 70% of their width for proper display to the end user. The image should be no wider than 600 pixels to ensure proper viewing on the end user’s web browser. For more information on proofs, refer to "Creating Great Proofs" in Appendix A, "Desktop Publishing Tips and Tricks". |
Identify Custom Typesetting Situations
Next you must carefully review the design for any Custom Typesetting Situations, recording not only the Situations but also how to deal with them. Following are five examples of custom typesetting situations you may already be familiar with:
Vertical Constraint– The lines included in a block exceed the allotted vertical space (e.g., there are 6 possible phone lines but only room for 5). Potential Solutions: If and only if there are 6 lines included for an item order, decrease leading used in that block, or simply move one line to a different block.
Horizontal Constraint– The number of characters in a given line exceeds space allotted (e.g., the end user has an exceptionally long name or title). Potential Solution: If line is too long, decrease the font size and/or add negative tracking the font on this line.
Variable Line Wrapping– The design calls for two phone numbers to fit next to each other on a line, but only if possible. Potential Solution: If both phones don’t fit, wrap the second phone to a new line.
Forced Case– The design calls for fonts to be forced to ALL CAPS or SMALL CAPS (often with names), lowercase (email addresses). Potential Solution: Force all characters from a field(s) to a particular case.
Spacing and Alignment– Adding precisely measured spacing between fields or lining up things horizontally within a block (columns).
VIPER can take care of these and many other custom typesetting situations.
These examples are provided only to give you a general feel for what to look for on your template. To understand these situations requires not only a firm grasp of the Corporate Identity template, but also the data coming from the real world customers who place orders. For example, it frequently happens that the "Horizontal Constraint" situation only creeps up when a user with a very long name or email address tries to place an order. If you are converting a client already in production, it is more likely you will be aware of these situations and how to deal with them.
Identify any other special situations (sub logos, custom colors, etc.)
Lastly, check your Corporate Identity template for any other design features not yet noted. Are custom font colors used anywhere in the document? Are there other EPS files that the user may optionally include on their item (sub-logos such as divisional logos, "President’s Club" seals, etc.). You will need to record this information and create source EPS files to upload to VIPER for use.
If your template includes embedded EPS files that appear in the same place on each item, you will need to export an EPS file containing only this element at the full document resolution. Save this file with a name you will later remember.
Table of Contents
![]() | Warning |
|---|---|
Note: this chapter covers the new user interface of Style Editor Gold, the mode of SEG we call Visual Style Editor. For the documentation on the old user interface, go to "Create Style File, Old User Interface". |
At this point, if you have followed the "Gathering Specifications" instructions closely, you should have most – if not everything – you will need to begin creating your Style. PageDNA has simplified the Style-building task by providing a web-based tool called Style Editor Gold – or "SEG" for short – that lets you edit Style files in an organized fashion. SEG is the tool to get to know to create, test and deploy Style files quickly and efficiently.
We have upgraded SEG in many ways to make it a lot easier to use. We added a new mode to SEG, called "Visual Style Editor." This new user interface, "UI" for short, mostly uses forms to enter your data for a Style. But the old UI is still supported. In this section we explain the most important aspects of "SEG in Transition", while the rest of this chapter will focus on the new VSE UI.
Important: If you have converted a Style to use the Visual Style Editor, let's call it "VSE", clicking "Revert" will get you the unconverted Style back, as long a you did not click the "Save" button.
![]() | Warning |
|---|---|
This version of the VSE still has the following open issues we know off:
|
To edit an existing Style that was using the old SEG UI, you need to convert this Style so you can use the new VSE. Converting a Style is easy, just click the "Convert" button at the right (last button under the "Help" button) and your Style will start using the VSE. The "Convert" button is only visible after you have selected a Style and clicked the "Edit Style" button. Note: it is possible that a Style fails to convert, usually due to advanced logic, more on that in a later paragraph. When you have saved a Style that is converted SEG will use the new VSE automatically and you will not see a "Convert" button.
The Styles produced by EGG (discussed in a later section) can be converted automatically by making sure the "Enable Visual Style Editor?" check box is checked. This check box is on the EPS Egg Upload screen and also on style chooser step in the Item Wizard.
It is not always possible to use the VSE. If you have (or plan to create) an advanced Style then currently your only option is to not convert your style. Creating a Style in the old SEG UI requires programming, and this programming is accomplished using a programming language called Python that is easy to learn. For more complex Styles you can access the full power of Python, including conditions and loops. Existing Styles that have advanced code can often not be converted to use the VSE. Whether you will be able to add this code to your Style after conversion depends on what kind of logic you need. VSE has two tabs you can enable, the "Preblocks" and the "Postblocks" tab. These tabs work much the same as the "Blocks" tab in the old SEG UI Although this gives you a lot of the power of SEG, it is unlikely that the VSE and the old SEG UI will become completely equivalent with regards to support for advanced coding. The focus of the VSE is to make editing of the most common Styles a lot easier, not to support every feature of the VIPER typesetting engine.
On a more technical note, the representation of your Style is still a file, regardless of old SEG UI or VSE. However the representation of the Style is rather different: the old Styles essentially contain Python code, whereas the new Styles contain Python objects.
Note: if you want more information on Python, a great resource is the online Python documentation at:
http://www.python.org/doc/2.4.3/
The following link – taken from the tutorial above – is to an informal introduction to Python.
SEG is accessed through the Site Menu. After logging into the Production Hub, visit your "Sites List" to choose an existing site you wish to work on. Alternatively, you can create a new site exclusively for the purposes of learning to build Styles or for a new client.
Within the Menu for your site, you should see a link for "Style Editor Gold" under the "Site Content" section of the menu listing. If you do not see this option, contact PageDNA and we will quickly set you up with access to SEG. Click the "Style Editor Gold" link to open the application.
When it comes to creating a new Style you have two choices, as depicted in the next figure:
Create New Style From EPS This option uses what we call "EGG" and EGG stands for "Excellent Graphics Grabber", a key PageDNA technology. EGG accepts a 1-up EPS file of your item and then 'reverse engineers' the layout to create a style file, including automatically determining variables, font settings, block position, custom colors, etc. This can save hours of work, and often only requires minor hand-edits to complete the style building process. See "EGG Reference". for how to optimize your results with EGG.
Create New Blank Style This option is for you when your Style is relatively simple and you don't have prepared artwork already. This can be faster since you skip the Illustrator step in the design process. With this option you choose a page size and your new blank Style is ready for editing. You create all the blocks yourself. So this is a great option for a Style that only needs a few text blocks or for cases where you have only artwork for a logo but not a complete template.
The rest of this section focuses on EGG. To try EGG, first prepare an EPS file with a bounding box matching the product dimensions of your product. For example, a business card would normally be 3.5 x 2 inches - your bounding box needs to have these exact same dimensions for EGG to be able to figure out your product. Creating a bounding box is as simple as making your document size the same as the product size and adding a box with no stroke or fill that matches the document size.
For some example artwork prepared to proper specifications, see the Training Files Repository at http://www.PageDNA.com/files/
Although your artwork files may be in a variety of source formats (InDesign, Illustrator, etc) our system strongly prefers to 'digest' EPS files generated by Illustrator. Therefore, if your native file is not yet in Adobe Illustrator EPS format, first save an EPS file out of the current application, then open that EPS file in Illustrator and re-save as EPS following our instructions below.
If you have pre-printed 'shells' that will later be imprinted with this artwork, you may include this in the "EGG" file, but be sure to convert any text in this layer to paths/outlines, leaving variable imprint information as editable text objects.
Now editing in Illustrator, your first and make sure the bounding box represents the exact size you want to get transparent (no stroke, no fill). Save this file in EPS format with no thumbnail and include any fonts.
For detailed instructions on artwork preparation see our EGG Artwork Preparation Guide (link below) - these instructions cover saving an "EGG-ready" file from versions of Illustrator up to version CS 2.
http://www.nationsprint.com/hub/docs/html/SpecificationForms/artwork-prep.html
Now that you have your EPS file saved out, open Style Editor Gold and click "Create New Style From EPS" link in the "Style Window that pops up when you open Style Editor Gold for the first time. The same pop up window is available when you click the "Select Style..." button on the right.
A form will open, titled " EPS Egg Upload", giving you the ability to "Browse" your hard drive and locate your EPS file. In the "Style Name" field, make sure to name the product something unique, ending in the extension '.sty'. Ideally, you have already created the item in the 'Item List', and you will name your style file to match the 'tag' for that particular product. For example, if you business card has the tag 'bc', name your style 'bc.sty'.
When you want to create a style for the VSE, make sure the check box in front of "Convert Style?" is checked. After you "Submit" your EPS file, EGG will try its best to reverse engineer the style from the file you've submitted. If an error occurs (e.g., Fonts not loaded), you may simply click your browser's "Back" button and try again after making changes such as loading any fonts our system is missing. Note that if you want to process the same EPS file again, there is no need to upload that file again, it is already on the server. To re-process this file, click the "Show Advanced Options" link, then you can select the already uploaded EPS file from the select list. Usually it is the one at the top of the list. Leave the "Browse" field empty but fill out the "Style Name" field. See figure below:
EGG will 'guess' on a block's positioning (i.e., left justified, growing from the bottom up). If EGG has guessed wrong (which happens), the Block Editor ( blocks tab ) gives you a chance to change this with a visual display of the blocks and their alignment ( anchor points ).
Although there is usually a bit of cleanup to perform with EGG - i.e., standardizing fonts, adding field names into the style that were missed by egg, etc - EGG is highly recommended as it saves you a TON of work in creating your style file.
![]() | Tip |
|---|---|
Make sure that you do not have custom kerning (spacing between letters) defined in your style. EGG will look at each different font usage and define a new font... this makes cleaning up the style later more complicated. |
![]() | Tip |
|---|---|
EGG automatically looks for patterns such as name, title, phones, emails and so forth and then converts them to the proper variable names in our system. If you don't want our system to have to 'guess' variables you can simply pre-populate the fields in your EPS file using the PageDNA variable name surrounded by brackets, e.g.,: [card_title1] ...would be recognized as the title line one for this product. Variable names are shown in green text in the "Personal Page" section of "Web Page Templates" if you need to learn the variable name for a particular field. |
New PageDNA sites by default include three default Styles, bc.sty (Business Card), env.sty (Envelope), and lh.sty (Letterhead). These templates are pre-populated with information that should help you jump-start Style building – in particular for the business card. It is recommended that you start with one of these templates or use EGG as above to get a style started. Assuming you have opened "Style Editor Gold" (from the menu at the left), click the "Select Style..." button at the column of buttons at the right. This will open a dialog box with a drop down list with the available styles. Note that this pop up window also has a button "Manage Styles...", we will describe that later, at the end of this section.
Now select "bc.sty" from the list at the top of the screen and click "Edit Style" to open the Style. You will be presented with the opening screen, shown in Figure 2 below:
Notice the gray "tabs" running along the top of the gold area of the screen. Clicking one of these tabs opens one section of the Style file for editing. We will be focusing our attention on only a few of these tabs, but following is an overview of all of the possible tabs for your reference. Explore these tabs by clicking on each individual tab as you read the description below. At this time, do not make any changes to the information found within each tab you explore.
As already noted, SEG has two ways of editing a Style, the VSE, which allows for easier editing by mostly using forms and the old UI, which has text areas in which you edit code. In general you will see the VSE when your style is converted for using the VSE, and the old UI when your style is not converted. But we mention that here again because on some tabs you will have a choice of which UI to use. The images below depict the VSE.
This information controls how proofs are displayed to the end user, how large to show the item to the end user, which areas to "zoom into" for a close-up proof, etc. Just under the tabs at the right you will notice "List View | Code View" List View represents the VSE using a set of forms; with Code View you can edit the code in a text area in the old way.
This section contains a list of all of the variables VIPER is passed from the online forms. The values are defaults, which will be used if the online form does not pass a value. This section is generally not changed unless you need to hard-code a value or add new a variable.
This is no longer used, but is included for older sites using previous versions of PageDNA software. This tab will only show when it is actually used. Lines are now created within Blocks.
This is a very important section, wherein each font to be used in your Style is defined. We will explain this information shortly. When your style is using the old UI, you have a choice which UI to use: "List View" or "Code View" The preferred way to use this tab is by using the "List View" UI. However when your style is using the VSE, you won't see this choice, it uses the "List View" UI.
Here you find the color definitions used by the fonts in your Style. Note that this tab is only visible when the "Fonts" tab is using VSE. In the old UI the colors are on the fonts tab.
CUSTOMCOLOR is the setting needed for spot colors. The CMYK values for spot colors do need to be declared in order to render the proof.
If you need to define black and white as colors, these need to be set as CUSTOMCOLOR. You will need to use something other than "black" or "white" for the Colorname field because these are reserved words. Use something like BLK or WHT instead.
If your Style requires custom logic, this is one of the places you can put this information. Custom logic is covered later in this document. Usually this section is empty and will not be shown. For converted Styles this tab isn't used, but you can enable the "Preblocks" and "Postblocks" tabs for that purpose. These tabs are for more advanced use and discussed in some of the examples in the "Typography Exceptions". chapter.
The Phones tab is used to "build" Phone imprint information from data provided by the end user. Note that in the old SEG UI the "Phones" tab is labeled "Words".
This is one of the most important Tabs in SEG. Herein you will define the blocks of text for your items. You can move block in position edit the block name, edit the content of the block and other block settings.
Here are some other features that occasionally be edited.
The buttons to the right of the editing area allow you to Save and Test your Style.
In general, keep in mind that you only need to click the "Save" button when you are ready to publish your changes to your ordering site. Up until you click "Save", everything is saved in a working copy or cache – a temporary holding zone where you are free to experiment. Clicking between tabs automatically saves the changes you’ve made to the cache. If you do not click "Save" when finished editing, your changes will be in the working copy. When you then reopen the style for editing the working copy will be loaded if this working copy is changed compared to your live style (production copy). A message will inform you of that. With an option to abandon the changes and go back to the live style.
The "Save" has button has a "unsaved changes" indicator as (changes compared to the live style) depicted below:
The "no changes" state of the "Save" button indicator:
Remember that we talked about the button "Manage Styles..." button in the beginning of this section? The button in the pop up window that appears when you click "Select Style..." opens a new pop up window, which allows you to copy a style, delete a style and to open a third pop up window to undelete styles.
Now that you are familiar with navigation within Style Editor Gold, it is time to jump in and actually start building a Style file.
Click on the "Blocks" tab within SEG. Then click the button for the
"Page Window", this is the last button, the
icon ("Open page Window"),
in the tool bar just left of the align selector. See figure below:
If you click the "Page Window" button a new window opens, much like the
following figure:
You will see input boxes for the Page size, just under the "Page settings" heading. Enter the value you measured – in the units selected, inches is the default – into the W and H fields. Note the selected units are in the "User preferences" section above the "Page settings" in the window. If you are building a Style for a standard business card, the values for these fields will be: 3.5 and 2 in inches or 252 and 144 in points. If you are editing an existing Style, or a Style made by EGG, page size values should be present already. Click the "Apply" button in the right top corner of the window to apply the values (they are applied to your working copy of the style). Note: for historic reasons the information can be set in the "Other" tab. There the format is different, since there only one input box: (width, height) and the values must be in points.
You also see input boxes for bleed under the input for the page size. From left to right these bleed values are for left, bottom, right and top edges of the page. Note that these values are in the current units. Also note that each value is the difference between the bounding box edge (unfinished product) and the edge of the finished product. When you need to use bleed you normally let EGG set your page size and bleed. See the chapter on bleed: "Dealing with Items Having a Bleed".
As you will notice the "Page Window" has some other section that allow you to change user preferences, output settings and enable the "Block logic". The "Settings for output" are the same one as on the "Other" tab and for VSE the "Other" will go away in the future. You can also set the size of the text dispalyed in the Block Edit Window by using the Font Size option. See the last part of the section "VSE Blocks Tab". for a more detailed description of the Page window.
![]() | Tip |
|---|---|
On the "Other" tab you will notice some links below this input area named "bc", "lh", etc. Clicking one of these links will fill in the appropriate value for a standard sized Business Card (bc), Letterhead (lh), Envelope (evp), etc. |
Now we will need to define fonts. Click on the "Fonts" tab. You should find a list of fonts already defined. These are provided as examples for you to modify. Each font you identified within your document will need its own font definition.
Next to each font in the list, under Actions, are three links which allow you to edit, copy (making a clone with a new name) and delete the font. Below the list is the form where all the editing happens. To edit a font click the "edit" link next to the font you want to edit. The data for that font appears in the form. After you are done editing, click the "Apply" button at the bottom of the form. The data in the form is also saved if you visit another tab.
If you want to create a new font, make sure you have a blank form. In case you have been editing an existing font before you will need to click the "add new Item" link just above the form towards the right. Clicking that link will show a blank form with a select list of the font classes, 'FONT', 'MIXEDFONT', SCFONT' and so on. Select the desired font class in the list and click the "Change Type" button, then fill out the form and apply the changes.
You can change the font class while editing ('FONT', 'MIXEDFONT', SCFONT' and so on) used for the current font using the select list above the form to the right. After changing the type, click "Apply" or "Change Type", then you will be editing the same font again but this time with different fields, appropriate to the newly selected type. Note that the MMFONT type only works with specific fonts, so you may get an error when changing to this font type.
To delete a font click on the "del" link next to a font in the list. Be sure
that you want to delete this font, after clicking the link the font is deleted (if it can
be) without further questions! Fonts that are currently in use cannot be deleted, you will
receive an error message: Font 'F3' is in use. You cannot delete this
font
A font definition requires a Name (to refer to the font elsewhere in the Style), the Fontname, and the Pointsize. All other values can be left at their defaults. Note that if you leave a required field open (blank), a default value will be used. This ensures that the style will be valid. The fonts in the list are using the following format:
Name, Size - Leading, Tracking, Color (if the font has a color other then black)
Each font you define will require a distinct font label (Name in the form) ( like "F1" ). We recommend using the F1, F2, F3, ... convention as it is very easy to remember and identify when used in other parts of the Style. Your next font would therefore be named "F2", and so on. Fonts can be defined in any order.
The Fontname of the font must be recorded as the formal PostScript format name. Adobe Type Manager, when showing the details of a font, shows "PostScript name" as one field. This is the field you will need to specify when defining your font. Alternatively, it is possible that we already have the font your document uses installed and you can get the name from our fonts listing. Read the next section for more information.
![]() | Tip |
|---|---|
VIPER defines Leading as the vertical space above the top of a line of type. Most desktop publishing applications (e.g., Illustrator) measure Leading as the total vertical distance between lines. A quick way to convert Leading into VIPER terms this is to simply subtract the font point size from the provided Leading value to get the VIPER leading value. For example, an 8-point font with 9.5 points Leading (in Illustrator terms) will become an 8-point font with 1.5 pt VIPER leading. Similarly, a 12-point font with 10 point Leading would have VIPER leading of –2. A VIPER leading value of 0 sets the leading to the same number of points as the point size. |
![]() | Tip |
|---|---|
Tracking is defined as the space between each character in a line of type. There are a number of different conventions used in the desktop publishing world for measuring tracking values. PageDNA has support for three different systems. This may seem a bit confusing, but in the end this gives you the ability to enter tracking values from a number of different programs. Read on for the full scoop: |
![]() | Tip |
|---|---|
When using expert fonts, use NONISOFONT instead of FONT in your definition. |
![]() | Tip |
|---|---|
Multiple master fonts need to have the Axis defined. You enter the numbers between brackets, the first indicates the custom font weight (700) and the second the width (600). The remainder of the definition is the same as normal fonts. Axis: [700,600] |
Historically leading meant the amount of lead strips to be added between the lines of type (composed of letters cast in lead) to create the desired extra space between lines of text. So from an historic perspective leading means the amount of space (usually in points) between the top of one line and the baseline of the line above. This classic interpretation is also the one the PageDNA system uses.
Most desktop publishing applications use the term Line Height as a loose synonym for leading. This is the concept of leading that you're probably used to.
The PageDNA system allows you to enter the leading for your items in two different ways. These can be found on the Fonts tab of any item's Style page.
For example, if a font is 8 point and you wish to have 10 points of line height and you prefer the traditional use of leading, you would select the icon to the right and enter 2 in the Leading field (10 - 8 = 2).
If you wish to define the leading as meaning line height, thus the sum of the font size and the extra space above the font, then select the icon on the left and enter the total size of the leading you wish to use. Using the same values as the example above, you would enter 10 in the Leading field. That would represent 2 points of space above the 8 point font size ( 8+ 2 = 10).
Both methods will result in the same amount of space between lines. This feature simply allows a builder to enter a value for leading in terms that are most familiar to them.
Sometimes when you import type using a file with special kerning (intra-letter spacing), our engine finds many different tracking values and gets over-zealous defining fonts.
F1 FONT Optima, 7.5 - 0.0, 5.0, C1 F2 FONT Optima, 7.5 - 0.0, -95.0, C1 F3 FONT Optima, 7.5 - 0.0, -55.0, C1 F4 FONT Optima, 12.0 - 0.5, -30.0, C1 F5 FONT Helvetica-Black, 9.75 - 1.25, 5.0, C1 F6 FONT Optima, 7.5 - 1.5, 0.0, C1 F7 FONT Optima, 7.5 - 0.0, 10.0, C1 F8 FONT Optima, 7.5 - 0.0, 0.0, C1
As you can see, there is a crazy variation in the tracking value between fonts, many of which have the same font size - 7.5 points for F1, F2, F3, F6, F7, and F8..
Now, take a look at the blocks section (double click the block) - examine how often the fonts are switching out (every line!):
LEFT, F7, card_title3, NEWLINE,
F7, card_title4, NEWLINE,
F4, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '), name_last, IF(', ', name_suffix), NEWLINE,
F5, card_title2, NEWLINE,
F6, card_street1, NEWLINE,
F8, card_street2, NEWLINE,
F2, card_city, ', ', card_state, ' ', card_zip, NEWLINE,
F1, IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
F1, IF(ph3_label, ' ', Phone3Word), NEWLINE,
F1, IF(ph4_label, ' ', Phone4Word), NEWLINE,
F1, IF('E-mail: ', card_email), NEWLINE,
F1, IF('Website: ', card_www), NEWLINE,
...that would be very unusual to change fonts every line like this - when you see this, you need to investigate further.
Those fonts with the same font size (first number) and leading (second number) but with a varied tracking (third number) likely can be (and should be) consolidated into a single font (perhaps with 0 tracking, as would be the norm, but check the original artwork specs from customer).
Font consolidation is done by performing the following steps:
Check specs if there is any special tracking.
Choose which font in the fonts tab will be the 'real' one wherever you see variations in type tracking (but make sure you only consolidate where the font face, size and leading are the same).
Standardize on that new font, both in the Blocks section AND in the Phones tab of the style editor by swapping out the now obsolete fonts with the new standard.
Then, you can carefully delete the now-unused fonts from the 'fonts' section.
Save and test carefully.
![]() | Tip |
|---|---|
You may also need to check the Phones section of the style for font usage. Make sure that the fonts used in the Phones section are defined on the fonts tab. Phonewords contain font definitions which are not overridden by the fonts in the Blocks section. |
VIPER needs a local copy of any PostScript or TrueType fonts used in your template in order to create an accurate proof. Please note that fonts are only used for the creation of the proof – you must own your own copy of all fonts for local use in production.
To see if the fonts you wish to use are already installed on our server, visit the Font Loader from the Production Hub at this URL:
http://www.nationsprint.com/hub/font/
Click on "text" Show Fonts to view a full listing of all installed fonts, listed by PostScript name. If you do not find your font here, you will need to upload your font to our server. For information on uploading fonts, see our Appendix "Uploading Fonts".
Adobe Illustrator measures tracking with a unit that is 1000ths of the width of an em dash (the long dash – as used here). If you use any value greater than 5 (or less than negative 5) for your tracking, VIPER will assume you are using this type of tracking measurement. The following font would be slightly stretched out, with 50/1000ths of an em dash added between each character:
F1 FONT Helvetica, 10 - 1.0, 50
QuarkXPress measures tracking using its own units. We have provided a translation for this system which you can access by using the ‘Qtracking:’ field in the font form. Note if you provide a value for qtracking (other then None), qtracking will have preference over tracking.
Lastly, you can define tracking using a simple points system. Any tracking numbers less than 5 are counted in this fashion.
![]() | Tip |
|---|---|
Occasionally, designs may use Horizontal and/or Vertical scaling on a font to stretch or squish the characters. VIPER supports these options using the 'hscale' and 'vscale' attributes. Information on forcing upper or lower case is shown in the "Forced Case" section of the "Configure custom typesetting rules" below. More information on advanced subjects (Multiple Master fonts, custom colors, vertical and horizontal tracking) will be included in a later version of this document. If you have any questions about advanced typography support, please do not hesitate to contact PageDNA technical support. We have likely seen everything and anything you may come across in a Corporate Identity Template and are here to help you. |
If your need small-caps formatting on a font, you need to define a new font for this using SCFONT. The special setting is the Algorithm field. It can be LINEAR, NONLINEAR and a floating point number less then 1. LINEAR algorithm method means the small caps are the same aspect ratio as caps, NONLINEAR make the small caps a little wider. Finally if you want to control the ratio of the height between the caps and the small caps, then use a number, like 0.85. The other settings are the same as for FONT. Small caps are listed like the following example. Note that not all settings are in the listing, i.e. Algorithm is not in the listing.
F4 SCFONT Helvetica, 9.0 - 0.0, 0.0
![]() | Note |
|---|---|
This section focuses on defining blocks. Although we will indicate how to see and edit the block content this section is not the place to learn about the VSE features. Read the chapter "SEG and VSE Reference". for that. |
Each block of text you identified while gathering requirements will require its own block definition.
Click on the "Blocks" tab in Visual Style Editor. You will see a few blocks already created for the sample business card. These are merely provided as examples for you to copy and modify.
Selecting Blocks:
You can select a block three different ways:
Use the Blocks tool and double click on the block in the list to edit it.
Use the Next tool with the green arrow to cycle through the blocks to select it and then click the Edit tool with the pencil to edit the block.
You can double click directly on the block to edit it.
![]() | Caution |
|---|---|
If you double click on a block, you do run the risk of moving it, which would change its position when typeset. If you do this, you can click the Revert button on the right to revert to the last saved version of the style. You will lose any edits you have made. |
![]() | Tip |
|---|---|
If you use the Blocks tool in the grey toolbar to open the Block List window to select a block and edit it, you can select another block in the Block List window to view its contents. |
![]() | Caution |
|---|---|
If you edit a block and switch blocks using the Block List window, you will lose your edits. So, select the block to edit; switch blocks to examine another block; then, switch back and make the needed edits. |
Let's look at the AddressBlock block. It is the block at the left and you can look at
the content by clicking on the block ( the border turns blue ) and then click the
button ("Edit a
block") in the tool bar. Or you can just double click the block. An edit window pops up
which looks like this:
F1, card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state, ' ', card_zip
This reads as follows: use font F1 ( defined on the fonts tab ), use the variable card_division and start a new line. Lets look at the line that says: "card_city, ', ', card_state, ' ', card_zip", where the only difference is that we have some static text between the variables. We need this here because otherwise the proof would show the values for card_city and ard_state right next to each other without a comma or any spacing. You can include hard-coded strings of text using quoted text wherever necessary.
Keep in mind that the order of quotes, and commas within your block definitions is extremely important. All static text or string must be inside quotes and the commas are used to separate variables and strings from each other. And again, if you need a literal comma, you need to make it part of a string, as in the example above.
Lets explore this block in detail so as to understand how blocks work in general. The block is first defined with a unique name; in this case it is called "AddressBlock". You can call your blocks whatever you want, as long as the name makes sense to you and contains no spaces or non-alphanumeric characters.
In this example, first the font within the block is set to "F1". Then we begin naming fields and adding NEWLINE after them. These field names come directly from the form inputs on the IMPRINT page in the ordering process. To find the name of a form field or variable browse the list at the right of the edit area. Note that clicking on a variable name in that list will insert the variable in the edit area at the cursor position, including a trailing comma for your convenience. The font names and the icons above the edit area will insert at the cursor as well.
See also Appendix C, "Form Field Name Reference" for the official listing.
If and only if a particular field is included by the end user when ordering will that field appear in this block and be followed by a NEWLINE (carriage return). If a field is not included, the NEWLINE following it is not used in the block. For example, if the user’s imprint address does not include a third Street Address line (card_street3), this field and it’s NEWLINE will not be included in the block.
Before we move on to the next topic, let's briefly cover the tool bar, search/add input
box and the variable list of the edit window. The font links (like F1) and the align icons
you see in the tool bar as well as the variables in the list at the right all help you
inserting text in the text box. Clicking any of these will insert them at the cursor,
including a trailing comma. For instance, clicking on "F1" will insert
F1, at the cursor. If some text was selected this text will be
replaced. Clicking the paragraph icon inserts NEWLINE, at the cursor,
while clicking the left align icon inserts LEFT, at the cursor. And no
surprise, clicking "city (card_city)" in the variables list will insert
card_city, at the cursor.
The search/add input box serves two functions: quick search of variables and adding plus inserting variables. If you type a existing variable in the box, the list is shortened to only include the variables that match the text in the box making clicking the right one easier. If you type in a not yet existing variable, the list goes away and you can add/insert that new variable by clicking on the small "+" button next to the input box. This will do three things: inserts this new variable at the cursor in the block content, add this new variable to the variables list below the input box and this new variable is added to the "Variables" tab.
Besides the edit window for text blocks there is the photo block edit window. There is
also a photo block create window, accessible by clicking the
"Make a new photo block"
icon, and the photo create window is almost identical to the photo edit window. You access
the photo edit window by selecting a photo block and clicking the pencil icon or just double
clicking a photo block.
In the photo block edit window you can edit properties for the block.
Next lets examine a block that includes some simple logic. The NameBlock is shown below, with the new elements highlighted:
F4, CENTER, name_first, IF(' ', name_middle), ' ', name_last, IF(', ', name_suffix), NEWLINE, F3, card_title1, NEWLINE, card_title2
This block includes an "IF" statement for the middle name and suffix. If and only if the user submits a middle name while ordering, the IF condition will evaluate as true and the middle name will be included – with a blank space before it. If the middle name is not included, everything inside the parenthesis is ignored. Note this logic will not cause any errors if your site does not include a middle name field on the IMPRINT page.
The same type of statement is included for the suffix (e.g., ‘Jr.’, ‘Ph. D’), except that a comma is included before the space. In this fashion, you can use IF blocks like this to quickly build ‘molecules’ out of the ‘atomic’ form units.
The last block on this item is "PhoneEmailBlock", which consists of phone numbers and the email address.
F1, RIGHT, Phone1Word, NEWLINE,
Phone2Word, NEWLINE,
Phone3Word, NEWLINE,
Phone4Word, NEWLINE,
Phone5Word, NEWLINE,
card_email
This block is unique because it uses something we call Phones for the phone fields. Phones act similar to form fields, but are defined in the Phones tab (explained later in this document). Phones are used to make styles more readable. The Phone words are highlighted below:
F1, RIGHT, Phone1Word, NEWLINE, Phone2Word, NEWLINE, Phone3Word, NEWLINE, Phone4Word, NEWLINE, Phone5Word, NEWLINE, card_email
Finally you can enable two extra tabs in the VSE, one before the "Blocks" tab and one after. These tabs are called, no surprise, "Preblocks" and "Postblocks". If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. The purpose of these tabs is to allow you to add Python code for a little more advanced usage of logic in your style. Examples that use these tabs are in the chapter: "Typography Exceptions, New User Interface".
It is possible to have type line up in columns. This is sometimes used in phone blocks to force the phone number digits to align in a vertical column, despite the fact that the phone labels before the number (e.g., "Main", "Direct", "Mobile") vary in length. Following is an example block illustrating the usage of the "COL" command for a scenario like this:
F2, LEFT, ph1_label, ' ', COL, Phone1Word, NEWLINE, ph2_label, ' ', COL, Phone2Word, NEWLINE, ph3_label, ' ', COL, Phone3Word, NEWLINE, ph4_label, ' ', COL, Phone4Word, NEWLINE, ph5_label, ' ', COL, Phone5Word, NEWLINE, IF('E-mail:', ' ', COL, card_email)
No matter how long the phone labels are, the PHONEWORDS and email address (card_email) will align vertically in a column – at a location within the line specified by the COL command. In this case, the longest phone label (or the text "E-mail", if it is the longest label) will determine where the column is defined on this left justified block.
A more precise way of aligning text is uses TABS, which can be defined at specific locations in your document. The following example block defines a tab:
F2, LEFT, ph1_label, TAB, Phone1Word, NEWLINE, ph2_label, TAB, Phone2Word, NEWLINE, ph3_label, TAB, Phone3Word, NEWLINE, ph4_label, TAB, Phone4Word, NEWLINE, ph5_label, TAB, Phone5Word, NEWLINE, IF('E-mail:', TAB, card_email)
To set the tab at a precise location, 160 points from the left side of the card, you need to set the tab value.
Taking things one step further, one way to improve the block definition further would be to wrap each phone (label, tab and phone word) in an IF statement. This will ensure that phone labels do not appear in the imprint unless the end user has entered the corresponding phone number:
F2, LEFT, IF([ph1_label, TAB], Phone1Word), NEWLINE, IF([ph2_label, TAB], Phone2Word), NEWLINE, IF([ph3_label, TAB], Phone3Word), NEWLINE, IF([ph4_label, TAB], Phone4Word), NEWLINE, IF([ph5_label, TAB], Phone5Word), NEWLINE, IF(['E-mail:', TAB], card_email),
Phones are used for putting together phones, using a specific word type called a PHONEWORD. Click on the "Phones" tab to edit all of the phones currently defined for your Style. The default templates included on all new sites include six PHONEWORDs.
PHONEWORDs combine dynamic form inputs (text entered by the user) along with static fields into a predetermined format. The various phone elements taken from the IMPRINT screen of the ordering site are first listed:
ph1_label, ph11, ph12, ph13, ph1_ext_lbl, ph14
With this form you can set the various setting that your Phone Word will use: the font, whether or not to use a label and the separator character between label and number part of the phone, the extension label and extension separator, and finally the pattern for the numbers of the phone.
Note that it is important to select the right "Phone Type" first.
All Phone Words use the default font, except when you set the PhoneWord in the "Font Exceptions". For the setting for the "Phone Label" you can select it from the list or if your setting, i.e. the desired separator, is not in the list you select "Other..." from the list and fill in the separator character in the next to the select box.
The setting for the "Extension Label" works the same way: either select from the list or use "Other..." to enter a new separator. If you have a US phone number, you can set the pattern for the number as a text string. In the pattern the numbers are represented by a *, the other characters are literal characters used as separator characters for the imprint of your phone number. Note you must have 3 stars in your pattern string.
Suppose the label for Phone 1 (ph1_label) on your site was hard coded to "Main: " and the Phone Extension Label (ph1_ext_lbl) was "Ext." In addition to that suppose your "Phone Label" and "Extension Label" were set to a colon and a space and the "US Format" to "(*) *-*". Then this number would be formatted within this PHONEWORD to give the following example imprint:
Main: (555) 555-1212 Ext. 1234
By changing the format used, you can make the phones match the corporate identity standards for phones. For example, if you want your phone number to appear with dots between the area code and phone digits, like this: "555.555.1212", you would merely change the US format to "*.*.*" and you will get the imprint as below:
Main: 555.555.1212 Ext. 1234)
To add a (sub-)logo to your Style use the "Make a new photo block" option
in the tool bar of
the blocks tab. This allows you to upload an EPS file containing an image. Ensure that your
EPS file has been converted to paths, that the EPS file is the same size as your document,
and that the EPS file is placed correctly within this document. After clicking the Save
button the EPS file is uploaded and will show as a block in your Style.
If you created an image representing the master or pre-printed "shell" for your item, you add a block in the same way as in the previous paragraph. The only difference is that you set the layer setting to PREVIEW_LAYER. This means that your image will show on the proof, but it will be omitted from in the output going to the printer.
Sometimes, in custom situations, you may only want a particular EPS file to appear at certain times (example, if the user has checked a box requesting a sub-logo on their business card). This would qualify as a custom typesetting situation. Read more below about how to accommodate custom typesetting situations for more information on how to proceed, or contact PageDNA support for assistance.
![]() | Dealing with Double-Sided Items |
|---|---|
Occasionally, you may need to include an item on your site that has a back side. To accomplish this, you will need to create a separate item and style for the backside. Make sure that both items use the x_item_class 'SosBackItem'. Define the tag for the backside as 'tag_back.sty', where "tag" is replaced by the name of the tag for the front side. In other words, if the tag for the front side is "bc", the backside's tag must be "bc_back". Of course, the style file will be bc_back.sty for the backside. That is half of the battle: making two styles show up for one item. The other part of the battle is making fields for the backside, where necessary. If your backside has hard-coded information or includes only information from the standard SOS forms, you are in great shape, just build the style as if it were a new item. If you need custom fields for the backside, the general approach is to make a custom item form (see Item Forms section for more information). Contact PageDNA support if you have any questions about this or any other aspect of creating double-sided items. |
Table of Contents
At this point, if you have followed the "Gathering Specifications" instructions closely, you should have most – if not everything – you will need to begin programming your Style. Yes, creating a Style is technically considered programming, and this programming is accomplished using a programming language called Python that is easy to learn. If you want more information on Python, a great resource is the online Python documentation at:
http://www.python.org/doc/2.4.3/
The following link – taken from the tutorial found above – is to an informal introduction to Python.
http://www.python.org/doc/2.4.3/tut/node5.html
PageDNA has simplified the Style-building task by providing a web-based tool called Style Editor Gold – or "SEG" for short – that lets you edit Style files in an organized fashion. SEG is the tool to get to know to create, test and deploy Style files quickly and efficiently.
SEG is accessed through the Site Configuration Menu. After logging into the Production Hub, visit your "Sites List" to choose an existing site you wish to work on. Alternatively, you can create a new site exclusively for the purposes of learning to build Styles or for a new client.
Within the Menu for your site, you should see a link for "Style Editor Gold" within the "Site Content" section of the menu listing. If you do not see this option, contact PageDNA and we will quickly set you up with access to SEG. Click the "Style Editor Gold" link to open the application.
The first thing to try when creating a new style is to use something we call "EGG". EGG stands for "Excellent Graphics Grabber" and is key PageDNA technology which accepts a 1-up EPS file of your item and then 'reverse engineers' the layout to create a style file, including automatically determining variables, font settings, block position, custom colors, etc. This can save hours of work, and often only requires minor hand-edits to complete the style building process.
To try EGG, first prepare an EPS file with a bounding box matching the product dimensions of your product. For example, a business card would normally be 3.5 x 2 inches - your bounding box needs to have these same dimensions for EGG to be able to figure out your product. Creating a bounding box is as simple as making your document size the same as the product size and adding a box with no stroke or fill that matches the document size.
For some example artwork prepared to proper specifications, see the Training Files Repository at http://www.PageDNA.com/files/
Although your artwork files may be in a variety of source formats (InDesign, Quark, etc) our system strongly prefers to 'digest' EPS files generated by Illustrator. Therefore, if your native file is not yet in Adobe Illustrator EPS format, first save an EPS file out of the current application, then open that EPS file in Illustrator and re-save as EPS following our instructions below.
If you have pre-printed 'shells' that will later be imprinted with this artwork, you may include this in the "EGG" file, but be sure to convert any text in this layer to paths/outlines, leaving variable imprint information as editable text objects.
Now editing in Illustrator, your first and make sure the bounding box represents the exact size you want to get transparent (no stroke, no fill). Save this file in EPS format with no thumbnail and include any fonts.
For detailed instructions on artwork preparation see our EGG Artwork Preparation Guide (link below) - these instructions cover saving an "EGG-ready" file from versions of Illustrator up to version CS 2.
http://www.nationsprint.com/hub/docs/html/SpecificationForms/artwork-prep.html
Now that you have your EPS file saved out, open Style Editor Gold and select "From EPS File..." from the bottom of the drop-down list, and then click the "Edit" button.
A dialog box will open in the frame below, giving you the ability to "Browse" your hard drive and locate your EPS file. In the "Style Name" field, make sure to name the product something unique, ending in the extension '.sty'. Ideally, you have already created the item in the 'Item List', and you will name your style file to match the 'tag' for that particular product. For example, if you business card has the tag 'bc', name your style 'bc.sty'.
After you "Submit" your EPS file, EGG will try it's best to reverse engineer the style from the file you've submitted. If an error occurs (ie, Fonts not loaded), you may simply click "Back" and try again after making changes such as loading any fonts our system is missing.
EGG will 'guess' on a block's positioning (ie, left justified, growing from the bottom up). If EGG has guessed wrong (which happens), the Block Editor a chance to change this with a visual display of the blocks and their anchor points.
Although there is usually a bit of cleanup to perform with EGG - ie, standardizing fonts, adding field names into the style that were missed by egg, etc - EGG is highly recommended as it saves you a TON of work in creating your style file.
![]() | Tip |
|---|---|
Make sure that you do not have custom kerning (spacing between letters) defined in your style. Egg will look at each different font usage and define a new font... this makes cleaning up the style later more complicated. |
![]() | Tip |
|---|---|
EGG automatically looks for patterns such as name, title, phones, emails and so forth and then converts them to the proper variable names in our system. If you don't want our system to have to 'guess' variables you can simply pre-populate the fields in your EPS file using the PageDNA variable name surrounded by brackets, e.g.,: [card_title1] ...would be recognized as the title line one for this product. Variable names are shown in green text in the "Personal Page" section of "Web Page Templates" if you need to learn the variable name for a particular field. |
New PageDNA sites by default include three default Styles, bc.sty (Business Card), env.sty (Envelope), and lh.sty (Letterhead). These templates are pre-populated with information that should help you jump-start Style building – in particular for the business card. It is recommended that you start one of these templates, or use Egg as above to get a style started. Select "bc.sty" from the menu at the top of the screen and click "Edit" to open the Style. You will be presented with the opening screen, shown in Figure 2 below:
Notice the gray "tabs" running along the top of the gold area of the screen. Clicking one of these tabs opens one section of the Style file for editing. We will be focusing our attention on only a few of these tabs, but following is an overview of all of the tabs for your reference. Explore these tabs by clicking on each individual tab as you read the description below. At this time, do not make any changes to the information found within each tab you explore, but scroll around and briefly examine the code found inside. You do not need to understand this information yet – the idea is to familiarize yourself with how the Style code looks:
This information controls how proofs are displayed to end user, including which combine image (virtual master) to use, how large to show the item to the end user, which areas to "zoom into" for a close-up proof, etc.
This section contains a list of all of the variables VIPER is passed from the online forms. The values are defaults, which will be used if the online form does not pass a value. This section is generally not changed unless you need to hard-code a value, or add new a variable.
This is no longer used, but is included for older sites using previous versions of PageDNA software. Lines are now created within Blocks.
This is a very important section, wherein each font to be used in your Style is defined. We will explain this information shortly.
If your Style requires custom logic, this is one of the places you can put this information. Custom logic is covered later in this document.
In practice, the Words tab is used to "build" Phone imprint information from data provided by the end user. Most Words are created directly within Blocks.
This is one of the most important Tabs in SEG. Herein you will define the blocks of text for your items and assign fields to these blocks.
This tab is where you define your document Page Size. There are also other features that are used occasionally found here.
This seldom-used tab is for defining fixed graphic features like lines.
The buttons to the right of the editing area allow you to Save and Test your Style.
In general, keep in mind that you only need to click the "Save" button when you are ready to publish your changes to your ordering site. Up until you click "Save", everything is saved in a cache – a temporary holding zone where you are free to experiment. Clicking between tabs automatically saves the changes you’ve made to the cache. If you do not click "Save" when finished editing, your changes will be discarded.
Now that you are familiar with navigation within Style Editor Gold, it is time to jump in and actually start building a Style file.
Click on the "Other" tab within SEG. You will see a text input for "page size". Enter the value you measured – in points – into this field in the format: (width, height). If you are building a Style for a standard business card, the value for this field will be: (252, 144).
![]() | Tip |
|---|---|
You will notice some links below this input area named "bc", "lh", etc. Clicking one of these links will fill in the appropriate value for a standard sized Business Card (bc), Letterhead (lh), Envelope (evp), etc. |
Now we will need to define fonts. Click on the "Fonts" tab. You should find a list of fonts already defined. These are provided as examples for you to modify. Each font you identified within your document will need its own font definition. Fonts are defined using the following format:
FontLabel = FONT(‘Name’, Size, Leading, Tracking)
For example, the following font definition defines the font called ‘F1’ as 12 point Palatino Italic with 12 point leading and default tracking:
F1 = FONT('Palatino-Italic', 12, 0, 0)
Each font you define will require a distinct font label ( "F1" in the example above). We recommend using the F1, F2, F3, ... convention as it is very easy to remember and identify when used in other parts of the Style. Your next font would therefore be named "F2", and so on. Fonts can be defined in any order.
The Name of the font must be recorded as the formal PostScript format name. Adobe Type Manager, when showing the details of a font, shows "PostScript name" as one field. This is the field you will need to specify when defining your font. Alternatively, it is possible that we already have the font your document uses installed and you can get the name from our fonts listing. Read the next section for more information.
![]() | Tip |
|---|---|
VIPER defines Leading as the vertical space above the top of a line of type. Most desktop publishing applications (e.g., Illustrator) measure Leading as the total vertical distance between lines. A quick way to convert Leading into VIPER terms this is to simply subtract the font point size from the provided Leading value to get the VIPER leading value. For example, an 8-point font with 9.5 points Leading (in Illustrator terms) will become an 8-point font with 1.5 pt VIPER leading. Similarly, a 12-point font with 10 point Leading would have VIPER leading of –2. A VIPER leading value of 0 sets the leading to the same number of points as the point size. |
![]() | Tip |
|---|---|
Tracking is defined as the space between each character in a line of type. There are a number of different conventions used in the desktop publishing world for measuring tracking values. PageDNA has support for three different systems. This may seem a bit confusing, but in the end this gives you the ability to enter tracking values from a number of different programs. Read on for the full scoop: |
![]() | Tip |
|---|---|
When using expert fonts, use NONISOFONT instead of FONT in your definition. |
![]() | Tip |
|---|---|
Multiple master fonts are defined as shown below. The number in brackets indicates the custom font weight (700) and width (700). The remainder of the definition is the same as normal fonts.
F1 = MMFONT('MyriadMM', 9, [700,600], 1.5)
|
Historically leading meant the amount of lead strips to be added between the lines of type (composed of letters cast in lead) to create the desired extra space between lines of text. So from an historic perspective leading means the amount of space (usually in points) between the top of one line and the baseline of the line above. This classic interpretation is also the one the PageDNA system uses.
Most desktop publishing applications use the them Line Height as a loose synonym for leading. This is the concept of leading that you're probably used to.
The PageDNA system allows you to enter the leading for your items in two different ways. These can be found on the Fonts tab of any item's Style page.
For example, if a font is 8 point and you wish to have 10 points of line height and you prefer the traditional use of leading, you would select the icon to the right and enter 2 in the Leading field (10 - 8 = 2).
If you wish to define the leading as meaning line height, thus the sum of the font size and the extra space above the font, then select the icon on the left and enter the total size of the leading you wish to use. Using the same values as the example above, you would enter 10 in the Leading field. That would represent 2 points of space above the 8 point font size ( 8+ 2 = 10).
Both methods will result in the same amount of space between lines. This feature simply allows a builder to enter a value for leading in terms that are most familiar to them.
Sometimes when you import type using a file with special kerning (intra-letter spacing), our engine finds many different tracking values and gets over-zealous defining fonts.
C1 = CUSTOMCOLOR('Blue-01', 1.00, 0.80, 0.00, 0.00, tint=1)
F1 = FONT('Optima', 7.5, 0.0, 5.0, color=C1)
F2 = FONT('Optima', 7.5, 0.0, -95.0, color=C1)
F3 = FONT('Optima', 7.5, 0.0, -55.0, color=C1)
F4 = FONT('Optima', 12.0, 0.5, -30.0, color=C1)
F5 = FONT('Helvetica-Black', 9.75, 1.25, 5.0, vscale=0.7692308, color=C1)
F6 = FONT('Optima', 7.5, 1.5, 0.0, color=C1)
F7 = FONT('Optima', 7.5, 0.0, 10.0, color=C1)
F8 = FONT('Optima', 7.5, 0.0, 0.0, color=C1)
As you can see, there is a crazy variation in the tracking value between fonts, many of which have the same font size - 7.5 points for F1, F2, F3, F6, F7, and F8..
Now, take a look at the blocks section - examine how often the fonts are switching out (every line!):
Block1 = DWIMBLOCK([LEFT,
F7, card_title3, NEWLINE,
F7, card_title4, NEWLINE,
F4, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '), name_last, IF(', ', name_suffix), NEWLINE,
F5, card_title2, NEWLINE,
F6, card_street1, NEWLINE,
F8, card_street2, NEWLINE,
F2, card_city, ', ', card_state, ' ', card_zip, NEWLINE,
F1, IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
F1, IF(ph3_label, ' ', Phone3Word), NEWLINE,
F1, IF(ph4_label, ' ', Phone4Word), NEWLINE,
F1, IF('E-mail: ', card_email), NEWLINE,
F1, IF('Website: ', card_www), NEWLINE,
], (112.5, 9.3), (LEFT, BOTTOM))
...that would be very unusual to change fonts every line like this - when you see this, you need to investigate further.
Those fonts with the same font size (first number) and leading (second number) but with a varied tracking (third number) likely can be (and should be) consolidated into a single font (perhaps with 0 tracking, as would be the norm, but check the original artwork specs from customer).
Font consolidation is done by performing the following steps:
Check specs if there is any special tracking.
Choose which font in the fonts tab will be the 'real' one wherever you see variations in type tracking (but make sure you only consolidate where the font face, size and leading are the same).
Standardize on that new font, both in the blocks section AND in the phones tab of the style editor by swapping out the now obsolete fonts with the new standard.
Then, you can carefully delete the now-unused fonts from the 'fonts' section.
Save and test carefully.
![]() | Tip |
|---|---|
You may also need to check the Words section of the style for font usage. Phonewords contain font definitions which are not overridden by the fonts in the Blocks section. |
VIPER needs a local copy of any PostScript or TrueType fonts used in your template in order to create an accurate proof. Please note that fonts are only used for the creation of the proof – you must own your own copy of all fonts for local use in production.
To see if the fonts you wish to use are already installed on our server, visit the Font Loader from the Production Hub at this URL:
http://www.nationsprint.com/hub/font/
Click on "text" Show Fonts to view a full listing of all installed fonts, listed by PostScript name. If you do not find your font here, you will need to upload your font to our server. For information on uploading fonts, see our Appendix "Uploading Fonts".
Adobe Illustrator measures tracking with a unit that is 1000ths of the width of an em dash (the long dash – as used here). If you use any value greater than 5 (or less than negative 5) for your tracking, VIPER will assume you are using this type of tracking measurement. The following font would be slightly stretched out, with 50/1000ths of an em dash added between each character:
F1 = FONT('Helvetica', 10, 1, 50)
QuarkXPress measures tracking using its own units. We have provided a translation for this system which you can access by using the ‘qtracking=’ tag within the Tracking definition area. If the Quark tracking value were set as 50 within the Corporate Identity Template, you would define your font as:
F1 = FONT('Helvetica', 10, 1, qtracking=50)
Lastly, you can define tracking using a simple points system. Any tracking numbers less than 5 are counted in this fashion. If you want the letters in a font slightly closer together, you might specify:
F1 = FONT('Helvetica', 10, 1, -.15)
![]() | Tip |
|---|---|
Occasionally, designs may use Horizontal and/or Vertical tracking on a font to stretch or squish the characters. VIPER supports these options using the 'hscale' and 'vscale' attributes:
F2 = FONT('GillSans', 9, 1, 0, hscale=.85)
F3 = FONT('GillSans', 9, 1, 0, vscale=.85)
Information on forcing upper or lower case is shown in the "Forced Case" section of the "Configure custom typesetting rules" below. More information on advanced subjects (Multiple Master fonts, custom colors, vertical and horizontal tracking) will be included in a later version of this document. If you have any questions about advanced typography support, please do not hesitate to contact PageDNA technical support. We have likely seen everything and anything you may come across in a Corporate Identity Template and are here to help you. |
If your need small-caps formatting on a font, you need to define a new font for this using SCFONT, as shown below:
F4 = SCFONT('Helvetica', 9, 1)
Each block of text you identified while gathering requirements will require its own block definition.
Click on the "Blocks" tab in Style Editor Gold. You will see a few blocks already created for the sample business card. These are merely provided as examples for you to copy and modify. The first block looks like this:
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
The formatting shown in this example is not mandatory... it is provided as a suggestion for legibility. However, keep in mind that the order of brackets, parenthesis, quotes, and commas within your block definitions is extremely important. If you leave out or misplace even one of these characters, you will get an ugly error screen – so please be sure to follow the format very closely. If things go wrong, refer back to these example blocks for ‘proper’ formatting.
Lets explore this block in detail so as to understand how blocks work in general. The block is first defined with a unique name; in this case it is called "AddressBlock":
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
You can call your blocks whatever you want, as long as the name makes sense to you and contains no spaces or non-alphanumeric characters. This block is specified as a "DWIMBLOCK", which stands for "Do What I Mean Block". This is a funny name for the standard block format that you will use when building Styles.
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
All of the block definition information is contained within the parenthesis following the DWIMBLOCK statement. The first bit of information for a block definition is a list of all fields to include within the block, which are comma delimited and surrounded by the square brackets:
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
In this example, first the font within the block is set to "F1". Then we begin naming fields and adding NEWLINE after them. These field names come directly from the form inputs on the IMPRINT page in the ordering process. To find the name of a form field, simply view HTML source on the IMPRINT page for your site or consult Appendix C, "Form Field Name Reference" for the official listing. You will get to know these names quickly.
If and only if a particular field is included by the end user when ordering will that field appear in this block and be followed by a NEWLINE (carriage return). If a field is not included, the NEWLINE following it is not used in the block. For example, if the user’s imprint address does not include a third Street Address line (card_street3), this field and it’s NEWLINE will not be included in the block.
Following the field card_city, you will notice that the string: ‘, ‘ as highlighted below:
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
This is included so that a comma and a space follow the City field – before the State field is shown. Similarly, you will notice that there is a single space (‘‘) included after the State:
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
This field is included so that a space appears after the State field – before the ZIP code is shown. You can include hard-coded strings of text using this system wherever necessary.
The last two properties in a block definition are the block position and the block alignment. The two numbers in parenthesis indicate the block position, measured from the lower-left corner of the item to the anchor point:
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
The next two words – highlighted below – indicate the horizontal and vertical alignment for this block. In this case, the block is LEFT justified (to 12 points from the left side of the item) and grows from the BOTTOM (14 points above the bottom edge of the item):
AddressBlock = DWIMBLOCK([F1,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip], (12,14), (LEFT, BOTTOM))
Above is about as straightforward of a block as is possible to create.
Next lets examine a block that includes some simple logic. The NameBlock is shown below, with the new elements highlighted:
NameBlock = DWIMBLOCK([F4, CENTER,
name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F3, card_title1, NEWLINE,
card_title2], (126,75), (CENTER, TOP_BASELINE))
This block includes an "IF" statement for the middle name and suffix. If and only if the user submits a middle name while ordering, the IF condition will evaluate as true and the middle name will be included – with a blank space before it. If the middle name is not included, everything inside the parenthesis is ignored. Note this logic will not cause any errors if your site does not include a middle name field on the IMPRINT page.
The same type of statement is included for the suffix (e.g., ‘Jr.’, ‘Ph. D’), except that a comma is included before the space. In this fashion, you can use IF blocks like this to quickly build ‘molecules’ out of the ‘atomic’ form units.
The last block on this item is "PhoneEmailBlock", which consists of phone numbers and the email address.
PhoneEmailBlock = DWIMBLOCK([F1, RIGHT,
Phone1Word, NEWLINE,
Phone2Word, NEWLINE,
Phone3Word, NEWLINE,
Phone4Word, NEWLINE,
Phone5Word, NEWLINE,
card_email], (240,14), (RIGHT, BOTTOM))
This block is unique because it uses something we call Words for the phone fields. Words act similar to form fields, but are defined in the Words tab (explained later in this document). Words are used to make styles more readable. The Phone words are highlighted below:
PhoneEmailBlock = DWIMBLOCK([F1, RIGHT,
Phone1Word, NEWLINE,
Phone2Word, NEWLINE,
Phone3Word, NEWLINE,
Phone4Word, NEWLINE,
Phone5Word, NEWLINE,
card_email], (240,14), (RIGHT, BOTTOM))
It is possible to have type line up in columns. This is sometimes used in phone blocks to force the phone number digits to align in a vertical column, despite the fact that the phone labels before the number (e.g., "Main", "Direct", "Mobile") vary in length. Following is an example block illustrating the usage of the "COL" command for a scenario like this:
RightBlock = DWIMBLOCK([F2, LEFT,
ph1_label, ' ', COL, Phone1Word, NEWLINE,
ph2_label, ' ', COL, Phone2Word, NEWLINE,
ph3_label, ' ', COL, Phone3Word, NEWLINE,
ph4_label, ' ', COL, Phone4Word, NEWLINE,
ph5_label, ' ', COL, Phone5Word, NEWLINE,
IF('E-mail:', ' ', COL, card_email)],
(122,12), (LEFT, BOTTOM))
No matter how long the phone labels are, the PHONEWORDS and email address (card_email) will align vertically in a column – at a location within the line specified by the COL command. In this case, the longest phone label (or the text "E-mail", if it is the longest label) will determine where the column is defined on this left justified block.
Bulleted lists are often used in sales materials. Combining the LINEWRAP command BULLET and COL together with a set of user input lines can create a simple list that looks great.
Block0 = DWIMBLOCK([LEFT, LINEWRAP(newline_indent=COL),
F4,
IF(bullet2, COL, job_req1), NEWLINE,
IF(bullet2, COL, job_req2), NEWLINE,
IF(bullet2, COL, job_req3), NEWLINE,
IF(bullet2, COL, job_req4), NEWLINE,
IF(bullet2, COL, job_req5), NEWLINE,
IF(bullet2, COL, job_req6), NEWLINE,
], (38.9, 456.2), (LEFT, TOP_BASELINE), (432,0))
In the example above the LINEWRAP command has been modified with an extra command to tell the system how to handle newline commands when encountered. The newline_indent (default = 0) has been set to the width of the COL command. The rst of the block is set as normal for the preblocks tab, with each user defined bulleted line having its own variable. The entire block is limited to a max width of 432 points. The LINEWRAP command will then force the line to break at a space bar and wrap to a new line - with an indent that will align the type past the bullet.
In the last section the LINEWRAP command was used to create a wrapped bulleted list. In this section there wil be examples of how to use a SPACER to add automatic indents to free paragraphs of text.
Add this code at the top of your block:
LINEWRAP(newline_indent='', indent=SPACER(9)),
Setting the newline_indent to a null value will keep the soft wrap from spacing over, while setting the indent to a spacer value (measured in points) will indent the first line of any hard return.
Whats happens if the user can enter a hard return into the bulleted list field?
The LINEWRAP command can be set to indent both hard and soft returns equally to keep that same smooth look, or if needbe differently if the first line needs a different look than the rest of the lines in the paragraph
Add this code at the top of your block:
LINEWRAP(indent=29, newline_indent=29),
Above is another way to define the number of points to use for the indent. indent=29 is the same as indent=SPACER(29). With the code above if the line wraps because its too long it will indent 29 points and if the user enters a hard return into the field it will also indent 29 points.
A more precise way of aligning text is uses TABS, which can be defined at specific locations in your document. The following example block defines a tab at a precise location, 160 points from the left side of the card:
RightBlock = DWIMBLOCK([F2, LEFT,
ph1_label, TAB, Phone1Word, NEWLINE,
ph2_label, TAB, Phone2Word, NEWLINE,
ph3_label, TAB, Phone3Word, NEWLINE,
ph4_label, TAB, Phone4Word, NEWLINE,
ph5_label, TAB, Phone5Word, NEWLINE,
IF('E-mail:', TAB, card_email)],
(122,12), (LEFT, BOTTOM), tabs=[160])
Taking things one step further, one way to improve the block definition further would be to wrap each phone (label, tab and phone word) in an IF statement. This will ensure that phone labels do not appear in the imprint unless the end user has entered the corresponding phone number:
RightBlock = DWIMBLOCK([F2, LEFT,
IF([ph1_label, TAB], Phone1Word), NEWLINE,
IF([ph2_label, TAB], Phone2Word), NEWLINE,
IF([ph3_label, TAB], Phone3Word), NEWLINE,
IF([ph4_label, TAB], Phone4Word), NEWLINE,
IF([ph5_label, TAB], Phone5Word), NEWLINE,
IF(['E-mail:', TAB], card_email),
(122,12), (LEFT, BOTTOM), tabs=[160])
Words are mostly used for putting together phones, using a specific word type called a PHONEWORD. Click on the "Words" tab to view all of the words currently defined for your Style. You will see some simple logic, followed by the Word definitions. The default templates included on all new sites include six PHONEWORDs.
Following in an example PHONEWORD for Phone 1:
Phone1Word = PHONEWORD(F1, (ph1_label, ph11, ph12, ph13,
ph1_ext_lbl, ph14), '* (*) *-* * *')
PHONEWORDs combine dynamic form inputs (text entered by the user) along with static fields into a predetermined format. The various phone elements taken from the IMPRINT screen of the ordering site are first listed:
Phone1Word = PHONEWORD(F1, (ph1_label, ph11, ph12, ph13,
ph1_ext_lbl, ph14), '* (*) *-* * *')
And then these fields are sequentially formatted using the portion of the PHONEWORD highlighted below:
Phone1Word = PHONEWORD(F1, (ph1_label, ph11, ph12, ph13,
ph1_ext_lbl, ph14), '* (*) *-* * *')
Note that each form element requires it’s own place in the format, or an error would occur (the above example has 6 elements). If the label for Phone 1 (ph1_label) on your site was hard coded to "Main: " and the Phone Extension Label (ph1_ext_lbl) was "Ext.", this number would be formatted within this PHONEWORD to give the following example imprint:
Main: (555) 555-1212 Ext. 1234
By changing the format used, you can make the phones match the corporate identity standards for phones. For example, if you want your phone number to appear with dots between the area code and phone digits (555.555.1212), you would merely change the PHONEWORD format as highlighted below:
Phone1Word = PHONEWORD(F1, (ph1_label, ph11, ph12, ph13,
ph1_ext_lbl, ph14), '* *.*.* * *')
If you created an image representing the master or pre-printed "shell" for your item, you will need to upload it and add some information to the style file indicating the location of that file along with its properties. PageDNA has developed an automated system for taking care of this aspect of Style building.
Click on the "Previews" tab and then click the "Upload" button on the right panel. Choose "gif" from the drop-down list and then click "Browse..." to locate the GIF image on your local machine. Leave the other settings at their defaults, and then click "Upload" again to upload your image to the server and automatically insert code into the Previews section of your Style. After upload, you will see a message near the top of the gold screen saying something similar to this:
saved in: /home/inet/www/clients//yoursite/con/yourimage.gif Combine /home/inet/www/clients//yoursite/con/yourimage.gif added. scale=2.0
You can click the "Previews" tab to see the code that was added to the Style, but you should be ready to go.
As explained in Appendix B, you will want to upload images that are already sized to the exact resolution you want to display your item to the end user. Assuming you are working on a standard business card, you would be uploading a 7 x 4 GIF file at 72 dpi. If you wish to display your item at a different scale, you may need to change the "scale" field in the "Preview" tab to match the scale of your item.
For example, if you were uploading a letterhead combine image, sized to 70% of the real-world document size, you would change "scale" to 0.7, as shown below:
{
'normal': {
'use_magick': 1,
'combine_scale': 1.0,
'combine': '/home/inet/www/clients//acme/con/bc_backer.gif',
'scale': 0.7,
'combine_offset': (0.0, 0.0),
},
}
EPS files are uploaded in the same fashion as GIF files are, except that "eps" is selected from the drop-down list. Ensure that your EPS file has been converted to paths, that the EPS file is the same size as your document, and that the EPS file is placed correctly within this document. Upon uploading, code will be automatically added so that the EPS file is included in your style.
Sometimes, in custom situations, you may only want a particular EPS file to appear at certain times (example, if the user has checked a box requesting a sub-logo on their business card). This would qualify as a custom typesetting situation. Read more below about how to accommodate custom typesetting situations for more information on how to proceed, or contact PageDNA support for assistance.
![]() | Dealing with Double-Sided Items |
|---|---|
Occasionally, you may need to include an item on your site that has a back side. To accomplish this, you will need to create a separate item and style for the backside. Make sure that both items use the x_item_class 'SosBackItem'. Define the tag for the backside as 'tag_back.sty', where "tag" is replaced by the name of the tag for the front side. In other words, if the tag for the front side is "bc", the backside's tag must be "bc_back". Of course, the style file will be bc_back.sty for the backside. That is half of the battle: making two styles show up for one item. The other part of the battle is making fields for the backside, where necessary. If your backside has hard-coded information or includes only information from the standard SOS forms, you are in great shape, just build the style as if it were a new item. If you need custom fields for the backside, the general approach is to make a custom item form (see Item Forms section for more information). Contact PageDNA support if you have any questions about this or any other aspect of creating double-sided items. |
Detailed coverage of how to deal with various typography exceptions is covered in the next Chapter.
While there are several ways for creating 2-sided items, we recommend the following methods for item creation depending upon the type of information that will go on each side of the item.
Procedure 7.1. To be used if there is variable content on one side of the item and static content on the other.
Start by creating a Single Sided item with variable content as normal and ensure that it is working correctly.
From the Item Editor, click the Edit link for that item. This will take you to the Product Info section
Click the link labeled Change found under the Product Type. This will bring up a popup window. From that window choose Most Common in the drop down of the Item Class Filter and then select Two Sided Variable Imprint SosBackItem. Click the Save button and this will create an additional style called back.sty.
Click on the link for back.sty, and select the radio button for "Create new style"
Use the Browse button to select your EPS file and then save your style using the button at the bottom of the page.
In the Custom link for the item you will find two options under the Back Item section on the page:
a) Send Back Eps will send the EPS file for the back with the order to production.
b) Stack Back Previews will stack the proof for the front style on top of the back style. If deselected, the proofs will appear side-by-side with the one from the front style on the left.
Procedure 7.2. To be used there is variable content on both sides.
Create two Single Sided styles. One will become the front of the item and the other will become the back. Ensure that they are both working correctly before proceeding to the next step.
From the Item Editor, click the Edit link for the item you want to be the front of your finished product. This will take you to the Product Info section
Change the Item Type for the one that you want to be the front of the item to Two Sided Variable Imprint (SosBackItem). Click the Save button and this will create an additional style called back.sty.
Click on the link for back.sty, and select the radio button for "Create new style"
Use the Browse button to select your EPS file and then save your style using the button at the bottom of the page.
In the Custom link for the item you will find two options under the Back Item section on the page:
a) Send Back Eps will send the EPS file for the back with the order to production.
b) Stack Back Previews will stack the proof for the front style on top of the back style. If deselected, the proofs will appear side-by-side with the one from the front style on the left.
Go into the Item Editor and delete the item you used to create the back.sty. The stand alone item is no longer needed, and should not ordinarily be ordered by itself.
When an image or other element on a page touches the edge of the page and goes beyond the trim edge it is said to bleed. It may bleed or extend off one or more sides. PageDNA supports bleeds in our product, and can send a 'full-bleed' image to press while displaying a trimmed product to the user.
The steps for creating an item for a bleed are outlined below.
Procedure 8.1. Instructions for Creating an Item with Bleed
Create An EPS File
To get started, prepare an EPS file for upload in Item Wizard or Item Editor. Make sure your artwork is the 'full-bleed' size, if not make a bounding box to ensure the proper 'full-bleed' size.
Create Standard SosItem
Now create a standard SosItem (variable imprint) for the front side of your product using the Item Wizard (or the Item Editor), per the normal procedure. When you are on the " EPS Egg Upload" screen, click on the "Show Advanced Options" link, this will open a form and towards the top are input boxes for the bleed values (in points). Fill in the proper values, that is the distance from the artwork edge ('full-bleed' size) to the edge of the page size (final, trimmed product size).
After filling in the bleed values, proceed as usual, i.e. select a EPS file to use and continue. The system will process the EPS and set the correct page size and bleed values in the style, and you are done!
Note that if the bleed is set in a style the output send to the printer is the 'full-bleed' size (i.e. the artwork size) and the preview displays the page size (i.e. the final, trimmed product size).
![]() | Tip |
|---|---|
If you made a style that should have bleed but you didn't use the procedure above, you can still get the preview to look right, i.e. showing the finished size instead of the full size. To fix the normal preview go to the Preview tab in Style Editor Gold and click on the "edit" link for the "normal" preview. In the form that appears fill in the following: left bleed value, bottom bleed value, finished product width and finished product height. and click the "Apply" button for the form and save the style after all changes are made. Be aware in this case you do NOT set the bleed or change the Product size in the Page Window in VSE. Also crop marks will NOT work right, so try to avoid this situation if you can. If you really need crop marks and you did not use EGG to create the proper setting for you, see the tip below. |
![]() | Tip |
|---|---|
What to do when you have a style that should have bleed AND you need crop marks, but you didn't use the procedure above? Then here is a fix recipe that is a bit more work. Let me illustrate with an example. Assume we have a business card with a 9 points bleed on all sides. That means full bleed size is 270 by 162 points and the finished size is 252 by 144. To fix this you need to follow these steps:
|
Table of Contents
![]() | Warning |
|---|---|
Note: this chapter is updated to reflect the use of the VSE. However in cases where the VSE misses the functionality to make the examples possible, the code for the old UI is left in place with a warning, like this one, above the example. If you are looking for the documentation of the old SEG UI, please go to "Typography Exceptions, Old User Interface". |
As outlined earlier in the "Gathering Specs" portion of this document, following are examples of custom typesetting situations, including an explanation of how you would accommodate these situations programmatically within a style file.
This document illustrations some of the 'trickier' situations you may encounter with your variable imprint items. We are constantly adding to this section of our documentation to help you in your style building tasks.
Below are some very simple IF logic statements, highlighted inside a sample block for the name and title. We wish to show a space between the first and middle names but only if the user entered a middle name. We also want to show a comma and space between the users last name and their suffix (i.e., 'Ph.D'), but only if they have a suffix for this order.
F4, CENTER, name_first, IF(' ', name_middle), ' ', name_last, IF(', ', name_suffix), NEWLINE, F3, card_title1, NEWLINE, card_title2, NEWLINE, card_division
The IF statements above look at everything inside their parenthesis and do a test. If there is a value in each element separated by commas in its list, it will show everything. Otherwise, it will show NOTHING at all. It is important for this reason to keep IFs surrounding as few items as possible, to ensure that one missing variable doesn't stop anything from showing up.
Another common scenario is needing to have a 'bridge' element appear, but only if both elements were entered by a user. A typical example is that the user may wish to have a bullet appear between two phone numbers, but only if BOTH phone numbers were entered. If only one or the other phone number was shown, then only show that number.
This is a little tricker and cannot easily be handled using IF, so PageDNA developed the JOIN3 construct, which lets you - as you might guess - join three elements together. If both of the 'outer' elements exist, the middle element will appear between the two outer elements. Let's look at an example:
F4, CENTER, JOIN3(Phone1Word, bullet2, Phone2Word), NEWLINE,
In the above example, the two outer elements being JOIN3ed are Phone 1 and Phone 2. The middle element - the bridge element - is the standard PageDNA variable for a bullet surrounded by a single space on each side - namely, bullet2.
If both phones appear, then JOIN3 will insert a spaced bullet in the middle. Otherwise, only one of the phones would appear. In this example, using IFs may have left a space in front of Phone2 or at the end of Phone1, pushing that line slightly out of center alignment. JOIN3 saved the day.
Lastly, you can 'nest' JOIN3s inside one another for dealing with multiple possibilities, such as bullets between any of 3 optional phones, shown below:
F4, CENTER, JOIN3(JOIN3(Phone1Word, bullet2, Phone2Word), bullet2, Phone3Word), NEWLINE,
In the above example the three things joined are the Phone1/bullet/Phone2 construct, the bridge of the spaced bullet, and then Phone 3. No matter what combination of Phone 1, 2 or 3 exist, this will show the bullet in the right spot.
There are many cases where the type on a product is limited by the amount of vertical room available. Following are examples to guide you through various ways you can handle this using VIPER.
Following is an example block wherein the user is allowed a maximum of 3 lines in
their Name/Title block. To enforce this you need to set the fields "Max. lines"
and "Max. message" in the "Settings window" of the block. Go to the
"Blocks" tab. Then you select the desired block by clicking on it (border
becomes blue), in this example it is the name block. Finally click the "Edit a
block's setting" icon,
, and the settings window pops up. In
this example you set "Max. lines" to 3 and "Max. message" to "You
have too many lines in your name/title. You can only have 3 total lines." (without
the quotes though)
F4, CENTER, name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F3, card_title1, NEWLINE,
card_title2, NEWLINE,
card_division
If the user has more than 3 lines, they will not be allowed to proof their items, but instead will see the PERSONAL ("Imprint Information") page again, with the error message displayed at the top of the page. This is the easiest route to take.
Another option is to decrease leading in the block with too many lines. This would essentially "scrunch" the lines to fit inside the allowed space. Let's look at the following example, you see the block content and some code in bold:
F4, CENTER, name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F3, card_title1, NEWLINE,
card_title2, NEWLINE,
card_title3, NEWLINE,
card_division
if len(NameBlock.lines) > 3:
NameBlock.adjust(leading=-1)
The block content is easy, it goes in the blocks edit window, the usual place. But to have a place to put the code, you need to enable "Preblocks" and "Postblocks" tabs, which will allow you to enter custom logic. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
Use the "Postblocks" tab and paste the code from the example above in the text area of the "Postblocks" tab and you are done. Note however that it is very important to have the line "NameBlock.adjust(leading=-1)" indented, this is Python code and the indentation after the colon after the if clause is mandatory
The example above tests to see if there are more than three lines in the NameBlock; if so, leading is decreased by 1 point across all lines for said block. You could go further and configure different rules for different line counts, replacing the bold text above with the below:
if len(NameBlock.lines) == 3:
NameBlock.adjust(leading=-1)
elif len(NameBlock.lines) >= 4:
NameBlock.adjust(leading=-1.5)
Note that the first test checks if the lines are exactly equal to (== means "exactly equal to") 3, setting leading to -1 off default. Then it checks if there are four or more (>= means "greater than or equal to") lines and if so, sets leading at a more aggressive -1.5 from default font settings.
If you need to count lines across multiple blocks, use the following syntax to get that number into the variable 'totallines', which can then be tested as above:
totallines = len(NameBlock.lines) + len(AddressBlock.lines)
You can also set certain lines of type into a set of LINES. LINES are not shown on the item unless referenced in an actual block. This can be useful if you want to check - for example - whether 3 or 4 phones were used by the user in order to make some other change to the style.
In the following example, we will test if more than 3 phones were added by the user, and adjust a vertical spacer depending on which result we get. The default vertical spacer will be 9 points, but we will change this to 6 points when there are more than 3 phones.
To use this method, first you set your type into LINES, which exist in the style but are not actually drawn (yet) on the page. This is useful for getting a count of the total number of lines in a block, before drawing the block. As with the example in a previous section, the following (bold) listing goes in the "Preblocks" tab. This tab is for code and allows you to perform some testing of conditions.If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. So put the following code (in bold) in the "Preblocks" text area:
PhoneLines = DWIMLINES([F4,
IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
IF(ph4_label, ' ', Phone4Word), NEWLINE,
IF(ph5_label, ' ', Phone5Word), NEWLINE,
IF(ph6_label, ' ', Phone6Word), NEWLINE,
])
vertical_pad = VSPACER(9)
if len(PhoneLines) > 3:
vertical_pad = VSPACER(6)
Then create a PhonesBlock and add the variable 'vertical_pad' (though without quotes). You do that by using the text box in the upper right of the block creation window. After adding this variable (it will be inserted as well, you can delete it from the text area if it's in the way) you can put the text as shown in the next listing in the block creation window.
F4, IF(ph1_label, ' ', Phone1Word), NEWLINE, vertical_pad, IF(ph2_label, ' ', Phone2Word), NEWLINE, vertical_pad, IF(ph3_label, ' ', Phone3Word), NEWLINE, vertical_pad, IF(ph4_label, ' ', Phone4Word), NEWLINE, vertical_pad, IF(ph5_label, ' ', Phone5Word), NEWLINE, vertical_pad, IF(ph6_label, ' ', Phone6Word), NEWLINE,
In the above example, we would have 9 points of extra vertical space (added to the normal font leading) if there are 3 or fewer phones. If there are 4 or more phones, only 6 lines of extra space if there were 4 or more phones.
In the following example, we will test if more than 4 lines are included in a block by the user. If so, we will change the default font of F1 to font F2. In the fonts tab, we would configure font F2 to have a smaller point size and perhaps smaller leading.
To use this method, you have to use the "Preblocks" tab. This tab is for code and allows you to perform some testing of conditions. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
To get a count of the total number of lines in a block, you set your type into DWIMLINES, which exist in the style but are not actually drawn (yet) on the page. Setup the DWIMLINES exactly the same as you would your block. The code (in bold) in the listing below goes in the "Preblocks" text area:
PhoneLines = DWIMLINES([F1,
IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
IF(ph4_label, ' ', Phone4Word), NEWLINE,
IF(ph5_label, ' ', Phone5Word), NEWLINE,
IF(ph6_label, ' ', Phone6Word), NEWLINE,
])
contact_font = F1
if len(PhoneLines) > 3:
contact_font = F2
Note that we are setting the default font to F1, but change this to F2 if there are more than three lines in the block. We then need to replace the font definition in the phone words with our new variable name for the font to use: contact_font. This code also goes in the "Preblocks" text area, under the code you already put in:
Phone1Word = PHONEWORD(contact_font, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '*.*.* * *') Phone2Word = PHONEWORD(contact_font, (ph21, ph22, ph23, ph2_ext_lbl, ph24), '*.*.* * *') ...etc...(you need to redefine all six phone words)
Lastly, in our blocks section, we now will also reference this font name. Move to the blocks tab and replace all occurrences of your font name with this variable name, so it looks like the listing below. Don't forget to use the "search/add" input box in the upper right to insert and add the "contact_font" variable. Using this input box will add the variable to the "Variables" tab, without it you will get an error.
contact_font,
IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
IF(ph4_label, ' ', Phone4Word), NEWLINE,
IF(ph5_label, ' ', Phone5Word), NEWLINE,
IF(ph6_label, ' ', Phone6Word), NEWLINE,
The system allows wrapped type to "scale" to fit inside a defined maximum vertical height. This is useful for marketing pieces where bios or other descriptions where different orders may have different amounts of text, all which must fit inside a tight spot on the product.
The example below shows a block of wrapped text, notice the WRAP command. For this to work you need to set the maximum width of the block (like 220 points) and the maximum vertical height (like 50 points) in the settings window of the block.
F1, WRAP, your_big_field, NEWLINE
The font F1 will scale in point size until the text just barely fits the physical size provided by the max width and max height setting. The font will only scale when needed, that is if the text would other wise not fit in the given space.
NOTE: On live sites it is a good idea to keep users "coloring inside the lines" by putting reasonable restrictions on the number of characters allowed in a multi-line inputs (also known as "text area" or "big text field"). Generic Gold docs cover this in more detail - the goal is to not allow users to shrink the fonts so small that they are not legible.
Following is another example where a large number of variables (for a letter) are being forced to constrain inside a maximum height defined by the amount of room available in that letter - in this case, 400 points of vertical width. The maximum width of this block is 500 points wide. If the letter is long, ALL the text will shrink in point size, uniformly, until the text just barely fits inside 400 points of vertical height. This method only works with a single font - in this case, F1 is being used as font.
The block content listed in the program listing below. And you need to set the "Max. Width" and "Max. Height" in the block's settings window. Note "letter_body_text" and "letter_salutation" are custom variables, don't forget to add them.
F1, LINEWRAP, card_street1, NEWLINE, card_street2, NEWLINE, card_city, ', ', card_state, ' ', card_zip, NEWLINE, card_country, NEWLINE, ' ', NEWLINE, letter_body_text, ' ', NEWLINE, letter_salutation, ' ', NEWLINE, name_first, ' ', name_last
Lastly - and least common in our experience - you may wish to move one or more fields to another block in the event that there are too many lines in a particular block. Contact Support for help with this situation.
In many cases, there is a limited amount of horizontal room on a design or part of a design, requiring a change in behavior for the layout to work properly (or giving the user an error message). Following are the most common ways this is dealt with using PageDNA’s VIPER:
F1, RIGHT, Phone1Word, NEWLINE, Phone2Word, NEWLINE, Phone3Word, NEWLINE, Phone4Word, NEWLINE, Phone5Word, NEWLINE, card_email
Suppose the above example is the content of your block. If you set the "Max
Width" of the block to 150 then the block would
scale any line longer than 150 points to fit in 150 points width. Setting the "Max
Width" is done in the settings window of a block: You select the desired block by
clicking on it (border becomes blue), click the "Edit a block's setting" icon,
, and the settings
window pops up. Note that a zero or blank value for maximum height field (Max Height) does
not have any affect on the block, but a any non-zero number will set the Max Height as
well.
In the latest version of the engine, VIPER decreases the point size for the offending line until it fits within the document boundary or defined block width. Another option is to have VIPER scale the line to fit using Horizontal Tracking.
To change the scaling method in your style from point size (default) to horizontal scaling, you go to the "Fonts" tab and set the "Scale Method", it is the last field of the font edit form.
For the following examples to work you need to have a place to put the code, you need to enable "Preblocks" and "Postblocks" tabs, which will allow you to enter custom logic. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
In some situations, you may wish to measure the length of a line, and then give the user an error message if the text they entered does not fit. This is often useful if the corporate identity specifies that you should not use font scaling to make things fit.
For example, to test and see if a particular field entered by the user (card_title1, in this example) is longer than 120 points when set in font F1 - presenting the user with an error message if this is the case - you would use the following syntax in the "Preblocks" tab of our style:
if F1.stringwidth(card_title1) > 120:
COND("Your first title line is too long. Please re-format and try again.")
Note that the conditions to execute are indented two spaces below the line with the 'if' statement.
If you wanted to check a series of fields to see if they were longer than 120 points (in this case, all four title lines), you could use the following syntax:
if max(map(F1.stringwidth,[card_title1,card_title2,card_title3,card_title4])) > 120:
COND("One or more of your title lines is too long. Please re-format these fields and try again.")
Keep in mind that you can limit the number of characters passed into your style using the "Size/Max" control in the "Web Page Templates" interfaces including the "Personal" form and item forms, if present. Restricting users in the form does not cover all cases (such as the name field, which is most often comprised of two fields on the same line - first and last name), but putting reasonable constraints 'upstream' in the ordering interface usually decreases the amount of logic necessary in styles. We then use logic in the styles to catch the remaining exceptions.
F2, LEFT, card_street1, IF(', ', card_street2), NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip, NEWLINE,
IF(ph1_label,' ',Phone1Word), NEWLINE,
IF(ph2_label,' ',Phone2Word)
To ensure that ALL lines of the block in the example above will scale downward if one
or more line is longer than 124, you need to add "Max. width"
and put a check mark before "Uniform line
scaling?" Only then All lines will scale uniformly. You set these values in the
settings window of a block: you select the desired block by clicking on it (border becomes
blue), click the "Edit a block's setting" icon,
, and the settings window pops up.
F1, LEFT, WRAP, card_company, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, ' ', card_state, ' ', card_zip
If you set the "Max Width" to for instance 120 points, the text will wrap naturally where necessary - only if necessary. The system does not handle hyphenation. In the instance above, the block would wrap any lines of text if they exceeded 120 points of width to the next line.
Word wrapping is more commonly encountered on complex Direct Mail items such as invitations, where the requestor might enter a bit of variable text of unknown length. The following example shows a block that might appear on such an item:
LEFT, WRAP, F1, 'To reserve tickets for you and your guest, please call ',
rsvp_phone, ' by ', rsvp_day, ', ', rsvp_mo, ' ', rsvp_dy, ', ', rsvp_yr, NEWLINE,
The above example would show the RSVP text - substituted with the customer's personalization - and wrapped at 372 points.
First, confirm that you are using the most current library for the PageDNA engine by opening your style in Style Editor Gold... visit the 'Other' tab and ensure that sos_module is set to "SOS16". If it is not, change this field and save. You will need to perform this action on each style on which you wish to use word wrapping.
Next, define a maximum block width for your block - see "Forced Justification" above for an example of how this works.
Lastly, add the term 'WRAP' in-line at the beginning of the information in your block and make sure the "Max Width" is set to a appropriate value:
F2, WRAP, card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, IF(', ', card_state), ' ', card_zip
It is possible to configure word wrapping so that the first line is flush left, but then all subsequent lines are intended horizontally, under this first line. This requires a different approach than normal word wrapping. First you need to set each variable as a LINE, and then call these lines from inside your style.
The following example assumes that you have a block with Names and Titles, and you want the titles to wrap if they get too long, but when wrapped to the newline, to have these wrapped lines indented a few spaces. Here is our original block, with word wrapping turned on for any lines longer than 100 points (you need to set max width in block settings):
NameTitleBlock:
F2, WRAP,
name_first, IF(' ', name_last), NEWLINE,
card_title1, NEWLINE,
card_title2, NEWLINE,
card_title3, NEWLINE,
card_title4, NEWLINE,
card_title5, NEWLINE,
Following is the modification necessary to have the titles wrap with indentation. For that to work you need to use the "Preblocks" tab. Reminder: if you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. You add the following code, shown in bold, to the "Preblocks" tab's text area.
if card_title1:
title1_line = LINES(card_title1, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB])
else: title1_line = ''
if card_title2:
title2_line = LINES(card_title2, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB])
else: title2_line = ''
if card_title3:
title3_line = LINES(card_title3, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB])
else: title3_line = ''
if card_title4:
title4_line = LINES(card_title4, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB])
else: title4_line = ''
if card_title5:
title5_line = LINES(card_title5, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB])
else: title5_line = ''
Then you make your block as in the following listing. But since you used the new variables title1_line to title5_line, you need to add all five in the block creation window when creating your new NameTitleBlock. You add a variable in the block edit (or create) window in the text box at the upper right. Also, very important, for the code in the "Preblocks" to work, you must set the "tabs" in the blocks' settings window.
The following lines are the block content, the bold lines are added variables.
F2, WRAP,
name_first, IF(' ', name_last), NEWLINE,
title1_line, NEWLINE,
title2_line, NEWLINE,
title3_line, NEWLINE,
title4_line, NEWLINE,
title5_line, NEWLINE,
Make sure you set the tabs in the settings window:
tabs=[20]
The first bit of logic tests to see if the user has a title for each available field. If it finds one, it creates LINES that wrap if necessary at 100 points (wrap=100) and that wrap's new lines are TAB indented. If no field is present it defines the line as blank, to ensure no errors can occur. The last bit is to make the new variables in your block to reference these new lines (instead of the original variable name), and then lastly to specify a tab stop to intent to. In the example above, the tab stop is 20 points in.
First, we set up the "Preblocks" tab if that tab is not already there. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. Then create two new variables by assigning them a null (blank) value - represented by two single quotes. Next we start our logic examples, testing and splitting certain titles into these two fields. Lastly, we set the block, referring to these two new variable names for title 1's first line (card_title1_1) line 1 and line 2 (card_title1_2). If line 2 is not present, it is ignored by the layout system. See the code below, that goes in the "Preblocks" tab
card_title1_1='' card_title1_2='' if card_title1 == 'Marketing Program Coordinator, Certified Consumer Credit Counselor': card_title1_1 = 'Marketing Program Coordinator' card_title1_2 = 'Certified Consumer Credit Counselor' elif card_title1 == 'Aging Specialist, Social Worker': card_title1_1 = 'Aging Specialist' card_title1_2 = 'Social Worker' elif card_title1 == 'Another Sample Title, Social Worker': card_title1_1 = 'Another Sample Title' card_title1_2 = 'Social Worker' else: card_title1_1 = card_title1
Then set up the block it self, let's call it NameBlock, according to the following listing. Remember, you need to add the bold variables, as shown in the listing below, to the block using the text box in the upper right of the edit or create block window. Make the block content look like the listing:
LEFT,
F1, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '), name_last, IF(', ', name_suffix), NEWLINE,
F2, card_title1_1, NEWLINE,
card_title1_2
This example can be altered to fit many other scenarios. Please note that if you change the titles in the list (even a subtle spelling or capitalization change) you will need to update your style(s) accordingly.
You can turn off word wrapping by inserting the NOWRAP command, as in the following example where we turn off wrapping before the city, state and zip code lines:
F2, WRAP, card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
NOWRAP, card_city, IF(', ', card_state), ' ', card_zip
If using phone numbers with a tabbed leader, please see below for an example with a phone number.
Use a tabbed leader when you need the text to appear as follows:
Introduction ..................... Page 1
Chapter 1 ........................ Page 5
In the "Pre-blocks" section in Visual Style Editor, or at the top of the Blocks section in Style Editor Gold, add this code for static text:
def contentsline(font, content, page, width):
leftover = width - font.stringwidth(content + page)
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, content, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), page]
Block0 = DWIMBLOCK([
contentsline(F1, 'Introduction', 'Page 1', 108), NEWLINE,
contentsline(F1, 'Chapter 1', 'Page 5', 108), NEWLINE,
], (206, 710), (LEFT, TOP_BASELINE))
def contentsline: the variable contentsline can be changed to fit your needs. The definition of contentsline includes font, the left variable, the right variable and the overall width of a line.
leftover: change content and page to match your variables.
ndots: The only thing you may need to change in this line would be the '.' if you are using something else as the tabbed leader
return: change the variables content and page to match yours. You can change the leader from '.' to whatever you need as a tabbed leader.
For each line in the block, the font, text on the left, text on the right and the maximum width of the line of text is specified.
Another example using variable text
def daytimeline(font, day, time, width):
leftover = width - font.stringwidth(day + time)
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, day, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), time]
time1 = [time11_1, ' ', time11_2] + list(IF('–', time12_1, ' ', time12_2))
time1 = ''.join(time1)
time2 = [time21_1, ' ', time21_2] + list(IF('–', time22_1, ' ', time22_2))
time2 = ''.join(time2)
day1 = (day1mo + ' ' + day1dy + ', '+day1yr)
day2 = (day2mo + ' ' + day2dy + ', ' + day2yr)
if not day1mo:
day1 = ''
if not day2mo:
day2 = ''
Block0 = DWIMBLOCK([LEFT,
daytimeline(F2, day1, time1, 300), NEWLINE,
daytimeline(F2, day2, time2, 300), NEWLINE,
], (32, 95), (LEFT, TOP_BASELINE))
def daytimeline: the variable daytimeline can be changed to fit your needs. The definition of daytimeline includes font, the left variable, the right variable and the overall width of a line.
leftover: change day and time to match your variables.
ndots: The only thing you may need to change in this line would be the '.' if you are using something else as the tabbed leader
return: change the variables day and time to match yours. You can change the leader from '.' to whatever you need as a tabbed leader.
time11_2, time12_2, time21_2 and time22_2 represent "am" and "pm"
The first "line" of the definition of each of the times sets the starting and ending times. The second line joins the starting and ending times together in one variable so it can be easily set in the block as a single variable.
The If statements for day1mo and day2mo are designed to prevent the separators between the month, day and year from printing if either of the dates is missing.
For each line in the block, the font, text on the left, text on the right and the maximum width of the line of text is specified.
An example that prevents the tabbed leader from appearing if there is no data
def analysisline(font, analysis, percent, width):
if not (analysis or percent):
return[]
leftover = width - font.stringwidth(analysis + percent)
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, analysis, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), percent]
Block1 = DWIMBLOCK([ CENTER, LINEWRAP,
F1, CASE('upper'), IF(prod_name),VSPACER(5), NEWLINE,
F2, IF(prod_subname), VSPACER(5), NEWLINE,
F3, CASE(None), IF('DESCRIPTION', VSPACER(2), NEWLINE,
F5, descrip), VSPACER(5), NEWLINE,
IF(F3, 'GUARANTEED ANALYSIS', VSPACER(2),NEWLINE,
IF(priceline(F4, analy_l1, analy_r1, 216)), NEWLINE,
IF(priceline(F4, analy_l2, analy_r2, 216)), NEWLINE,
IF(priceline(F4, analy_l3, analy_r3, 216)), NEWLINE,
IF(priceline(F4, analy_l4, analy_r4, 216)), NEWLINE,
IF(priceline(F4, analy_l5, analy_r5, 216)), NEWLINE,
IF(priceline(F4, analy_l6, analy_r6, 216)), NEWLINE,
IF(priceline(F4, analy_l7, analy_r7, 216)), NEWLINE,
IF(priceline(F4, analy_l8, analy_r8, 216)), NEWLINE,
IF(priceline(F4, analy_l9, analy_r9, 216)), NEWLINE,
IF(priceline(F4, analy_l10, analy_r10, 216)), NEWLINE,
IF(priceline(F4, analy_l11, analy_r11, 216)), NEWLINE,
IF(priceline(F4, analy_l12, analy_r12, 216))), NEWLINE,
], (149.6, 192), (CENTER, CENTER),(266,324))
The definition of analysisline is similar to the examples above for what should be changed.
In Block1, we start by collecting variable information above the lines showing the composition of the product that have the tabbed leader.
There can be up to 12 lines with a tabbed leader. These are the lines that begin with "IF(priceline" where each line contains the font, the first variable, second variable and the maximum length of the line.
In this example there is both a length limit of 266 points and a height limit of 324 points for the block.
Tabbed Leader with Phones
def phoneline(font, phone, label, width):
if not (phone or label):
return[]
leftover = width - (phone.width + font.stringwidth(label))
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, phone, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), label]
Block2 = DWIMBLOCK([LEFT, LINEWRAP,
F6, card_company, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, ' ', card_state, ' ', card_zip, NEWLINE,
SPACER(15), phoneline(F8, Phone1Word, ph1_label, 105), NEWLINE,
SPACER(15), phoneline(F8, Phone2Word, ph2_label, 105), NEWLINE,
IF(SPACER(15),card_email), NEWLINE,
F2, IF(SPACER(15), card_www), NEWLINE,
], (10, 202), (LEFT,TOP_BASELINE))
In this example, we need to determine the width of the phone number differently because the PhoneWord is an object. So, the line that begins with leftover shows this change in bold.
To indent, the simplest method is to add a SPACER command to the beginning of the line. The SPACER will have no affect if the line is empty due to "return[]".
However, the SPACER before card_email and card_www needs to be enclosed in an IF statement to prevent the SPACER from appearing and activating the NEWLINE command, which would result in a blank line.
Everything else is similar to the other examples given above.
F4, CENTER, CASE('upper'), name_first, IF(' ', name_middle), ' ', name_last, IF(', ', name_suffix), NEWLINE, F3, CASE(None), card_title1, NEWLINE, card_title2, NEWLINE, CASE('lower'), card_email
You may come across a need to split email address into two different variables on the layout; one made up of the information contained to the left of the '@' symbol and another of the information contained to the right of the '@' symbol. For example, a customer may want to have their email address split in to two lines. This document will show you how to accomplish that.
These instructions are for Visual Style Editor (VSE). For instructions on how to accomplish this using Style Editor Gold click here:
"Basic email wrapping at '@' symbol in Style Editor Gold"
You can accomplish this split by adding the snippet of code provided below to the Preblocks area. To do so go to the Visual Style Editor and click on the 'Blocks' tab then open the 'Page window' and enable 'Blocks Logic', at the bottom of the Page window, then click 'Apply'. Two new tabs will appear. One will be called Preblocks and the other will be called Postblocks. Paste the code below in the the Preblocks area.
if card_email and '@' in card_email:
card_email, email1tag = card_email.split('@')
else:
card_email = card_email
This code pulls the information to the left of the '@' symbol and assigns it to the variable card_email. Information to the right of the '@' symbol is assigned to the variable email1tag. This type of manipulation can only be done in the Preblock and Postblock areas, but to use it in the Blocks tab it needs to be in the Preblocks tab. Note that the code checks whether there is actually an @ sign in the card_email variable. If this was not done we could end up with a programming error: without an '@' the split('@') would return only one value, while there are two variables to fill. This will then cause a programming error.
The next step is how to use these variables. This will be done in the 'Blocks' area just like normal editing in VSE.
To have the '@' sign on same line as the email prefix paste this in to your block using your own fonts:
IF(card_email, '@', NEWLINE, email1tag),
To have the '@' sign on the same line as the email domain name paste this in to your block using your own fonts:
IF(card_email, NEWLINE, '@', email1tag),
Being able to split a variable at any given point can be useful in many situations, not just for email address. Another example might be if you wanted to split a title that had an & in the middle. Using this method would allow you to split the title so that one part could be displayed on one line and the other part on a second line.
Here is a sample of how that might work. You can use this and the example found in Basic email wrapping at '@' symbol in Visual Style Editor as a basis for building other variable splits. However this technique will work in either Visual Style Editor or Style Editor Gold.
if '&' in card_title1:
card_title1, card_title_line2 = card_title1.split('&')
Now you need to use these two variables in the block, like this:
card_title1, IF('&', NEWLINE, card_title_line2), NEWLINE
This would take an input such as CEO & Founder and format it as:
CEO &
Founder
In some cases you need to take a user input and "slice" it into one or more pieces. Python has many tools available to help you perform such a task. Below is a quick tutorial on how this can work.
VSE: The following would be handled in "preblocks" SEG: The following code would be inserted before the blocks are set.
Here is information on slicing characters:
If the user entered Title 1* for card_title1, coding card_title1 as follows in the four examples below yields the results shown at the end of each line. The number within the square brackets can be changed to slice different amounts of characters.
card_title1[:1]) ### Prints the 1st character. Result: T
card_title1[1:]) ### Does not print 1st character. Result: itle 1*
card_title1[:-1]) ### Does not print last character. Result: Title 1
card_title1[-1:]) ### Prints just last character. Result: *
Lets assume that you have a paragraph of text a user has input, and you wish to set the first letter of the paragraph in a large font - like shown in many books.
Lets further assume you have defined two fonts:
F1 is the big font for the first letter F2 is the small font for the rest of the text, set in normal size
So, you will need to use the first two example above
In VSE
You can define the variable in the Preblocks tab and call it in the appropriate block in the Blocks tab by doing the following:
description = F1, description[:1], F2, description[1:]
That should work, if you define your fonts correctly and this will be easy to understand later.
In SEG, you could do this inline in your block contents as such, making the slices "live" as it were
F1, description[:1], F2, description[1:]
However, this can be hard to remember later when you revisit a project after months or years.
It is very common on a variable imprint item such as a stationery product, that users will be allowed to choose different labels for their phone numbers. Sometimes the user can choose to NOT have a phone label, which presents a few minor concerns in your style file (layout).
PageDNA recommends that you set the style value for any such phone label to '*blank*' in the "Personal" form for that item (without the single quotes), and that you use the code below to clear any phone labels where the user has selected a blank phone number:
if ph1_label == '*blank*': ph1_label = '' if ph2_label == '*blank*': ph2_label = '' if ph3_label == '*blank*': ph3_label = '' if ph4_label == '*blank*': ph4_label = '' if ph5_label == '*blank*': ph5_label = '' if ph6_label == '*blank*': ph6_label = ''
The above code should be in the "Preblocks" tab. If you don't see this tab, go to the "Other" tab. There you will see a button next to "Blocks logic:" with the label "Enable". Click this button, and after the screen refreshes you will have the two extra tabs: "Preblocks" and "Postblocks".
Note that there is no blank line between each 'if' statement and the code to execute. Also notice how the code to execute is indented two spaces under each 'if' statement. These patterns must be followed to ensure this logic works correctly in your style.
Make sure that your Block will display correctly regardless of whether or not there is a phone label. We recommend the following syntax to cover these cases:
F2, IF(ph1_label, ' '), Phone1Word, NEWLINE,
IF(ph2_label, ' '), Phone2Word, NEWLINE,
IF(ph3_label, ' '), Phone3Word, NEWLINE
The 'IF' above would ensure that the phone label and then a single space would appear, but ONLY if a phone label existed. Otherwise, the number would appear all by itself on this line.
Some customers only allow numbers to be entered as phone numbers, and wish to discourage requestors from getting too 'creative' with their phones. The following logic checks that the phone number has numeric characters only, and gives an error message if this is not the case.
Since the following examples contain programming code, you will need to have the "Preblocks" and "Postblocks" tabs enabled.If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
if ph11 and ph12 and ph13:
for char in ph11+ph12+ph13:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
The above code should be in the "Preblocks" tab. Note that there is no blank line between each 'if' statement and the code to execute. Also notice how the code to execute is indented two spaces under each 'if' statement. These patterns must be followed to ensure this logic works correctly in your style.
For sites involving ONLY international phones, the above code should be changed to the following:
if ph1:
for char in ph1:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
For sites allowing both domestic and international phones, your code will need to be more complex:
if phtype == 'intl':
if ph1:
for char in ph1:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
else:
if ph11 and ph12 and ph13:
for char in ph11+ph12+ph13:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
Note that the examples above ONLY cover phone 1, and that you need to change all fields named or starting 'ph1' to 'ph2' for Phone 2, etc.
In some cases, you may allow your user to type in their own phone label, using the "Personal Form" option to turn this on. You may wish to force capitalization of the first letter of each word in the phone's label. For example, if the user enters a phone label as "home office:", you may want the system to force this to say "Home Office:" for branding / consistency purposes.
Fortunately, this is very easy. Put the following code in the "Preblocks" tab. Thus you will need to have the "Preblocks" and "Postblocks" tabs enabled.If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. The following needs to be in "Preblocks" tab, with one line for each phone label:
ph1_label = ph1_label.title() ph2_label = ph2_label.title() ph3_label = ph3_label.title() ph4_label = ph4_label.title() ph5_label = ph5_label.title() ph6_label = ph6_label.title()
In some cases, you may allow your user to type in their own phone label, using the "Personal Form" option to turn this on. You may wish to make sure that - no matter what the user types in - that there is a colon at the end of their phone label, for branding consistency. For example, if the user enters a phone label as "office", you may want the system to force this to say "office:"
Fortunately, this is very easy. You will need to have the "Preblocks" and "Postblocks" tabs enabled.If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. The following needs to be in "Preblocks" tab - in the sample below, we are enforcing this for 6 phones:
if ph1_label:
if ph1_label[-1] != ':':
ph1_label += ':'
if ph2_label:
if ph2_label[-1] != ':':
ph2_label += ':'
if ph3_label:
if ph3_label[-1] != ':':
ph3_label += ':'
if ph4_label:
if ph4_label[-1] != ':':
ph4_label += ':'
if ph5_label:
if ph5_label[-1] != ':':
ph5_label += ':'
if ph6_label:
if ph6_label[-1] != ':':
ph6_label += ':'
Some customers wish to check that the user completed filled out each phone number - for example, not allowing a user to have fewer than 3 digits in the area code section. Following is code to check a domestic phone (Phone 1) for completeness of each digit entered. You will need to have the "Preblocks" and "Postblocks" tabs enabled. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. The following needs to be in "Preblocks" tab:
if ph11 and ph12 and ph13:
if len(ph11) != 3:
COND("The area code must have three digits for Phone 1!")
if len(ph12) != 3:
COND("The phone prefix must have three digits for Phone 1!")
if len(ph13) != 4:
COND("The phone postfix (last bit) must have four digits for Phone 1!")
Note that there is no blank line between each 'if' statement and the code to execute. Also notice how the code to execute is indented two spaces under each 'if' statement. These patterns must be followed to ensure this logic works correctly in your style.
Note that the examples above ONLY cover phone 1, and that you need to change all fields named or starting 'ph1' to 'ph2' for Phone 2, and so forth.
To link a check box to a phone number, you must perform the following:
1) Have the check box enabled in the personal form. 2) Specify the variable (variable names are in green on the personal form). 3) Make sure the variable is added to the "Variables" tab. 4) In the "Preblocks" tab you insert the code, specify the action to be taken using code similar to the following:
if include_ph1 != '1':
Phone1Word=''
Where include_ph1 is the name of the check box and Phone1Word is the name of the text for the phone number, the above code reads as follows: "if the check box is not equal to one, then the phone number is blank." Note: you will need to have the "Preblocks" and "Postblocks" tabs enabled.If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
In our ever shrinking world, it is increasingly common to have phone numbers on printed products with many different formats. Although North America and other parts of the world have standardized on a phone number format, most of the rest of the world does not adhere to the "US" phone format, namely: (###) ###-####
PageDNA’s software allows your users to indicate that they require international phones on their products, so that they get a free text input in which to type a phone, versus the standard PageDNA "US" phone format which forces the user to type area codes, prefix and extension independently.
This option can also be made automatic, for sites catering primarily to non-US audiences. See documentation on "Catalog Admin" in the "Site Configuration" docs for more information.
Once the forms are configured, each style that may have international phones needs minor modifications to ensure that the phone behaves properly in both cases.
If you convert a style to use the new VSE, there are six PhoneWords that you can configure on the Phones tab. Both, US format and international (free format) PhoneWords are available. You can choose to use a label and the separating text between the label and the phone number. you can do the same for the extension label. There is a default font for the PhoneWords, but you can set different fonts for any of them in the "Font Exceptions" list. Setting an exception back to the default is just a matter of selecting the default as the exception font. After the page refresh that PhoneWord will be removed from the list.
A commonly seen design element calls to set phone labels right aligned inside a left aligned block while the phone numbers are left aligned. This gives a a uniform column gap and is used by many designers. There are several ways to accomplish this goal.
The TABLE command allows you to define columns and set the columns as right or left aligned. - However the TABLE command doesn't support uniform line scaling - meaning if you are depending on type in the lock to all scale down together the TABLE command isn't a great choice.
You can also use the COL command to achieve a similar look. COL allows the use of maxblock width and uniform line scaling to scale all type in the block at a uniform rate.
VSE Version:
LEFT,
IF(RIGHT, F2, ph1_label, COL, SPACER(5), LEFT, F2,
Phone1Word),NEWLINE,
IF(RIGHT, F2, ph2_label, COL, SPACER(5), LEFT, F2,
Phone2Word),NEWLINE,
IF(RIGHT, F2, ph3_label, COL, SPACER(5), LEFT, F2,
Phone3Word),NEWLINE,
IF(RIGHT, F2, ph4_label, COL, SPACER(5), LEFT, F2,
Phone4Word),NEWLINE,
IF(RIGHT, F2, email_label, COL, SPACER(5), LEFT, F2,
card_email, email1tag),NEWLINE,
IF(RIGHT, F2, 'Web:', COL, SPACER(5), LEFT, F2,
'www.webiste.com'), NEWLINE,
SEG or Blocks Logic Version:
PhoneEmailBlock = DWIMBLOCK([LEFT,
IF(RIGHT, F2, ph1_label, COL, SPACER(5), LEFT, F2,
Phone1Word),NEWLINE,
IF(RIGHT, F2, ph2_label, COL, SPACER(5), LEFT, F2,
Phone2Word),NEWLINE,
IF(RIGHT, F2, ph3_label, COL, SPACER(5), LEFT, F2,
Phone3Word),NEWLINE,
IF(RIGHT, F2, ph4_label, COL, SPACER(5), LEFT, F2,
Phone4Word),NEWLINE,
IF(RIGHT, F2, email_label, COL, SPACER(5), LEFT, F2,
card_email, email1tag),NEWLINE,
IF(RIGHT, F2, 'Web:', COL, SPACER(5), LEFT, F2, 'www.
4streets.com'), NEWLINE,
], (151.9, 18), (LEFT, BOTTOM), uniform_linescale=1)
Occasionally one may wish to block users from using certain characters for a particular free-text input. This one is a bit tricky. First the code, then the explanation:
PUNCT = ',.!;'
for char in PUNCT:
if char in name_first:
COND(char + " not allowed in first name")
if char in card_street1:
COND(char + " not allowed in street name")
Notice how we define a string called PUNCT that contains all the characters you disallow. Next you loop over the string one character at a time, checking each field to see whether it has that character. If it does, you give the user a COND() warning. You will need to have the "Preblocks" and "Postblocks" tabs enabled. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. The previous code needs to be in "Preblocks" tab
There are faster/better ways of doing this in Python -- we can help you with those if you want, but this is probably the simplest method to explain.
WARNING: unless you absolutely have to, you probably want to allow the single quote in addresses because of street names like O'Farrell.
First, create your block as you would normally. Below is a simple block with a web address using the normal variable name for this field - card_www:
F1, card_www
Now, all we need to do insert the following code in "Preblocks" tab, testing to see if the user checked the 'include website?' check box (called 'include_www'). If the user did not check this, we will clear the value for card_www by setting it equal to two single quotes with nothing in between. This removes the website from the imprint. Note that you will need to have the "Preblocks" and "Postblocks" tabs enabled. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
if include_www != '1':
card_www = ''
When the check box is selected by the user, include_www is equal to 1, and the website will remain. The above example would also work if the website had a label, as long as the label and the website are enclosed in an IF logic wrapper:
F1, IF('Website: ', card_www)
Note that the second website address has the same option, but you will need to reference include_www2 for the check box, and refer to the website as card_www2. These variable field names can be identified in "Personal Form" menu item near the individual configuration options, marked in green text.
You can make a font or font atribute, like tracking, conditional based on a user selection or entry, e.g. the city, or on the width of a user selection or entry. Here are the steps you need to take if tracking is conditional:
Add a variable to the Variables tab if you are using Visual Style Editor named: Fx (You can skip this if you are using Style Editor Gold.)
Clone the font you are using that does not have the restricted tracking and change the tracking for the new font.
If you need to change the tracking based on a specific entry, use something like the following:
Fx = F3 if card_city == 'Dallas': Fx = F6 else: Fx = F3
If you need to change the tracking based on length, use something like the following which checks if the city is longer than 36 points, or 1/2 inch:
Fx = F3 card_city = F3.stringwidth(card_city) if max(card_city) > 36: Fx = F6 else: Fx = F3
Your block would look something like this:
LEFT, F1, 'Acme Real Estate', NEWLINE, F3, card_street1, ', ', Fx, card_city, ', ', F3, card_state, ' ', card_zip, NEWLINE
At the beginning of the second line, F3 is the font used for card_street1. Fx is the variable font to be applied to card_city. The next instance of F3 (before card_state) will switch the font to F3 if F6 is used for card_city.
You may encounter a product which has 'forced justification' - namely, regardless of what information is entered by the user for the block in question, the text must align snugly to the right and left sides of the block of text, with spacing added between sections evenly so as to 'pad' the layout and make everything look uniform.
In Quark, this is known as "FORCED" justification. In Microsoft Word, this is called "Justify" or "Justified Horizontal Alignment". Regardless of what it is called, in our system the command to activate this behavior is called TRACKFILL. Simply add the TRACKFILL tag in-line in your block definition, and ensure that you have defined a maximum block width for your block:
F2, TRACKFILL, IF(' ', card_street1), IF(', ', card_street2), IF(', ',
card_street3), IF(', ',card_city), IF(', ', card_state), IF(' ', card_zip)
For this to work you must set the "Max Width" of the block, say you set it to 228. Then this block would extend over 228 points (on a business card, with the block's "X" set to 12, this would take the block to within 12 points of the right edge of the product). Note the extensive use of IF - this ensures that no extraneous spaces are found in the block - important for the task at hand. The layout engine will insert spaces between all elements in the block such that spacing is even... any extra floating spaces would be magnified.
![]() | Warning |
|---|---|
Note: the following in this section is based on the old SEG UI However, this can be done with a Style converted to use the VSE as well. But you need to use the "Code View" of the "Preview" tab. |
On sites with different divisions, sometimes the only difference between each division is the 'shell' or the pre-printed master business cards or other items are printed on. Following is an example showing how to change the combine image (our 'virtual master') based on which division the user is ordering for. The following example assumes that you are using PageDNA’s "Divisions" step to break users into different groups, and for the same of this demo, we are using two fictitious divisions:
DIVISION TAG DIVISION NAME
------------ -------------------
corp Corporate Division
marketing Marketing Divisions
First, visit the "order" tab in your style and add the following as the first line:
corp_tag = ''
Note that the above is two single quotes, not a double quote.
Next prepare 'combine' images for the product, one for each division, such that your "divisions tag" is part of the GIF file name. For this example, there would be two GIF images:
bc_combine_corp.gif
bc_combine_marketing.gif
You will need to upload these files to the 'con' (Content) directory on your site using the File Uploader menu item.
Lastly, in the "previews" section of your style , add the following logic (shown in bold) to the "normal" proof, replacing your current combine image. The code for your style may vary slightly - only change the portions that are necessary.
{
'normal': {
'scale': 2.0,
'combine': './con/bc_combine_%(corp_tag)s.gif',
'use_magick': 1,
},
}
Note that the system will replace the fragment:
%(corp_tag)s
with your division's tag at the time of proofing.
In the previous example, we show how to change the master image (combine) by division, so that users see the correct proof on their products when you have different 'shells' or masters. In other cases, you may need to change an actual EPS file based on the division the user selected, or another variable. This is performed similarly. Again, we will assume that there are two divisions for this example:
DIVISION TAG DIVISION NAME
------------ -------------------
corp Corporate Division
marketing Marketing Divisions
Next prepare 'logo' EPS files for the product, one for each division, such that your "divisions tag" is the first part (before the extension) of the EPS file name. For this example, there would be two EPS logo files:
corp.eps
marketing.eps
In the "Blocks" tab of VSE, add a new photo block. Set the field "Variable name" to "corp_tag" and select "con/[variable].eps" in the "Filename path" drop down list. At the same time you can upload one of the prepared EPS files as well. Also set a suitable block name and the other fields as desired.
You will need to upload all EPS files to be used to the 'con' (Content)
directory on your site. Either using the upload in the photo block window or using the
File Uploader menu item.
Note that the system will replace the bold fragment with the value of the variable:
'con/[variable].eps'
In the example with your division's tag at the time of proofing. You can change 'corp_tag' in the example above to another variable if you wish to use this for another application.
PageDNA offers robust support for scaling and cropping images - whether user uploaded or chosen from a list of pre-loaded assets. Read on to learn how these features work.
You can set up an item which allows the user to upload a logo, photo, or any other files you may wish to receive.
For information on setting up custom items where you want the user to upload the entire piece as finished artwork, please see Special Request Items.
For information on setting up custom items with real-time estimation tools, please see Quotes and Quotes Plus.
First, a form needs to be created or edited to include an upload field. Upload fields can be added to Form Editor and Shared Item forms. There are two upload fields. The File Upload to Style Button is simplest, and you may find it adequate. It is found under the Upload section when adding a new field. The File Upload Button field is more complex. It allows for greater control, especially regarding file types and color space, and allows user cropping to be disabled. When adding a new field, it is found under the Advanced section.
File Upload To Style Button Field
![]() | Important |
|---|---|
If you need to not allow cropping for an uploaded image, you will need to use the File Upload Button field, described below. |
First, configure an image upload input: In your item form, add a new field. Expand the Upload section, and select File Upload To Style Button for the field type.
Variable Name: Enter a variable name, e.g. upload_file. This will be used in the style when you create a new Photo Block.
Variable Names can be shared on a site as long as the site is using the multi-imprint (shopping basket) feature.
Field Label: This will appear beside the field for the user, e.g. "Upload File:"
File Conversion: Enable the Original Color or Black and White radio button as needed.
Aspect Ratio Checking - EPSWORD Width: Enter the minimum size in points. There are 72 points per inch.
Aspect Ratio Checking - EPSWORD Height: Enter the minimum height in points.
Aspect Ratio Checking - Minimum Resolution: Enter the minimum resolution you are willing to print this image, e.g. 300 (for 300 dpi).
![]() | Note |
|---|---|
The user will be able to crop the uploaded image if cropping has been enabled on the site. This is done in the menu in Web Templates > File Upload Popup only when using the Flash-based File Uploader. If you specify both the width and height, the user will be presented with a single slider to adjust the size of the cropped area. The aspect ratio will be maintained as the area to be cropped is adjusted. The user will not be able to crop to less than the minimum dimensions specified. If you specify only one dimension, the user will be presented with two sliders to adjust the cropped area's height and width. They will not be able to crop to less than the minimum dimension specified. The user can drag the cropped area around to capture the part of the image they need. After cropping, there is a Crop button on the form. So, the user can re-crop the image after proofing. |
File Upload Button Field
As mentioned above, the File Upload Button field allows for more control of file types and color space. If you need to disable cropping, you will need to use this field type.
Variable Name: Variable associated with style.
Label: What you want to show on the in form for the field name.
Required: Check to make this a required field.
Use Popup Window: This creates a separate popup window which is used to upload the file.
Allow user to remove image after upload: As described.
Attach to Emails: Use these to select which email(s) will have this image attached.
Convert to EPS: In order for an item to proof with the uploaded image, a conversion method must be selected.
Dimension Checking: The system will check the dimensions of the file being uploaded. It will present an error to the user if the minimums are not met.
Aspect Ratio Checking: The system will check the aspect ratio of the file being uploaded. It will present an error to the user if the minimums are not met.
Enable Cropping: This allows the use to use our crop tools to pictures uploaded in this field. The Flash based uploader must be used in order to use the cropping tools. For more information on cropping, see User Controlled Image Cropping.
File Format Checking: The system will check the uploaded files to ensure that they are one of the checked File Types and Colorspaces. To not put any limitations on what can be uploaded, simply uncheck all boxes.
Second, a Photo Block needs to be added into the style. Multiple blocks can be added for multiple uploads.
Block Name: The name of your block in the style. Don't use spaces in this name.
Variable Name: This variable needs to match the one from your form.
Filename Path: For uploaded images, leave this blank. A selection would only be made here if you were calling files already existing in a site directory, perhaps through a drop-down selection.
Select File: Used to change or replace existing artwork in a style, not for user upload.
Layer: Layer in which the uploaded art sits. For more information on Layers, see Stacking Image Layers.
Scale: Lets you adjust the scale of image dimensions.
Resize: Lets you set measurements that uploaded images will resize too.
Preserve Aspect Ratio: This preserves the Aspect Ration of the original uploaded image, and it is recommended to leave this checked.
Crop: This setting will auto-crop the image to allow it to fit into the defined picture area. Preserve Aspect Ratio is taken into account first by the system to prevent skewing of the uploaded image.
Once the new Photo Block is created, it will display as an empty block in the style, with the words No Image, and an arrow to show the orientation of the block.
If you need to display a photo or logo more than once on a style, you can do so. This is true if you are working in the blocks, preblocks, or postblocks tabs of the Visual Style Editor (VSE) or in the code window of Style Editor Gold (SEG). If you are using the blocks tab in the VSE and you build a photo block that calls for a photo that's already been called elsewhere in the style, you'll get a popup message notifying you of the duplication.
Photo Cropping
A key selling point for any web-based solution is the ability to upload images or custom graphics as part of a business card, flyer, or brochure. However, users don't want to give up control over how images appear and are placed in a document. The PageDNA system contains tools which help control both quality and placement of images uploaded by the user into any variable print item.
Note: This section of the documentation explains how to use photos in the newer "Visual Style Editor" interface which is much easier to use than Style Editor Gold. For help with older styles using "Style Editor Gold", please Photo/Logo Cropping and Scaling - Style Editor Gold
In this example, we have a business card which will have an uploaded photo placed upon it. The base style looks like this:
A "block" for the photo has been added to this style (Cyan rectangle with "no image" within it) as is own block by clicking the add photo block icon (the mountains with a green plus sign) from the button bar. A block is essentially a container for either text or images.
The Edit Block (Pencil) tool shows the attributes of the image block as well as some information about how the image is going to behave when placed into it.
Note that "Scale" and "Resize" are exclusive - meaning that if a value is entered in Resize, then Scale is ignored. In the above example the maximum width of the window is 54 points while the maximum height is 81 points.
There are 2 other settings which control the re-sizing of an image and which can affect the outcome dramatically - "Preserve aspect ratio" and "Crop".
Aspect ratio is the ratio of the width to the height of the image. In the example the photo is about 50% taller than it is wide which makes the aspect ratio 1.5, or width x 1.5 = height. For a photo, you almost always want width to change when height changes, and vice versa. If this box is unchecked, the following "Too Wide" or "Too Narrow" could occur:
The Preserve aspect ratio command when used in conjunction with resize will fit the entire image into the defined picture window by sizing the entire image down so the longest dimension fits within the window. This command does not crop any portion of the uploaded image. It produces an image which looks like this:
Note that the width of the image is actually narrower than the block.
Enabling the Crop option will shrink the image until the narrowest dimension fits within the block, and the longer dimension will be trimmed. Above is an example of a cropped image. In this case, the width has been matched to that of the block, and the top and bottom of the image have been trimmed accordingly.
Let's look at the "Preserve Aspect Ratio" and "Crop" commands on a sample business card.
In the above example, the photo has been scaled to fully fit within the defined window. In this case, it works well is because the aspect ratio of the uploaded image is roughly that of the defined window.
However, In this example, a "landscape" image (wider than it is tall) gives unexpected results. To allow the width to fit, the height was reduced considerably and is now a bit too small.
The above demonstrates one of the reasons why it is important to use the "pre-flightng" tools available in the options for uploading an image, shown here for the two supported file upload buttons: the File Upload To Style Button field, found under the Upload section when adding a new field, and the File Upload Button field, found under the Advanced section.
First, a form needs to be created or edited to include an upload field. Upload fields can be added to Form Editor and Shared Item forms. There are two upload fields. The File Upload to Style Button is simplest, and you may find it adequate. It is found under the Upload section when adding a new field. The File Upload Button field is more complex. It allows for greater control, especially regarding file types and color space, and allows user cropping to be disabled. When adding a new field, the File Upload To Style Button field is located under the Upload section and the File Upload Button field is located under the Advanced section.
File Upload To Style Button Field
Aspect Ratio Checking - EPSWORD Width: Enter the minimum size in points. There are 72 points per inch.
Aspect Ratio Checking - EPSWORD Height: Enter the minimum height in points.
Aspect Ratio Checking - Minimum Resolution: Enter the minimum resolution you are willing to print this image, e.g. 300 (for 300 dpi).
![]() | Note |
|---|---|
The user will be able to crop the uploaded image if cropping has been enabled on the site. This is done in the menu in Web Templates > File Upload Popup only when using the Flash-based File Uploader. If you specify both the width and height, the user will be presented with a single slider to adjust the size of the cropped area. The aspect ratio will be maintained as the area to be cropped is adjusted. The user will not be able to crop to less than the minimum dimensions specified. If you specify only one dimension, the user will be presented with two sliders to adjust the cropped area's height and width. They will not be able to crop to less than the minimum dimension specified. The user can drag the cropped area around to capture the part of the image they need. After cropping, there is a Crop button on the form. So, the user can re-crop the image after proofing. |
File Upload Button Field
By specifying an aspect ratio, you can prevent images from being uploaded that won't "work" with the layout. To allow either "portrait" (tall) OR "landscape" (wide) images, it's best to use a square frame.
In the box above, the "Crop" command has been enabled. When used in conjunction with the preserve aspect ratio and resize commands, the crop command will fill the defined picture window with the narrowest dimension of the image, centering the image in the window, and cropping off the "extra" content of the longer dimension.
With the crop command turned on, our first image looks basically the same:
Although close inspection will show that the image is now slightly taller and the subject's shoulders have been slightly cropped out of the frame. This photo matches the original design spec very well.
But what happens when a photo which does not conform to the best aspect range is used?
The image is filling the full height of the frame, but since the subjects are wider than the window allows, their features are being cut out of the frame.
The issues above highlight why we recommend that any uploaded image also be attached to the vender email. Subjects which are out of center in the original or which are too wide or tall in general may be fixable by pre-press after the order is placed.
In all the examples so far the photo block has ben anchored in the center of the image, which is the recommended setting. However some designs will call for a photo to bleed. Photo or image blocks function in the same way that al other blocks function the anchors can be changed to accommodate bleeds or other design needs. In the following example the anchor has been moved to the top right to ensure that the image bleeds off the card.
The Image Cropping feature found within the File Uploader can be a quick and easy way for users to upload their own photograph and crop it to display how they'd like it to shown in their final product. It gives them the ability to crop, resize, and change aspect ratio on any photo they upload. However, any aspect ratio that you've defined within the style will be enforced upon the final edited version of the photo that the users submit.
This feature is only available for new photos as they are added to the system. Photos that are currently stored in profiles cannot utilize this tool at this time.
To provide this feature, you'll need to enable settings at both the site and item level.
First you'll need to make this feature available from the site's Main Menu. Select the File Upload Popup option under the Web Page Templates section of the Main Menu and then select the 'Use Flash-based File Uploader' button. Also check the checkbox labeled 'Allow User Image Cropping on this Site'.
![]() | Note |
|---|---|
If the File Upload To Style Button field is used, and cropping is enabled on the site, the user will be able to crop their image. There is no option to disable cropping when using the File Upload To Style Button field. This field is found under the Upload section when adding a new field with the Form Editor. The rest of this document deals with the File Upload Button field, found under the Advanced section when adding a new field in the Form Editor. |
Next the cropping feature needs to be enabled on each item that you want to have offer User Image Cropping. This can be done in either the Form Editor when using the File Upload Button field or the Generic Gold form. Cropping cannot be disabled for an individual field when using the File Upload To Style Button field.
If you are using the File Upload Button field, found under the Advanced section when adding a field, then you will need to check the 'Enable Cropping' checkbox when you are setting the options of the File Upload section.
If you are using the Generic Gold form then you will need to select the checkbox labeled 'Enable Image Cropping' found at the end of the File Upload section.
Now that this feature has been enabled users will be presented with cropping and resizing tools when they upload their photo. The tools provided are a size control slider and, if you've not enforced an aspect ratio, a height/width slider. Additionally users can move the selection box around simply by clicking and dragging it to the area of the photo they want displayed.
Once a user is satisfied with their editing choices they can click the Crop Image button and proof their item before they continue with placing their order.
There are cases where you want to move blocks around on a design, based on a variety of different conditions. VIPER supports the following common examples of ways to have blocks move around dynamically.
You may need to create a style wherein a block of text moves in a certain situation - say, a certain number of lines appears in another block, crowding the block in question on the item. For the following example you will need to have the "Preblocks" and "Postblocks" tabs enabled. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
In the example below, we will move the NameBlock up 10 points if the AddressBlock has 5 lines of text, or up 20 points if the AddressBlock has 6 or more lines of text. The bold code in the following example needs to be in "Postblocks" tab:
NameBlock:
F1, name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F2, card_title1, NEWLINE,
card_title2
NameBlock is aligned (LEFT, TOP) at (12,70)
AddressBlock:
F2, card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, IF(', ', card_state), ' ', card_zip
AddressBlock is aligned (LEFT, BOTTOM) at (12,12)
Put this code in the "Postblocks" tab:
if len(AddressBlock.lines) == 5:
NameBlock.move(0, 10)
elif len(AddressBlock.lines) >= 6:
NameBlock.move(0, 20)
You could similarly move the block horizontally by adjusting the first parameter (y) in the move command. You could use this to test the length of a line and then move the block if it bumps into another block, for example.
![]() | Warning |
|---|---|
Note: the following in this section is currently not possible with the VSE in the "Blocks" tab. However you can use this example in the "Preblocks" tab. We probably will add functionality in a future version to make this possible from the "Blocks" tab. |
You may need to create a style wherein a block of text 'floats' between two other blocks on the card, with the whitespace between this item and the other blocks even above and below. This is quite easy to accommodate with our system:
For the following example you will need to have the "Preblocks" and "Postblocks" tabs enabled. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
First, define the blocks that will reside above and below this block of text. Lets say - for this example - that the top block is the NameBlock, and it grows down from the top of the item; the bottom block is the AddressBlock, and grows from the bottom up. We will have a third block, called WebEmailBlock, floating evenly between these two blocks. Note: all of the example goes in the text area on the "Preblocks" tab.
NameBlock = DWIMBLOCK([F1, name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F2, card_title1, NEWLINE,
card_title2], (12,240), (LEFT, TOP))
AddressBlock = DWIMBLOCK([F2,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, IF(', ', card_state),
' ', card_zip], (12,12), (LEFT, BOTTOM))
Next, we will draw the middle block (WebEmailBlock), but center it between the two blocks by specifying a Y (height) anchor point using the HCENTER in the block anchor point definition, as shown below:
# HCENTER(TopBlock,BottomBlock)
# so the example will be like below
EmailWebBlock = DWIMBLOCK([
F1, card_email, NEWLINE,
'www.nationsprint.com'],
(12,HCENTER(NameBlock,AddressBlock)), (LEFT, MIDDLE))
The HCENTER command automatically finds the 'middle' of these two blocks and returns the appropriate y-height for this coordinate. Telling our middle block (EmailWebBlock) to grow from the MIDDLE ensures that the whitespace will be equalized on top and bottom. It is critical that the blocks above and below the middle block are 'drawn' first so that HCENTER knows how to find the middle, so the sequence of blocks does matter in this regard.
A similar command exists for finding the x-coordinate for the middle of two blocks. In this case, you use VCENTER, and would replace the x-coordinate in your block anchor definition.
![]() | Warning |
|---|---|
Note: the following in this section is currently not possible on the VSE's "Blocks" tab. However you can use this example on the "Preblocks" tab. We probably will add functionality in a future version to make this possible. |
Occasionally you will need to have a block of text 'grow off' the end point of another block.
For the example below, we have two blocks of text. The block on the left side of the item (LeftBlock) grows from the bottom of the product, upward. The second block of text (RightBlock) grows from the top downward, but the top line of this block needs to be aligned with the top of the LeftBlock, regardless of how few or how many lines are in the LeftBlock. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
This is easy with VIPER. First, setup the LeftBlock with the BOTTOM anchor - make sure this is listed first in your style. After this, add your next block that will grow from the TOP down, with the anchor point set to the top of the first block per the example shown below. The following goes in the text area of the "Preblocks" tab:
LeftBlock = DWIMBLOCK([F2, LEFT,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, ', ', card_state, ' ', card_zip, NEWLINE,
card_email, NEWLINE,
card_www,
], (12,12), (LEFT, BOTTOM), (110, 0))
RightBlock = DWIMBLOCK([F2, RIGHT,
mail_street1, NEWLINE,
mail_street2, NEWLINE,
mail_city, ', ', mail_state, ' ', mail_zip, NEWLINE,
card_email2, NEWLINE,
card_www2,
], (240,LeftBlock.calc_top()[1]-3.0), (RIGHT, TOP), (110, 0))
Note how we have replaced a traditional anchor point (an integer) with a function:
LeftBlock.calc_top()[1]-3.0
Let's break this function down a bit. The first part:
LeftBlock.calc_top()[1]
...gives you the _approximate_ Y coordinate (height) for the top baseline of this block - depending on how many lines are on this particular order, this will change to reflect the actual height for that particular imprint.
In our experience, it is necessary to adjust this with an 'adjustment factor' to get things to line up perfectly... in the case above, we are subtracting 3 points from the calculated value to get the actual "top" of the block:
LeftBlock.calc_top()[1]-3
The best way to find the 'adjustment factor' is to open actual artwork generated by the style and measure how far off the block is in Illustrator, then adjust the number and test again until you are dead-on. The top of both blocks will from this point forward stay locked together 100% accurately.
Make sure your block names are updated from the examples above - for example, if your block is not called "LeftBlock", you would need to change that name in the calculate statement above.
If you need to find the bottom of a block, the function to use to find the bottom of a block is:
LeftBlock.calc_lower_left()[1]
Once more, you can adjust this by adding or subtracting points, if needed, such as:
LeftBlock.calc_lower_left()[1]-15
There are four other block methods you can use: _get_top(), _get_right(), _get_left(), _get_bottom(). Each method gets that edge (top, right, left, or bottom) of the block. Here is an example how it would look:
LeftBlock._get_right()
or
LeftBlock._get_right()+15
This is useful if you want to grow the right block off the right edge of the left block, for example.
![]() | Warning |
|---|---|
To rotate a block in Visual Style Editor, you will need to set the block entirely in either the Preblocks or Postblocks tabs. The Blocks tab does not support the ANGLE command. |
First, create your block as you would normally in SEG. Below is a simple block with only a single field - a hard coded website address:
NameBlock = DWIMBLOCK([F1, 'www.yourwebsite.com' ], (126,75), (LEFT, TOP_BASELINE))
Now, all we need to do is wrap this block with the ANGLE command, specifying how many degrees we wish to have this block rotated. In this case, we are going to rotate the block upside down - 180 degrees:
NameBlock = ANGLE(DWIMBLOCK([F1, 'www.yourwebsite.com' ], (126,75), (LEFT, TOP_BASELINE)), 180)
Note: the code above goes in the "Preblocks" tab. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
The EGG tool has trouble reading and correctly setting rotated type. To avoid issues send your type which needs to be rotated as either type converted to outlines, which will be placed on the master image layer. Or as right reading text which will be correctlyconverted to a vraible.
After the EGG tool has run simply edit the block and add the ANGLE commands as shown above to roate the block.
In cases where accurate proofing of rotated type is very important. The zoom function can be used to rotate back the image to right reading on the proof page only. Its a nice way to use the zoom feature in proofing, by showing and enlarged and roated image.
![]() | Warning |
|---|---|
Note: the following in this section is currently not possible on the VSE's "Blocks" tab. However you can use this example on the "Preblocks" tab. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. We might add functionality in a future version to make this possible. |
In the example code below a vertical line was required to separate phone designations from phone numbers. The length of the line needed to vary depending on the number of phone lines used. In order to achieve this the real height of the block must be calculated and the line must be added as a separate block from the phone words.
Block2 = DWIMBLOCK([LEFT,
IF(F5, ph1_label, ' ', Phone1Word), NEWLINE,
IF(F5, ph2_label, ' ', Phone2Word), NEWLINE,
IF(F5, ph3_label, ' ', Phone3Word), NEWLINE,
IF(F5, ph4_label, ' ', Phone4Word), NEWLINE,
], (18.5, 10.2), (LEFT, BOTTOM))
x = (Block2.height-3.7)
Line = DWIMBLOCK([VLINEWORD( .90, x, .90, x, color=BLACK), ], (122.6,
Block2.calc_lower_left()[1]-.1), (LEFT, BOTTOM))
First set the main block of type in position on the item.
Second figure out how tall that block of type is and how tall to make the line. ( Block2.height-3.7) reads - calculate the total height of Block2 and subtract 3.7 points from the total. Making a line which is shorter than the block. Change (Block2.height-3.7) to (Block.height+3.7) to make a line which is taller than the block.
Third start to draw the line using the VLINEWORD command. VLINEWORD( .90, x, .90, x, color=BLACK) VLINEWORDIn the example below the line has a stroke weight of .9 points while it's height is x or the height of Block2-3.7 points
Fourth, position the line block so that it falls in the correct position in relation to the phone designations and numbers.
![]() | Warning |
|---|---|
Note: the following in this section is currently not possible on the VSE's "Blocks" tab. However you can use this example on the "Preblocks" tab. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. We might add functionality in a future version to make this possible. |
![]() | Tip |
|---|---|
The method described below may be achieved more easily with Sub Logo Setup in the menu and a Sublogo Selection field in an Item Form. Please see the documentation for sublogo - Sublogo Selection Field. |
Let's assume for the sake of demonstration that you have a business card which can optionally include 1, 2 or 3 'sublogos', depending on user selection while ordering. These logos need to be placed such that they do not write over each other.
To further illustrate the power of programming in styles, we are additionally going to show an example where these sublogos are required to higher on the card if the user has additional title lines - so as to keep consistent white-space between the name and title block and these sublogos:
The below example illustrates our goal:
First, we need to prepare our sublogos. Save sublogos in EPS format, making sure the bounding box around the sublogo is tight and consistent between multiple sublogos. Save your sublogos with simple, memorable filenames lacking spaces or 'funny characters'.
In this example, we will have three possible sublogos: 1) CCIE.eps 2) CCDP.eps 3) CCNP.eps - save your sublogos to a location on your computer you can remember later when we enter Style Editor Gold and upload the files.
In the 'Edit Items' interface, activate the 'sublogo' item form for your item by selecting 'sublogo' from the item_form option (shown below) and then Save your item.
Now return to the Menu and locate your item form, which will appear in a new Menu section titled "Item Form Templates". The menu item will have the 'tag' of your style in the name. In this example, we are editing a style with a tag of "bc_1", so the menu item appears as follows:
Click this link to open the sublogo form configuration interface. For our example, we will configure our form to have Check boxes and three sublogo options. We will opt to have the products' tag appended to the field name, in case we wish to add sublogo forms to other items on the site later.
Upload your EPS files to the site using Style Editor Gold. Click the "Upload" button for your style (in our case, 'bc_1.sty') and then un-check the "Make EPS word/preview block" option. We un-select this option each time we upload because we are going to create our blocks manually later - right now we simply want to upload the EPS files to the /con directory on the site for later reference.
Upload all EPS files, one at at time, and then click on the 'Blocks' tab. First we need to insert some code into our style to force the user input into a 'list', no matter what the user submitted:
import notions try: bc_1_sublogos = notions.force_list(bc_1_sublogos) except: bc_1_sublogos = [] notions = None
This code ensures that the list of sublogos is in a list format.
Now we will set default x and y positions for the three possible sublogo blocks:
sublogo_1x = 25 sublogo_1y = 35 sublogo_2x = 25 sublogo_2y = 35 sublogo_3x = 25 sublogo_3y = 35
Now count how many sublogos we have in total.
sublogo_count = 0 if 'CCIE.eps' in bc_1_sublogos: sublogo_count = sublogo_count + 1 if 'CCDP.eps' in bc_1_sublogos: sublogo_count = sublogo_count + 1 if 'CCNP.eps' in bc_1_sublogos: sublogo_count = sublogo_count + 1
In the situation where we have a single block, the block will be in the correct position based on our default x, y positions. However, if we have 2 or 3 sublogos, we need to move some of the sublogos around so that the sublogos are not on top of each other:
if sublogo_count == 2:
if 'CCIE.eps' not in bc_1_sublogos:
sublogo_3x = sublogo_3x + 17
else:
if 'CCDP.eps' not in bc_1_sublogos:
sublogo_3x = sublogo_3x + 17
if 'CCNP.eps' not in bc_1_sublogos:
sublogo_2x = sublogo_2x + 17
if sublogo_count == 3:
sublogo_1x = sublogo_1x + 17
sublogo_2x = sublogo_2x + 34
Now we need to move the blocks around if the user has more titles, as these titles would bump against the sublogos if we didn't move them. This may or may not be necessary based on your style.
if card_title1 != '': sublogo_1y = sublogo_1y + 10 sublogo_2y = sublogo_2y + 10 sublogo_3y = sublogo_3y + 10 if card_title2 != '': sublogo_1y = sublogo_1y + 10 sublogo_2y = sublogo_2y + 10 sublogo_3y = sublogo_3y + 10 if card_title3 != '': sublogo_1y = sublogo_1y + 10 sublogo_2y = sublogo_2y + 10 sublogo_3y = sublogo_3y + 10
Lastly, we write the blocks themselves, but only if the user checked that particular checkbox. Note that each blocks under the "if" statements begin indented in two spaces from the left margin:
if 'CCIE.eps' in bc_1_sublogos:
SublogoBlock1 = DWIMBLOCK([
EPSWORD('con/CCIE.eps'),
],
(sublogo_1x, sublogo_1y),
(LEFT, BOTTOM), layer=-1)
if 'CCDP.eps' in bc_1_sublogos:
SublogoBlock2 = DWIMBLOCK([
EPSWORD('con/CCDP.eps'),
],
(sublogo_2x, sublogo_2y),
(LEFT, BOTTOM), layer=-1)
if 'CCNP.eps' in bc_1_sublogos:
SublogoBlock3 = DWIMBLOCK([
EPSWORD('con/CCNP.eps'),
],
(sublogo_3x, sublogo_3y),
(LEFT, BOTTOM), layer=-1)
![]() | Warning |
|---|---|
Note: the following in this section is currently not possible on the VSE's "Blocks" tab. However you can use this example on the "Preblocks" tab. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. We might add functionality in a future version to make this possible. |
There are cases where you want to change color shown in a style file dynamically based on user input. Following is one way to configure this. There are two steps: configuring a form to allow user color selection, and then style logic to change the color in the layout.
STEP 1: CONFIGURE GENERIC GOLD FORM:
To control a color in a style dynamically from a user input, the first step is to build the custom Drop-Down list using a "Generic Gold" form input. In this case, let's say that the two PMS colors we want to allow are:
PANTONE 7455 C (blue)
PANTONE 149 C (peach).
You would want your drop-down to present something human-understandable to the users (such as a color name) so we will use the following for our Generic Gold drop-down list values:
7455|Blue
149|Peach (light orange)
When using this format, the code to the left of the vertical bar will be sent to the style - the name to the right of the vertical bar will be displayed to users. In this case we are using the fieldname "bc_color" for the drop-down list:
STEP 2: CONFIGURE STYLE LOGIC
One way to define colors in PageDNA’s system is the CUSTOMCOLOR command.
In most cases colors are defined in the 'fonts' tab and are given a code (eg: C1) that is referred to later - for example, when defining a font. A custom color definition looks like the following:
C1 = CUSTOMCOLOR('PANTONE 7455 C', 0.86, 0.73, 0.01, 0.00)
The four numbers shown after the formal Pantone name define the cyan, magenta, yellow and black percentages... for the above font, these are:
c: 86% m: 73% y: 1% k: 0%
This happens to be a medium blue color. You can get these out of Adobe Illustrator or Photoshop using the "custom" and "picker" color palettes.
Next, at the top of the fonts tab we need to add the following logic to test the value selected by the user and change the custom color definition dynamically. Depending on what is chosen, one of two possible colors is set to be 'C1' for this proof:
if bc_color == '7455': color1_c, color1_m, color1_y, color1_k, color1_name = 0.86, 0.73, 0.01, 0.00, 'PANTONE 7455 C' else: color1_c, color1_m, color1_y, color1_k, color1_name = 0.02, 0.25, 0.51, 0.00, 'PANTONE 149 C' C1 = PROCESSCOLOR(color1_name, float(color1_c), float(color1_m), float(color1_y), float(color1_k))
Note that the section where we assign the CMYK and font color values are indented two spaces - this is important for the code to work right. If you need more than two colors, use the 'elif' term to add as many as needed:
if bc_color == '7455': color1_c, color1_m, color1_y, color1_k, color1_name = 0.86, 0.73, 0.01, 0.00, 'PANTONE 7455 C' elif bc_color == '149': color1_c, color1_m, color1_y, color1_k, color1_name = 0.91, 0.73, 0.03, 0.00, 'PANTONE 100 U' else: color1_c, color1_m, color1_y, color1_k, color1_name = 0.02, 0.25, 0.51, 0.00, 'PANTONE 149 C' C1 = PROCESSCOLOR(color1_name, float(color1_c), float(color1_m), float(color1_y), float(color1_k))
It is recommended that you always have an 'else' logic test as the final test to catch any possible exception so the user does not ever see a "fatal error" when proofing.
Lastly, just below this login, simply define your font or fonts using the C1 color definition:
F1 = FONT('Univers-CondensedOblique', 8, 1, -.15, color=C1)
Whichever C1 is currently selected by the end-user would be used for that artwork proof.
![]() | Warning |
|---|---|
Note: the following in this section is currently not possible on the VSE's "Blocks" tab. However you can use this example on the "Preblocks" tab. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. We might add functionality in a future version to make this possible more directly. |
There are cases where you want your users to be able to change the font on a product. PageDNA supports this.
One way to configure this is to give the user a drop-down list of fonts. In this approach, there are two steps: first configuring a form to allow font selection, and then changing the fonts in your style to "listen" for the input your user chose.
STEP 1: CONFIGURE GENERIC GOLD FORM:
To control a user in a style dynamically from a drop-down list, the first step is to build a custom item form. Edit your item in the "Item Editor". Click on the "custom" tab and look at the item form - if not already enabled, add a "generic_gold" form. Upon saving, you will see a new link to edit the "item form". Click this and scroll down to configure your first input (Below the first "Jump Bar").
In your generic_gold form, create a custom "drop down list" and enter one font name your users will be allowed, per line. You will need to know the official font name for each font you use. Provided you own a copy of the font you select, you can get the PostScript names of your uploaded fonts at http://www.nationsprint.com/hub/font/showfonts.cgi?text=1
Times-ExtraBold Times-Semibold Times-SemiboldItalic
The above format shows how the exact spelling and capitalization was copied from the list of installed fonts. This is important because without the exact spelling, the font will not work. You usually will want your drop-down to present something human-understandable to the users (such as a color name) so we will use the following for our Generic Gold drop-down list values:
Times-ExtraBold|Extra Bold Times-Semibold|Semi-Bold Times-SemiboldItalic|Semi-Bold Italic
When using this format, the code to the left of the vertical bar will be sent to the style - the name to the right of the vertical bar will be displayed to users. In this case we are using the fieldname "bc_font" for the drop-down list:
STEP 2: CONFIGURE STYLE LOGIC
Now that we have the font selection from the user, we need to add it to some or all fonts on the product. When you are using VSE this is done in the "Preblocks" tab of the style, not on the "Fonts" tab. Visit the Item Editor and edit your item. Once editing your item, click the name of the style - it will appear similar to 'bc.sty'. Two sided items will have two styles - each style may need to be edited. Again, if you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs.
A normal font definition, as you would use in the SEG with unconverted styles, looks like this:
F1 = FONT('HelveticaNeue-Bold', 6.0, 0.0, 0.0)
As you can see, the font name is 'hardcoded' in quote marks. To activate the font, we simply pass in the field name from the custom form we just created. In the example above, I used bc_font. If I wished to activate the font above, I would merely change the definition to:
F1 = FONT(bc_font, 6.0, 0.0, 0.0)
So these are the steps you do in VSE:
Go to the "Variables" tab and create a new variable, for this example "bc_font" (enter without the quotes though). This variable must have a value, otherwise you get an error on the next step. Something like "Helvetica" (again, no quotes) will do nicely.
Go to the "Preblocks" tab and enter the font definition, something like this:
F1 = FONT(bc_font, 6.0, 0.0, 0.0)
Voila! The font is changed to whatever the user selected. Be sure to always give a unique field name for every drop-down list, so the inputs don't "collide".
You can use form editor drop-down lists to allow the user to select the specific font, color and size for any given font in a style. The information below will allow you to create and adjust the F1 font based on user selection.
Setting up the form:
A basic form with 3 choices would look like this when editing:
Make sure your drop-down choices match the lists in your style, like this:
Setting Up The Style:
If you are using VSE, be sure to visit the Variables tab and add the variables used in your form. Any colors you are using will need to be added to the Colors tab.
It is important when using VSE that you do NOT define the variable for the font in the Fonts tab. In the example here, the variable is font_sel_1. It needs to be defined in the Preblocks tab
Add this text Preblocks tab of VSE(descriptive notes are marked with a #):
#This text maps the drop-down choices in the form for font_sel_1. The font name to the
#right of the colon is the exact font name as listed in Installed Fonts in our system.
font_map = {
'Comic Sans':'ComicSansMS-Bold',
'Helvetica':'Helvetica-Black',
'Bauhaus':'Bauhaus-Medium',
}
font_default = 'TimesNewRoman-Bold'
#This text maps the drop-down choices in the form for font_size_1. The number to the
#right of the colon is the exact point size of your font. This should match the left
#hand side values exactly.
font_size = {
'10':10,
'12':12,
'14':14,
}
font_size_default = 12
#This text maps the drop-down choices in the form for font_color_1. The color name
#to the right of the colon is the color as defined in the colors tab of VSE,
#or Fonts tab of SEG.
color_map = {
'Green':C1,
'Red':C2,
'Blue':C3,
'Black':C4,
}
color_default = C4
#This is the definition of F1. It is comprised of our variables. The 2,0 in the middle
#line sets the leading and tracking of the font.
F1 = FONT(font_map.get(font_sel_1, font_default),
font_size.get(font_size_1, font_size_default),2,0,
color_map.get(font_color_1, color_default))
F1.scalemethod = 'hscale'
#This is the definition of F2. Notice, in this sample, how we're using the same
#variables for font selection and color selection. This means that one selection
#on the form will change the font and color of both fonts. In this example, the size,
#leading, and tracking are preset in the middle line.
F2 = FONT(font_map.get(font_sel_1, font_default), 8,2,0, color_map.get(font_color_1, color_default))Troubleshooting:
If you are having issues making this work, try these troubleshooting tips:
Make sure your variables in the form match your variables in the style.
Make sure your choices in the drop-down lists match exactly, including case, with the choices in your style.
Make sure you have all of your colors defined in the Colors tab.
Make sure you're calling the F1 font in your Block.
Dingbats and Wingdings are types of fonts that fall outside the "normal" definitions. In order for the font to work you need to select NONISOFONT from the drop list of types in the fonts tab when you create the font. You can also change the font type after you have created the font. By default the Change Type drop-down list is set to FONT.
Phones are a bit of a different story. US style phones are made up of up to 6 different inputs. these are the ones associated with Phone 1:
ph1_label--> designation or phone label
ph11-->area code
ph12-->phone prefix
ph13-->phone suffix
ph1_ext_lbl-->extension label
ph14--> extension number
Normally a PhoneWord handles the formatting for you. In this case the need to use a special character as a separator removes the PhoneWord as a good option.
First, you need to define your Dingbat or Wingding as its own variable:
dingbat = [FX, ' D ', FY]
Where FX is the font that uses the dingbat font and FY is the font for the rest of the phone number and the string "space bar D space bar" is a leading and trailing space with the correct character to make the symbol you need.
You can set a phone number up in a regular block with a little effort. The following statement would work if the first phone number always had to have a label and an extension.
IF(ph1_label, ' ', ph11, dingbat, ph12, dingbat, ph13, ' ', ph1_ext_lbl, ' ', ph14)
If not, you need some code to set the phones even if some parts are missing and to remove the phone label if the phone is missing.
If you are using Visual Style Editor (VSE), Enable Block Logic for VSE by clicking the Enable Block Logic checkbox in the Other tab of your style or enable it in the Page tool in the grey toolbar in the Blocks tab. This will add two new tabs to your style: Preblocks and Postblocks.
In the Preblocks tab, the following logic,which needs to be done for each phone number, will print the extension label only if there is an extension number:
if not ph14:
ph1_ext_lbl = ''
else:
ph1_ext_lbl = (' '+ph1_ext_lbl+' ')
That will set the extension label to either nothing or it will append a leading and trailing space bar to the label if there is an extension.
And the following logic, which must also be done for each phone, will prevent the phone label from printing if the phone prefix is missing:
if not ph12:
ph1_label = ''
Now a JOIN3 statement will work in your block to join the elements comprising the phone number with the separating character:
LEFT, F1, JOIN3(ph1_label, ' ', JOIN3(ph11, dingbat, JOIN3(ph12, dingbat, JOIN3(ph13, ph1_ext_lbl, ph14)))), NEWLINE
This will result in something like this:
You can use commands in a block instead of adding a font to the style's Fonts tab to print a barcode in black. (This does not preclude the need for you to own the font.) Clicking on the commands for the supported fonts below will take you to their documentation in the Style Command Reference Guide. The commands for the supported fonts are:
| CODE128 |
| CODE39 |
| DATAMATRIX |
| EAN13 |
| QRCODE |
| UPCA |
Additional documentation for QRCODE and how to apply it can be found here.
![]() | Important |
|---|---|
You will need to enable Block Logic in VSE to use the barcode commands. The block will need to be placed in either the Preblocks tab or Postblocks tab. |
You can use the scalefactor command to uniformly scale the barcode, or you can specify the height and width of the barcode.
Change the Color and/or Background Color of a Barcode:
You can change the color of a barcode by defining a color in the Colors tab of Visual Style Editor and calling it following the barcode command. Please refer to the barcode's documentation and/or the barcode scanner's documentation to make sure the color is supported. This is the correct method because barcode commands above are not a font. For example:
To set the barcode in a color other than black:
QRCODE('text', color=C1)
You can add a background color as follows:
QRCODE('text', backgroundcolor=C2)
Combined, they would look like this:
QRCODE('text', color=C1, backgroundcolor=C2)
Here is an example using scalefactor with the CODE128 barcode command applied to the numbers 0-9:
Block0 = DWIMBLOCK([CENTER,
CODE128('0123456789', scalefactor=.5), NEWLINE,
], (126, 9), (CENTER, BOTTOM))Here is an example resizing the barcode to 72 points wide by 48 points tall:
Block0 = DWIMBLOCK([CENTER,
CODE128('0123456789', 72, 48), NEWLINE,
], (126, 9), (CENTER, BOTTOM))
Sometimes it is desirable to add a company's URL, or any other line of type to their product (say, a business card) but only if there is enough room. The following example adds a company website to an address block, but only if there are 5 or fewer phones and email adddresses on the card.
The folowing code can be placed in preblocks or at the top of the Blocks section if using SEG.
Set a balnk default url and the counter to zero
my_url = '' my_counter = 0
Then add the counting. For each line which is true add 1 to the main count.
if Phone1Word: my_counter += 1
if Phone2Word: my_counter += 1
if Phone3Word: my_counter += 1
if Phone4Word: my_counter += 1
if Phone5Word: my_counter += 1
if card_email: my_counter += 1
Then find out if the total is low enough to add the extra line of type.
if my_counter less than or = 5:
my_url = 'www.yourdomain.com'
The last thing to do is set you block using the variable my_url. It will either be nothing or get set tot he correct value based on their beign 5 or less lines of type used for fones and email.
In this example the user is required to select 1 of 2 choices in 2 different locations. They must pick at least one and may not select more than 1. For this example the h1_type_headline is a free entry text field and h1_headline is a list of choices with an option to choose other to free ly enter into h1_type_headline. To accomplish this a concept called exclusive-or is used.
if bool(h1_type_headline) ^ bool(h1_headline):
COND ('You cannot use two headlines. Pick one WildBlue headline
OR type a headline of your own.')
The bool() means whatever is inside is either true or false ('' would be false, 'This is a test' would be true). The ^ means 'exclusive-or'.
Table of Contents
As outlined earlier in the "Gathering Specs" portion of this document, following are examples of custom typesetting situations, including an explaination of how you would accommodate these situations programmatically within a style file.
This document illustrations some of the 'trickier' situations you may encounter with your variable imprint items. We are constantly adding to this section of our documentation to help you in your style building tasks.
Below are some very simple IF logic statements, highlighted inside a sample block for the name and title. We wish to show a space between the first and middle names but only if the user entered a middle name. We also want to show a comma and space between the users last name and their suffix (ie, 'Ph.D'), but only if they have a suffix for this order.
NameBlock = DWIMBLOCK([F4, CENTER,
name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F3, card_title1, NEWLINE,
card_title2, NEWLINE,
card_division], (126,75), (CENTER, TOP_BASELINE))
The IF statements above look at everything inside their parenthesis and do a test. If there is a value in each element separated by commas in its list, it will show everything. Otherwise, it will show NOTHING at all. It is important for this reason to keep IFs surrounding as few items as possible, to ensure that one missing variable doesn't stop anything from showing up.
Another common scenario is needing to have a 'bridge' element appear, but only if both elements were entered by a user. A typical example is that the user may wish to have a bullet appear between two phone numbers, but only if BOTH phone numbers were entered. If only one or the other phone number was shown, then only show that number.
This is a little tricker and cannot easily be handled using IF, so PageDNA developed the JOIN3 construct, which lets you - as you might guess - join three elements together. If both of the 'outer' elements exist, the middle element will appear between the two outer elements. Let's look at an example:
PhoneBlock = DWIMBLOCK([F4, CENTER,
JOIN3(
Phone1Word,
bullet2,
Phone2Word,
), NEWLINE,
], (126,30), (CENTER, BOTTOM))
In the above example, the two outer elements being JOIN3ed are Phone 1 and Phone 2. The middle element - the bridge element - is the standard PageDNA variable for a bullet surrounded by a single space on each side - namely, bullet2.
If both phones appear, then JOIN3 will insert a spaced bullet in the middle. Otherwise, only one of the phones would appear. In this example, using IFs may have left a space in front of Phone2 or at the end of Phone1, pushing that line slightly out of center alignment. JOIN3 saved the day.
Lastly, you can 'nest' JOIN3s inside one another for dealing with multiple possibilities, such as bullets between any of 3 optional phones, shown below:
PhoneBlock = DWIMBLOCK([F4, CENTER,
JOIN3(
JOIN3(
Phone1Word,
bullet2,
Phone2Word,
),
bullet2,
Phone3Word,
), NEWLINE,
], (126,30), (CENTER, BOTTOM))
In the above example the three things joined are the Phone1/bullet/Phone2 construct, the bridge of the spaced bullet, and then Phone 3. No matter what combination of Phone 1, 2 or 3 exist, this will show the bullet in the right spot.
There are many cases where the type on a product is limited by the amount of vertical room available. Following are examples to guide you through various ways you can handle this using VIPER.
Following is an example block wherein the user is allowed a maximum of 3 lines in their Name/Title block:
NameBlock = DWIMBLOCK([F4, CENTER,
name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F3, card_title1, NEWLINE,
card_title2, NEWLINE,
card_division], (126,75), (CENTER, TOP_BASELINE),
maxlines=(3), maxmsg=('You have too many lines in your
name/title. You can only have 3 total lines.'))
If the user has more than 3 lines, they will not be allowed to proof their items, but instead will see the PERSONAL ("Imprint Information") page again, with the error message displayed at the top of the page. This is the easiest route to take.
Another option is to decrease leading in the block with too many lines. This would essentially "scrunch" the lines to fit inside the allowed space.
NameBlock = DWIMBLOCK([F4, CENTER,
name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F3, card_title1, NEWLINE,
card_title2, NEWLINE,
card_title3, NEWLINE,
card_division], (126,75), (CENTER, TOP_BASELINE))
if len(NameBlock.lines) > 3:
NameBlock.adjust(leading=-1)
The example above tests to see if there are more than three lines in the NameBlock; if so, leading is decreased by 1 point across all lines for said block. You could go further and configure different rules for different line counts, replacing the bold text above with the below:
if len(NameBlock.lines) == 3:
NameBlock.adjust(leading=-1)
elif len(NameBlock.lines) >= 4:
NameBlock.adjust(leading=-1.5)
Note that the first test checks if the lines are exactly equal to (== means "exactly equal to") 3, setting leading to -1 off default. Then it checks if there are four or more (>= means "greater than or equal to") lines and if so, sets leading at a more aggressive -1.5 from default font settings.
If you need to count lines across multiple blocks, use the following syntax to get that number into the variable 'totallines', which can then be tested as above:
totallines = len(NameBlock.lines) + len(AddressBlock.lines)
You can also set certain lines of type into a set of LINES. LINES are not shown on the item unless referenced in an actual block. This can be useful if you want to check - for example - whether 3 or 4 phones were used by the user in order to make some other change to the style.
In the following example, we will test if more than 3 phones were added by the user, and adjust a vertical spacer depending on which result we get. The default vertical spacer will be 9 points, but we will change this to 6 points when there are more than 3 phones.
To use this method, first you set your type into LINES, which exist in the style but are not actually drawn (yet) on the page. This is useful for getting a count of the total number of lines in a block, before drawing the block:
PhoneLines = DWIMLINES([F4,
IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
IF(ph4_label, ' ', Phone4Word), NEWLINE,
IF(ph5_label, ' ', Phone5Word), NEWLINE,
IF(ph6_label, ' ', Phone6Word), NEWLINE,
])
vertical_pad = VSPACER(9)
if len(PhoneLines) > 3:
vertical_pad = VSPACER(6)
We could then use the variable 'vertical_pad' (though without quotes) in-line in an actual block of text, which we would set using a normal DWIMBLOCK (Do-What-I-Mean Block).
PhonesBlock = DWIMBLOCK([F4,
IF(ph1_label, ' ', Phone1Word), NEWLINE,
vertical_pad,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
vertical_pad,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
vertical_pad,
IF(ph4_label, ' ', Phone4Word), NEWLINE,
vertical_pad,
IF(ph5_label, ' ', Phone5Word), NEWLINE,
vertical_pad,
IF(ph6_label, ' ', Phone6Word), NEWLINE,
], (20,20), (LEFT, BOTTOM))
In the above example, we would have 9 points of extra vertical space (added to the normal font leading) if there are 3 or fewer phones. If there are 4 or more phones, only 6 lines of extra space if there were 4 or more phones.
In the following example, we will test if more than 4 lines are included in a block by the user. If so, we will change the default font of F1 to font F2. In the fonts tab, we would configure font F2 to have a smaller point size and perhaps smaller leading.
To use this method, first you set your type into LINES, which exist in the style but are not actually drawn (yet) on the page. This is useful for getting a count of the total number of lines in a block, before drawing the block. Setup the LINES exactly the same as you would your block. In this case we need to put this logic in the phones section, above the phones, so that we can set the Phone Words in the correct font. The following code is inserted at the top of the "Words" tab in Style Editor Gold:
PhoneLines = DWIMLINES([F1,
IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
IF(ph4_label, ' ', Phone4Word), NEWLINE,
IF(ph5_label, ' ', Phone5Word), NEWLINE,
IF(ph6_label, ' ', Phone6Word), NEWLINE,
])
contact_font = F1
if len(PhoneLines) > 3:
contact_font = F2
Note that we are setting the default font to F1, but change this to F2 if there are more than three lines in the block. We then need to replace the font definition in the phone words with our new variable name for the font to use: contact_font:
Phone1Word = PHONEWORD(contact_font, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '*.*.* * *') Phone2Word = PHONEWORD(contact_font, (ph21, ph22, ph23, ph2_ext_lbl, ph24), '*.*.* * *') ...etc...
Lastly, in our blocks section, we now will also reference this font name. Move to the blocks tab and replace all occurances of your font name with this variable name:
PhonesBlock = DWIMBLOCK([contact_font,
IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
IF(ph4_label, ' ', Phone4Word), NEWLINE,
IF(ph5_label, ' ', Phone5Word), NEWLINE,
IF(ph6_label, ' ', Phone6Word), NEWLINE,
], (20,20), (LEFT, BOTTOM))
The system allows wrapped type to "scale" to fit inside a defined maximum vertical height. This is useful for marketing pieces where bios or other descriptions where different orders may have different amounts of text, all which must fit inside a tight spot on the product.
The example below shows a block of wrapped text with a maximum width of 220 points (listed twice) and a maximum vertical height of 50 points:
BigTextBlock = DWIMBLOCK([F1, WRAP, LINES(your_big_field, wrap=220, font=F1, maxheight=50),
], (20,20), (LEFT, TOP_BASELINE), (220, 0))
The font F1 will scale in point size until the text just barely fits this minimum physical size.
NOTE: On live sites it is a good idea to keep users "coloring inside the lines" by putting reasonable restrictions on the number of characters allowed in a multi-line inputs (also known as "textarea" or "big text field"). Generic Gold docs cover this in more detail - the goal is to not allow users to shrink the fonts so small that they are not legible.
Following is another example where a large number of variables (for a letter) are being forced to constrain inside a maximum height defined by the amount of room available in that letter - in this case, 400 points of vertical width. The maximum width of this block is 500 points wide. If the letter is long, ALL the text will shrink in point size, uniformly, until the text just barely fits inside 400 points of vertical height. This method only works with a single font - in this case, F1 is being used as font.
letter_text = LINES(JOIN([
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, ', ', card_state, ' ', card_zip, NEWLINE,
card_country, NEWLINE,
' ', NEWLINE,
letter_body_text,
' ', NEWLINE,
letter_salutation,
' ', NEWLINE,
name_first, ' ', name_last
]), wrap=500, font=F1, maxheight=400, wrap_lf=1)
LetterBlock = DWIMBLOCK([LEFT,
letter_text, NEWLINE
], (20,20), (LEFT,BOTTOM))
The parameter wrap_lf=1 is telling the system in the example above to honor any line feeds that the user entered. That way, if the user has a paragraph break in the body of their message, these will show on the printed product.
Lastly - and least common in our experience - you may wish to move one or more fields to another block in the event that there are too many lines in a particular block. Contact Support for help with this situation.
In many cases, there is a limited amount of horizontal room on a design or part of a design, requiring a change in behavior for the layout to work properly (or giving the user an error message). Following are the most common ways this is dealt with using PageDNA’s VIPER:
PhoneEmailBlock = DWIMBLOCK([F1, RIGHT,
Phone1Word, NEWLINE,
Phone2Word, NEWLINE,
Phone3Word, NEWLINE,
Phone4Word, NEWLINE,
Phone5Word, NEWLINE,
card_email], (240,14),
(RIGHT, BOTTOM), (150, 0))
In the above example, the block would scale any line longer than 150 points - as specified in the first field shown in bold above. Note that the maximum height field (shown as '0' above) does not have any affect on the block, but a number must be included.
In the latest version of the engine, VIPER decreases the point size for the offending line until it fits within the document boundary or defined block width. Another option is to have VIPER scale the line to fit using Horizontal Tracking.
To change the scaling method in your style from point size (default) to horizontal scaling, add the following line after your font definition in the "Fonts" tab of Style Editor Gold.
F1.scalemethod = 'hscale'
The code above would cause font F1 to scale - when and where required - using Horizonal Scaling. Similar definitions would be required for any other fonts you wish to use this behavior.
In other situations, you may wish to measure the length of a line, and then give the user an error message if the text they entered does not fit. This is often useful if the corporate identity specifies that you should not use font scaling to make things fit.
For example, to test and see if a particular field entered by the user (card_title1, in this example) is longer than 120 points when set in font F1 - presenting the user with an error message if this is the case - you would use the following syntax in the "Blocks" section of our style file:
if F1.stringwidth(card_title1) > 120:
COND("Your first title line is too long. Please re-format and try again.").
Note that the conditions to execute are indented two spaces below the line with the 'if' statement, and that this code must live outside of a block.
If you wanted to check a series of fields to see if they were longer than 120 points (in this case, all four title lines), you could use the following syntax:
if max(map(F1.stringwidth,[card_title1,card_title2,card_title3,card_title4])) > 120:
COND("One or more of your title lines is too long. Please re-format these fields and try again.").
Keep in mind that you can limit the number of characters passed into your style using the "Size/Max" control in the "Web Page Templates" interfaces including the "Personal" form and item forms, if present. Restricting users in the form does not cover all cases (such as the name field, which is most often comprised of two fields on the same line - first and last name), but putting reasonable constraints 'upstream' in the ordering interface ususally decreases the amount of logic necessary in styles. We then use logic in the styles to catch the remaining exceptions.
AddressPhoneBlock = DWIMBLOCK([F2, LEFT,
card_street1, IF(', ', card_street2), NEWLINE,
card_street3, NEWLINE,
card_city, ', ', card_state,
' ', card_zip, NEWLINE,
IF(ph1_label,' ',Phone1Word), NEWLINE,
IF(ph2_label,' ',Phone2Word)], (459, 649),
(LEFT, TOP_BASELINE), (124, 0), uniform_linescale=1)
In the above example, the block would scale downward ALL lines if one or more line is longer than 124 The bold text shows the new parameter to add to your block definition.
NameBlock = DWIMBLOCK([F1, LEFT, WRAP, card_company, NEWLINE, card_street1, NEWLINE, card_street2, NEWLINE, card_city, ' ', card_state, ' ', card_zip ], (12,12), (LEFT, BOTTOM), (120, 0))
Text will wrap naturally at the point where necessary - only if necessary. The system does not handle hyphenation. In the instance above, the block would wrap any lines of text if they exceeded 120 points of width to the next line. The text (120,0) defines the maximum width as this 120 points, and must be added to your standard block in the format shown above in bold, including the comma in front.
Word wrapping is more commonly encountered on complex Direct Mail items such as invitations, where the requestor might enter a bit of variable text of unknown length. The following example shows a block that might appear on such an item:
RSVPBlock = DWIMBLOCK([ LEFT, WRAP, F1, 'To reserve tickets for you and your guest, please call ', rsvp_phone, ' by ', rsvp_day, ', ', rsvp_mo, ' ', rsvp_dy, ', ', rsvp_yr, NEWLINE, ], (25,25), (LEFT, BOTTOM), (372, 0))
The above example would show the RSVP text - substituted with the customer's personalization - and wrapped at 372 points, growing from the bottom up.
First, confirm that you are using the most current library for the PageDNA engine by opening your style in Style Editor Gold... visit the 'Other' tab and ensure that sos_module is set to "SOS16". If it is not, change this field and save. You will need to perform this action on each style on which you wish to use word wrapping.
Next, define a maximum block width for your block - see "Forced Justification" above for an example of how this works.
Lastly, add the term 'WRAP' in-line at the beginning of the information in your block:
AddressBlock = DWIMBLOCK([F2, WRAP, card_division, NEWLINE, card_street1, NEWLINE, card_street2, NEWLINE, card_street3, NEWLINE, card_city, IF(', ', card_state), ' ', card_zip], (12,12), (LEFT, BOTTOM), (100, 0))
It is possible to configure word wrapping so that the first line is flush left, but then all subsequent lines are intended horizontally, under this first line. This requires a different approach than normal word wrapping. First you need to set each variable as a LINE, and then call these lines from inside your style.
The following example assumes that you have a block with Names and Titles, and you want the titles to wrap if they get too long, but when wrapped to the newline, to have these wrapped lines indented a few spaces. Here is our original block, with word wrapping turned on for any lines longer than 100 points:
NameTitleBlock = DWIMBLOCK([F2, WRAP, name_first, IF(' ', name_last), NEWLINE, card_title1, NEWLINE, card_title2, NEWLINE, card_title3, NEWLINE, card_title4, NEWLINE, card_title5, NEWLINE, ], (12,12), (LEFT, BOTTOM), (100, 0))
Following is the code modification necessary to have the titles wrap with indentation. Changes are shown in bold.
if card_title1: title1_line = LINES(card_title1, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB]) else: title1_line = '' if card_title2: title2_line = LINES(card_title2, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB]) else: title2_line = '' if card_title3: title3_line = LINES(card_title3, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB]) else: title3_line = '' if card_title4: title4_line = LINES(card_title4, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB]) else: title4_line = '' if card_title5: title5_line = LINES(card_title5, font=F2, wrap=100, align=LEFT, newline=[NEWLINE,TAB]) else: title5_line = '' NameTitleBlock = DWIMBLOCK([F2, WRAP, name_first, IF(' ', name_last), NEWLINE, title1_line, NEWLINE, title2_line, NEWLINE, title3_line, NEWLINE, title4_line, NEWLINE, title5_line, NEWLINE, ], (12,12), (LEFT, BOTTOM), (100, 0), tabs=[20])
The first bit of logic tests to see if the user has a title for each available field. If it finds one, it creates LINES that wrap if necessary at 100 points (wrap=100) and that wrap's new lines are TAB indented. If no field is present it defines the line as blank, to ensure no errors can occur. The last bit is to change the fields in your block to reference these new lines (instead of the original variable name), and then lastly to specify a tab stop to intent to. In the example above, the tab stop is 20 points in.
First, we create two new variables by assigning them a null (blank) value - represented by two single quotes. Next we start our logic examples, testing and splitting certain titles into these two fields. Lastly, we set the block, referring to these two new variable names for title 1's first line (card_title1_1) line 1 and line 2 (card_title1_2). If line 2 is not present, it is ignored by the layout system.
card_title1_1=''
card_title1_2=''
if card_title1 == 'Marketing Program Coordinator, Certified Consumer Credit Counselor':
card_title1_1 = 'Marketing Program Coordinator'
card_title1_2 = 'Certified Consumer Credit Counselor'
elif card_title1 == 'Aging Specialist, Social Worker':
card_title1_1 = 'Aging Specialist'
card_title1_2 = 'Social Worker'
elif card_title1 == 'Another Sample Title, Social Worker':
card_title1_1 = 'Another Sample Title'
card_title1_2 = 'Social Worker'
else:
card_title1_1 = card_title1
NameBlock = DWIMBLOCK([LEFT,
F1, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '), name_last, IF(', ', name_suffix), NEWLINE,
F2, card_title1_1, NEWLINE,
card_title1_2
], (104.1, 117.0), (LEFT, TOP_BASELINE))
This example can be altered to fit many other scenarios. Please note that if you change the titles in the list (even a subtle spelling or capitalization change) you will need to update your style(s) accordingly.
You can turn off word wrapping by inserting the NOWRAP command, as in the following example where we turn off wrapping before the city, state and zip code lines:
AddressBlock = DWIMBLOCK([F2, WRAP,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
NOWRAP, card_city, IF(', ', card_state),
' ', card_zip], (12,12), (LEFT, BOTTOM), (100, 0))
If using phone numbers with a tabbed leader, please see below for an example with a phone number.
Use a tabbed leader when you need the text to appear as follows:
Introduction ..................... Page 1
Chapter 1 ........................ Page 5
In the "Pre-blocks" section in Visual Style Editor, or at the top of the Blocks section in Style Editor Gold, add this code for static text:
def contentsline(font, content, page, width):
leftover = width - font.stringwidth(content + page)
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, content, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), page]
Block0 = DWIMBLOCK([
contentsline(F1, 'Introduction', 'Page 1', 108), NEWLINE,
contentsline(F1, 'Chapter 1', 'Page 5', 108), NEWLINE,
], (206, 710), (LEFT, TOP_BASELINE))
def contentsline: the variable contentsline can be changed to fit your needs. The definition of contentsline includes font, the left variable, the right variable and the overall width of a line.
leftover: change content and page to match your variables.
ndots: The only thing you may need to change in this line would be the '.' if you are using something else as the tabbed leader
return: change the variables content and page to match yours. You can change the leader from '.' to whatever you need as a tabbed leader.
For each line in the block, the font, text on the left, text on the right and the maximum width of the line of text is specified.
Another example using variable text
def daytimeline(font, day, time, width):
leftover = width - font.stringwidth(day + time)
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, day, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), time]
time1 = [time11_1, ' ', time11_2] + list(IF('–', time12_1, ' ', time12_2))
time1 = ''.join(time1)
time2 = [time21_1, ' ', time21_2] + list(IF('–', time22_1, ' ', time22_2))
time2 = ''.join(time2)
day1 = (day1mo + ' ' + day1dy + ', '+day1yr)
day2 = (day2mo + ' ' + day2dy + ', ' + day2yr)
if not day1mo:
day1 = ''
if not day2mo:
day2 = ''
Block0 = DWIMBLOCK([LEFT,
daytimeline(F2, day1, time1, 300), NEWLINE,
daytimeline(F2, day2, time2, 300), NEWLINE,
], (32, 95), (LEFT, TOP_BASELINE))
def daytimeline: the variable daytimeline can be changed to fit your needs. The definition of daytimeline includes font, the left variable, the right variable and the overall width of a line.
leftover: change day and time to match your variables.
ndots: The only thing you may need to change in this line would be the '.' if you are using something else as the tabbed leader
return: change the variables day and time to match yours. You can change the leader from '.' to whatever you need as a tabbed leader.
time11_2, time12_2, time21_2 and time22_2 represent "am" and "pm"
The first "line" of the definition of each of the times sets the starting and ending times. The second line joins the starting and ending times together in one variable so it can be easily set in the block as a single variable.
The If statements for day1mo and day2mo are designed to prevent the separators between the month, day and year from printing if either of the dates is missing.
For each line in the block, the font, text on the left, text on the right and the maximum width of the line of text is specified.
An example that prevents the tabbed leader from appearing if there is no data
def analysisline(font, analysis, percent, width):
if not (analysis or percent):
return[]
leftover = width - font.stringwidth(analysis + percent)
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, analysis, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), percent]
Block1 = DWIMBLOCK([ CENTER, LINEWRAP,
F1, CASE('upper'), IF(prod_name),VSPACER(5), NEWLINE,
F2, IF(prod_subname), VSPACER(5), NEWLINE,
F3, CASE(None), IF('DESCRIPTION', VSPACER(2), NEWLINE,
F5, descrip), VSPACER(5), NEWLINE,
IF(F3, 'GUARANTEED ANALYSIS', VSPACER(2),NEWLINE,
IF(priceline(F4, analy_l1, analy_r1, 216)), NEWLINE,
IF(priceline(F4, analy_l2, analy_r2, 216)), NEWLINE,
IF(priceline(F4, analy_l3, analy_r3, 216)), NEWLINE,
IF(priceline(F4, analy_l4, analy_r4, 216)), NEWLINE,
IF(priceline(F4, analy_l5, analy_r5, 216)), NEWLINE,
IF(priceline(F4, analy_l6, analy_r6, 216)), NEWLINE,
IF(priceline(F4, analy_l7, analy_r7, 216)), NEWLINE,
IF(priceline(F4, analy_l8, analy_r8, 216)), NEWLINE,
IF(priceline(F4, analy_l9, analy_r9, 216)), NEWLINE,
IF(priceline(F4, analy_l10, analy_r10, 216)), NEWLINE,
IF(priceline(F4, analy_l11, analy_r11, 216)), NEWLINE,
IF(priceline(F4, analy_l12, analy_r12, 216))), NEWLINE,
], (149.6, 192), (CENTER, CENTER),(266,324))
The definition of analysisline is similar to the examples above for what should be changed.
In Block1, we start by collecting variable information above the lines showing the composition of the product that have the tabbed leader.
There can be up to 12 lines with a tabbed leader. These are the lines that begin with "IF(priceline" where each line contains the font, the first variable, second variable and the maximum length of the line.
In this example there is both a length limit of 266 points and a height limit of 324 points for the block.
Tabbed Leader with Phones
def phoneline(font, phone, label, width):
if not (phone or label):
return[]
leftover = width - (phone.width + font.stringwidth(label))
ndots, gap = divmod(leftover, font.stringwidth('.'))
return [font, phone, SPACER(gap/2), '.' * int(ndots), SPACER(gap/2), label]
Block2 = DWIMBLOCK([LEFT, LINEWRAP,
F6, card_company, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, ' ', card_state, ' ', card_zip, NEWLINE,
SPACER(15), phoneline(F8, Phone1Word, ph1_label, 105), NEWLINE,
SPACER(15), phoneline(F8, Phone2Word, ph2_label, 105), NEWLINE,
IF(SPACER(15),card_email), NEWLINE,
F2, IF(SPACER(15), card_www), NEWLINE,
], (10, 202), (LEFT,TOP_BASELINE))
In this example, we need to determine the width of the phone number differently because the PhoneWord is an object. So, the line that begins with leftover shows this change in bold.
To indent, the simplest method is to add a SPACER command to the beginning of the line. The SPACER will have no affect if the line is empty due to "return[]".
However, the SPACER before card_email and card_www needs to be enclosed in an IF statement to prevent the SPACER from appearing and activating the NEWLINE command, which would result in a blank line.
Everything else is similar to the other examples given above.
NameBlock = DWIMBLOCK([F4, CENTER, CASE('upper'), name_first, IF(' ', name_middle), ' ', name_last, IF(', ', name_suffix), NEWLINE, F3, CASE(None), card_title1, NEWLINE, card_title2, NEWLINE, CASE('lower'), card_email], (126,75), (CENTER, TOP_BASELINE))
You may come across a need to split email address into two different variables on the layout; one made up of the information contained to the left of the '@' symbol and another of the information contained to the right of the '@' symbol. For example, a customer may want to have their email address split in to two lines. This document will show you how to accomplish that.
These instructions are for Style Editor Gold. For instructions on how to accomplish this using Visual Style Editor click here "Basic email wrapping at '@' symbol in Visual Style Editor"
At the top of your blocks insert the following code:
if card_email and '@' in card_email:
card_email, email1tag = card_email.split('@')
else:
card_email = card_email
Note that the code checks whether there is actually an @ sign in the card_email variable. If this was not done we could end up with a programming error: without an '@' the split('@') would return only one value, while there are two variables to fill. This will then cause a programming error.
From this point on we will edit style blocks as normal. Below are two examples.
This code pulls the information to the left of the '@' symbol (the prefix) and assigns it to the variable card_email. Information to the right of the '@' symbol (the domain information) is assigned to the variable email1tag.
Here is an example of how to include the '@' symbol on the same line as the email prefix.
Block10 = DWIMBLOCK([CENTER, F2, IF(card_email, '@', NEWLINE, email1tag) ] , (72, 100), (LEFT, TOP_BASELINE))
Here is an example of how to include the '@' symbol on the same line as the domain information.
Block10 = DWIMBLOCK([CENTER, F2, IF(card_email, NEWLINE, '@', email1tag) ] , (72, 100), (LEFT, TOP_BASELINE))
It is very common on a variable imprint item such as a stationery product, that users will be allowed to choose different labels for their phone numbers. Sometimes the user can choose to NOT have a phone label, which presents a few minor concerns in your style file (layout).
PageDNA recommends that you set the style value for any such phone label to '*blank*' in the "Personal" form for that item (without the single quotes), and that you use the code below to clear any phone labels where the user has selected a blank phone number:
if ph1_label == '*blank*': ph1_label = '' if ph2_label == '*blank*': ph2_label = '' if ph3_label == '*blank*': ph3_label = '' if ph4_label == '*blank*': ph4_label = '' if ph5_label == '*blank*': ph5_label = '' if ph6_label == '*blank*': ph6_label = ''
The above code should be OUTSIDE any blocks. Note that there is no blank line between each 'if' statement and the code to execute. Also notice how the code to execute is indented two spaces under each 'if' statement. These patterns must be followed to ensure this logic works correctly in your style.
Make sure this logic appears in the blocks section, but before the block where the phone numbers are layed out in the style. Also be certain that your Block will display correctly regardless of whether or not there is a phone label. We recommend the following syntax to cover both cases well:
PhonesBlock = DWIMBLOCK([F2,
IF(ph1_label, ' '), Phone1Word, NEWLINE,
IF(ph2_label, ' '), Phone2Word, NEWLINE,
IF(ph3_label, ' '), Phone3Word, NEWLINE,
], (126,85), (CENTER, TOP_BASELINE))
The 'IF' above would ensure that the phone label and then a single space would appear, but ONLY if a phone label existed. Otherwise, the number would appear all by itself on this line.
Some customers only allow numbers to be entered as phone numbers, and wish to discourage requestors from getting too 'creative' with their phones. The following logic checks that the phone number has numeric characters only, and gives an error message if this is not the case.
if ph11 and ph12 and ph13:
for char in ph11+ph12+ph13:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
The above code should be OUTSIDE any blocks, but you can put it in the 'blocks' tab of Style Editor Code. Note that there is no blank line between each 'if' statement and the code to execute. Also notice how the code to execute is indented two spaces under each 'if' statement. These patterns must be followed to ensure this logic works correctly in your style.
For sites involving ONLY international phones, the above code should be changed to the following:
if ph1:
for char in ph1:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
For sites allowing both domestic and international phones, your code will need to be more complex:
if phtype == 'intl':
if ph1:
for char in ph1:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
else:
if ph11 and ph12 and ph13:
for char in ph11+ph12+ph13:
if char not in '0123456789':
COND('Phone 1 is not all numbers - please edit')
break
Note that the examples above ONLY cover phone 1, and that you need to change all fields named or starting 'ph1' to 'ph2' for Phone 2, etc.
In some cases, you may allow your user to type in their own phone label, using the "Personal Form" option to turn this on. You may wish to force capitalization of the first letter of each word in the phone's label. For example, if the user enters a phone label as "home office:", you may want the system to force this to say "Home Office:" for branding / consistency purposes.
Fortunately, this is very easy. Put the following code outside of your blocks, but before the phone label is typeset. In some cases, phone labels are added in the "words" section - so if you don't see these fields in the "blocks" section, check the "words". The following needs to appear outside of any blocks, with one line for each phone label:
ph1_label = ph1_label.title() ph2_label = ph2_label.title() ph3_label = ph3_label.title() ph4_label = ph4_label.title() ph5_label = ph5_label.title() ph6_label = ph6_label.title()
If the incoming variable must be a number and nothing but a number, enable the pre-blocks tab in the VSE and use code like this:
try:
font_size = float(font_size)
except:
font_size = 0
COND("Font size must be a number")
In the exampe above the code checks that the user has entered a number to define how large they want a font to be. The example can be extended to check that the number being entered is in fact positive:
try:
font_size = float(font_size)
except:
font_size = 0
COND("Font size must be a number")
else:
if font_size 'less than symbol'= 0:
COND("Font size must be a positive number")
In the example above the code forst checks that it has a number and then checks to make sure that the number is positive.
In some cases, you may allow your user to type in their own phone label, using the "Personal Form" option to turn this on. You may wish to make sure that - no matter what the user types in - that there is a colon at the end of their phone label, for branding consistency. For example, if the user enters a phone label as "office", you may want the system to force this to say "office:"
Fortunately, this is very easy. Put the following code outside of your blocks, but before the phone label is typeset. In some cases, phone labels are added in the "words" section - so if you don't see these fields in the "blocks" section, check the "words". The following needs to appear outside of any blocks - in the sample below, we are enforcing this for 6 phones:
if ph1_label:
if ph1_label[-1] != ':':
ph1_label += ':'
if ph2_label:
if ph2_label[-1] != ':':
ph2_label += ':'
if ph3_label:
if ph3_label[-1] != ':':
ph3_label += ':'
if ph4_label:
if ph4_label[-1] != ':':
ph4_label += ':'
if ph5_label:
if ph5_label[-1] != ':':
ph5_label += ':'
if ph6_label:
if ph6_label[-1] != ':':
ph6_label += ':'
Some customers wish to check that the user completed filled out each phone number - for example, not allowing a user to have fewer than 3 digits in the area code section. Following is code to check a domestic phone (Phone 1) for completeness of each digit entered:
if ph11 and ph12 and ph13:
if len(ph11) != 3:
COND("The area code must have three digits for Phone 1!")
if len(ph12) != 3:
COND("The phone prefix must have three digits for Phone 1!")
if len(ph13) != 4:
COND("The phone postfix (last bit) must have four digits for Phone 1!")
The above code should be OUTSIDE any blocks, but you can put it in the 'blocks' tab of Style Editor Code. Note that there is no blank line between each 'if' statement and the code to execute. Also notice how the code to execute is indented two spaces under each 'if' statement. These patterns must be followed to ensure this logic works correctly in your style.
Note that the examples above ONLY cover phone 1, and that you need to change all fields named or starting 'ph1' to 'ph2' for Phone 2, and so forth.
To link a checkbox to a phone number, you must perform the following:
1) Have the checkbox enabled in the personal form. 2) Specify the variable (variable names are in green on the personal form). 3) At the very beginning of your code in the Item Editor, specify the action to be taken using code similar to the following:
if include_ph1 != '1':
Phone1Word=''
Where include_ph1 is the name of the checkbox and Phone1Word is the name of the text for the phone number, the above code reads as follows: "if the checkbox is not equal to one, then the phone number is blank."
In our ever shrinking world, it is increasingly common to have phone numbers on printed products with many different formats. Although North America and other parts of the world have standardized on a phone number format, most of the rest of the world does not adhere to the "US" phone format, namely: (###) ###-####
PageDNA’s software allows your users to indicate that they require international phones on their products, so that they get a free text input in which to type a phone, versus the standard PageDNA "US" phone format which forces the user to type area codes, prefix and extension independently.
This option can also be made automatic, for sites catering primarily to non-US audiences. See documentation on "Catalog Admin" in the "Site Configuration" docs for more information.
Once the forms are configured, each style that may have international phones needs minor modifcations to ensure that the phone behaves properly in both cases.
To enable International phones, you must insert something such as the following into the "Words" section of your style. Your personal options will vary, so cut and paste this code into your style with care. Pay attention to the font names - F2 is used below - as well as the format for your phones.
if intl: Phone1Word = WORD(ph1, F2) Phone2Word = WORD(ph2, F2) Phone3Word = WORD(ph3, F2) Phone4Word = WORD(ph4, F2) Phone5Word = WORD(ph5, F2) Phone6Word = WORD(ph6, F2) else: Phone1Word = PHONEWORD(F2, (ph11, ph12, ph13), '*.*.*') Phone2Word = PHONEWORD(F2, (ph21, ph22, ph23), '*.*.*') Phone3Word = PHONEWORD(F2, (ph31, ph32, ph33), '*.*.*') Phone4Word = PHONEWORD(F2, (ph41, ph42, ph43), '*.*.*') Phone5Word = PHONEWORD(F2, (ph51, ph52, ph53), '*.*.*') Phone6Word = PHONEWORD(F2, (ph61, ph62, ph63), '*.*.*')
Note that there is no blank line between each 'if' statement and the code to execute, nor between that code and the 'else' switch statement or the code below _that_. Also notice how the code to execute is indented two spaces under each 'if' statement. These patterns must be followed to ensure this logic works correctly in your style.
Make sure this logic appears in the Words section. You can then refer to the Phones in your blocks as usual, without fear that users around the world will be accomodated.
Occasionally one may wish to block users from using certain characters for a particular free-text input. This one is a bit tricky. First the code, then the explanation:
PUNCT = ',.!;'
for char in PUNCT:
if char in name_first:
COND(char + " not allowed in first name")
if char in card_street1:
COND(char + " not allowed in street name")
Notice how we define a string called PUNCT that contains all the characters you disallow. Next you loop over the string one character at a time, checking each field to see whether it has that character. If it does, you give the user a COND() warning.
There are faster/better ways of doing this in Python -- we can help you with those if you want, but this is probably the simplest method to explain.
WARNING: unless you absolutely have to, you probably want to allow the single quote in addresses because of street names like O'Farrell.
First, create your block as you would normally. Below is a simple block with a web address using the normal variable name for this field - card_www:
WebBlock = DWIMBLOCK([F1,
card_www
], (126,75), (LEFT, TOP_BASELINE))
Now, all we need to do insert the following code in front of this block, testing to see if the user checked the 'include website?' checkbox (called 'include_www'). If the user did not check this, we will clear the value for card_www by setting it equal to two single quotes with nothing in between. This removes the website from the imprint.
if include_www != '1':
card_www = ''
WebBlock = DWIMBLOCK([F1,
card_www
], (126,75), (LEFT, TOP_BASELINE))
When the checkbox is selected by the user, include_www is equal to 1, and the website will remain. The above example would also work if the website had a label, as long as the label and the website are enclosed in an IF logic wrapper:
if include_www != '1':
card_www = ''
WebBlock = DWIMBLOCK([F1,
IF('Website: ', card_www)
], (126,75), (LEFT, TOP_BASELINE))
Note that the second website address has the same option, but you will need to reference include_www2 for the checkbox, and refer to the website as card_www2. These variable field names can be identified in "Personal Form" menu item near the individual configuration options, marked in green text.
You may encounter a product which has 'forced justification' - namely, regardless of what information is entered by the user for the block in question, the text must align snugly to the right and left sides of the block of text, with spacing added between sections evenly so as to 'pad' the layout and make everything look uniform.
In Quark, this is known as "FORCED" justification. In Microsoft Word, this is called "Justify" or "Justified Horizontal Alignment". Regardless of what it is called, in our system the command to activate this behavior is called TRACKFILL. Simply add the TRACKFILL tag in-line in your block definition, and ensure that you have defined a maximum block width for your block:
AddressBlock = DWIMBLOCK([F2,
TRACKFILL,
IF(' ', card_street1),
IF(', ', card_street2),
IF(', ', card_street3),
IF(', ', card_city),
IF(', ', card_state),
IF(' ', card_zip)
], (12,82), (LEFT, BOTTOM), (228, 0))
This block would be positioned 12 points from the left side of the product, and would extend over 228 points (for a business card, this would take the block to within 12 points of the right edge of the product). Note the extensive use of IF - this ensures that no extranneous spaces are found in the block - important for the task at hand. The layout engine will insert spaces between all elements in the block such that spacing is even... any extra floating spaces would be magnified.
On sites with different divisions, sometimes the only difference between each division is the 'shell' or the pre-printed master business cards or other items are printed on. Following is an example showing how to change the combine image (our 'virtual master') based on which division the user is ordering for. The following example assumes that you are using PageDNA’s "Divisions" step to break users into different groups, and for the same of this demo, we are using two ficticious divisions:
DIVISION TAG DIVISION NAME
------------ -------------------
corp Corporate Division
marketing Marketing Divisions
First, visit the "order" tab in your style and add the following as the first line:
corp_tag = ''
Note that the above is two single quotes, not a double quote.
Next prepare 'combine' images for the product, one for each division, such that your "divisions tag" is part of the GIF file name. For this example, there would be two GIF images:
bc_combine_corp.gif
bc_combine_marketing.gif
You will need to upload these files to the 'con' (Content) directory on your site using the File Uploader menu item.
Lastly, in the "previews" section of your style , add the following logic (shown in bold) to the "normal" proof, replacing your current combine image. The code for your style may vary slighly - only change the portions that are necessary.
{
'normal': {
'scale': 2.0,
'combine': './con/bc_combine_%(corp_tag)s.gif',
'use_magick': 1,
},
}
Note that the system will replace the fragment:
%(corp_tag)s
with your division's tag at the time of proofing.
In the previous example, we show how to change the master image (combine) by division, so that users see the correct proof on their products when you have different 'shells' or masters. In other cases, you may need to chage an actual EPS file based on the division the user selected, or another variable. This is performed similarly. Again, we will assume that there are two divisions for this example:
DIVISION TAG DIVISION NAME
------------ -------------------
corp Corporate Division
marketing Marketing Divisions
Next prepare 'combine' images for the product, one for each division, such that your "divisions tag" is part of the GIF file name. For this example, there would be two GIF images:
bc_logo_corp.eps
bc_logo_marketing.eps
You will need to upload these files to the 'con' (Content) directory on your site using the File Uploader menu item.
Lastly, in the "blocks"" section of your style , add the following logic (shown in bold) to the "normal" proof, replacing your current combine image. The code for your style may vary slighly - only change the portions that are necessary.
MasterBlock = DWIMBLOCK([EPSWORD('con/bc_logo_%s.eps'%corp_tag, xscale=1, yscale=1)],
(0, 0), (LEFT, BOTTOM), layer=-1)
Note that the system will replace the fragment:
%s
with your division's tag at the time of proofing. You can change 'corp_tag' in the example above to another variable if you wish to use this for another application.
Many companies wish to ensur that their users are printing company approved email addresses only on company materials. One way to offer enforcement is to check that the domain name or ending of the email is an exact match to the desired company email.
if not card_email.endswith('@yourdomain.com')
COND('Your email must end with @yourdomain.com')
In the example, the code used checked the ending for a pattern and if that pattern is not found the error message contained in the COND() statement will keep the user from continuing to the proof screen. .startswith() could be used in a very similar way.
if card_title.startswith('Vice President'):
COND('Please order Executive bsiness cards')
The following example is designed to scale type equally across three different blocks. It requires that you set each block twice. Once to determine the font size in each block; determine the scale; then set the block a second time to apply the scaling.
The following example would all be placed in Preblocks or in the Blocks tab of and older style.
Block0 = DWIMBLOCK([F1, '0. This will not scale.'], (10,70), (LEFT,
BOTTOM), (144, 0))
Block1 = DWIMBLOCK([F1, '1. This is a very long sentence which will
cause scaling.'], (10,50), (LEFT, BOTTOM), (144, 0))
Block2 = DWIMBLOCK([F1, '2. This will scale to #1.'], (10,30),
(LEFT, BOTTOM), (144, 0))
Block3 = DWIMBLOCK([F1, '3. This will also scale to #1.'], (10,10),
(LEFT, BOTTOM), (144, 0))
# calculate the smallest scale factor applied to any line.
minscale = 1
for block in (Block1, Block2, Block3):
for line in block.lines:
scale = line.get_scale_amount()
if scale:
minscale = min(minscale, scale)
block = None
# print that scale to preview - not required
Block4 = DWIMBLOCK([F1, 'this is the minscale: ', str(minscale)],
(10, 90), (LEFT, BOTTOM))
# make new font, and re-typeset all blocks with same scale
F2 = F1.clone()
F2.pointsize = F1.pointsize * minscale
Block1 = DWIMBLOCK([F2, '1. This is a very long sentence which will
cause scaling.'], (10,50), (LEFT, BOTTOM), (144, 0))
Block2 = DWIMBLOCK([F2, '2. This will scale to #1.'], (10,30),
(LEFT, BOTTOM), (144, 0))
Block3 = DWIMBLOCK([F2, '3. This will also scale to #1.'], (10,10),
(LEFT, BOTTOM), (144, 0))
Font could aslo be redefined as F1 and F1a if using multiple fonts which all need to be redefined. That may make it easier to keep things straight in the ong term.
PageDNA offers robust support for scaling and cropping images - whether user uploaded or chosen from a list of pre-loaded assets. Read on to learn how these features work in the "Style Editor Gold" (older, code-based) interface.
Note: You are currently in the section of our documentation that explains the older style editor, "Style Editor Gold". Photos and logos are much easier to edit using the "Visual Style Editor". If you are tired of looking at all the code examples below (and in your style), please read the section Working with Photos and Logos - VSE
Photo Cropping
A key selling point for any web-based solution is the ability to upload images or custom graphics as part of a business card, flyer, or brochure. However, users don't want to give up control over how images appear and are placed in a document. The PageDNA system contains tools which help control both quality and placement of images uploaded by the user into any variable print item.
In this example, we have a business card which will have an uploaded photo placed upon it. The base style code, with the Photo block highlighted for emphasis, looks like this:
A "block" for the photo has been added to this style. Lets look more closely at this photo block and learn how the code works:
UploadedPhotoBlock= DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
Every block in a style needs to have a unique name. Highlighted above you can see that we have given this block the name "UploadedPhotoBlock".
UploadedPhotoBlock = DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
Highlighted above is the "variable name" for the photo that will be uploaded to fill this spot - namely, 'upload_photo'. See below to learn how to create the form that will populate "upload_photo" with the user's photo.
UploadedPhotoBlock = DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
Next up is the "resize" command, which is telling the system to fit the photo into a maximum "picture frame" of 54 wide by 81 points tall (points are the only supported unit). While it is possible to have a photo block without a resize command in place, the results would cause major problems and therefore in almost all instances you want a resize command in place. Specifically, without resize parameters defined, the photo would be displayed at the size (scale) the user uploaded - which is almost certain to be the wrong size - a large photo could block display of the entire proof..
UploadedPhotoBlock = DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
The 'aspect' command says to use uniform aspect ratio when scaling this photo to fit. This is the most common setting and will ensure that the photo is not "squished" when scaled. See below for more options.
Aspect ratio is the ratio of the width to the height of the image. In the example the photo is about 50% taller than it is wide which makes the aspect ratio 1.5, or width x 1.5 = height. For a photo, you almost always want width to change when height changes, and vice versa. If this box is unchecked, the following "Too Wide" or "Too Narrow" could occur:
The Preserve aspect ratio command (aspect=1, as shown above)when used in conjunction with resize will fit the entire image into the defined picture window by sizing the entire image down so the longest dimension fits within the window. This command does not crop any portion of the uploaded image. It produces an image which looks like this:
Note that the width of the image is actually narrower than the block.
UploadedPhotoBlock = DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
Now we are on to the "block anchor point" for the photo. In this case, the photo "anchor" (fixed point where photo is placed) is defined to be 213.9 points over from the left side of the business card, and 106 points up. This is only half of the position definition, however. The second half is the block alignment:
UploadedPhotoBlock = DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
The highlighted "block alignment" above indicates that the anchor measurements (highlighted above) define in this case the CENTER (horizontal) and MIDDLE (vertical) of the photo. In other words, the photo will be centered around the anchor point. In other situations you will find yourself needing to anchor photos in different positions (eg, TOP and LEFT if a product has a photo anchored in the top left of the business card, so that in this case there will never be a gap if a photo is resized.
Horizontal alignment options are: LEFT, CENTER, or RIGHT
Vertical alignment options are: BOTTOM, MIDDLE, or TOP
UploadedPhotoBlock = DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
Lastly, this photo is being displayed in layer "-1"... not that this is above the logo layer ("PreviewBlock") which is found at layer -2... we want the photo to be floating above the background image / logo. The lower the negative number, the deeper in the stack that photo will appear. These layers can be used for creative layering effects (tiling photos, or even masking uploaded photos).
There is another setting you may wish to enable on a photo, not shown above: "Crop".
Enabling the Crop option will shrink the image until the narrowest dimension fits within the size defined by "resize" - the longer dimension will be trimmed. Above is an example of a cropped image. In this case, the width has been matched to that of the block, and the top and bottom of the image have been trimmed accordingly.
Let's look at the "Preserve Aspect Ratio" and "Crop" commands on a sample business card.
In the above example, the photo has been scaled to fully fit within the defined window. In this case, it works well is because the aspect ratio of the uploaded image is roughly that of the defined window.
However, In this example, a "landscape" image (wider than it is tall) gives unexpected results. To allow the width to fit, the height was reduced considerably and is now a bit too small.
The above demonstrates one of the reasons why it is important to use the "pre-flightng" tools available in the options for uploading an image using the File Upload Button field, shown below.
First, a form needs to be created or edited to include an upload field. Upload fields can be added to Form Editor and Shared Item forms. There are two upload fields. The File Upload to Style Button is simplest, and you may find it adequate. It is found under the Upload section when adding a new field. The File Upload Button field is more complex. It allows for greater control, especially regarding file types and color space, and allows user cropping to be disabled. When adding a new field, the File Upload To Style Button field is located under the Upload section and the File Upload Button field is located under the Advanced section.
The cropping feature needs to be enabled on each item that you want to have offer User Image Cropping. This can be done in either the Form Editor when using the File Upload Button field or the Generic Gold form. Cropping cannot be disabled for an individual field when using the File Upload To Style Button field.
File Upload To Style Button Field
![]() | Important |
|---|---|
If you need to not allow cropping for an uploaded image, you will need to use the File Upload Button field, described below. |
First, configure an image upload input: In your item form, add a new field. Expand the Upload section, and select File Upload To Style Button for the field type.
Variable Name: Enter a variable name, e.g. upload_file. This will be used in the style when you create a new Photo Block.
Variable Names can be shared on a site as long as the site is using the multi-imprint (shopping basket) feature.
Field Label: This will appear beside the field for the user, e.g. "Upload File:"
File Conversion: Enable the Original Color or Black and White radio button as needed.
Aspect Ratio Checking - EPSWORD Width: Enter the minimum size in points. There are 72 points per inch.
Aspect Ratio Checking - EPSWORD Height: Enter the minimum height in points.
Aspect Ratio Checking - Minimum Resolution: Enter the minimum resolution you are willing to print this image, e.g. 300 (for 300 dpi).
![]() | Note |
|---|---|
The user will be able to crop the uploaded image if cropping has been enabled on the site. This is done in the menu in Web Templates > File Upload Popup only when using the Flash-based File Uploader. If you specify both the width and height, the user will be presented with a single slider to adjust the size of the cropped area. The aspect ratio will be maintained as the area to be cropped is adjusted. The user will not be able to crop to less than the minimum dimensions specified. If you specify only one dimension, the user will be presented with two sliders to adjust the cropped area's height and width. They will not be able to crop to less than the minimum dimension specified. The user can drag the cropped area around to capture the part of the image they need. After cropping, there is a Crop button on the form. So, the user can re-crop the image after proofing. |
File Upload Button Field
If you are using the File Upload Button field, found under the Advanced section when adding a field, then you will need to check the 'Enable Cropping' checkbox when you are setting the options of the File Upload section.
By specifying an aspect ratio, you can prevent images from being uploaded that won't "work" with the layout. To allow either "portrait" (tall) OR "landscape" (wide) images, it's best to use a square frame.
File Upload To Style Button Field
adasfd
In Style Editor Gold, crop is added as an additional parameter to the block definition:
UploadedPhotoBlock = DWIMBLOCK([EPSWORD(upload_photo, resize=(54, 81), aspect=1, crop=1)],
(213.9, 106), (CENTER, MIDDLE), layer=-1)
In the box above, the "Crop" command has been enabled. When used in conjunction with the preserve aspect ratio and resize commands, the crop command will fill the defined picture window with the narrowest dimension of the image, centering the image in the window, and cropping off the "extra" content of the longer dimension.
With the crop command turned on, our first image looks basically the same:
Although close inspection will show that the image is now slightly taller and the subject's shoulders have been slightly cropped out of the frame. This photo matches the original design spec very well.
But what happens when a photo which does not conform to the best aspect range is used?
The image is filling the full height of the frame, but since the subjects are wider than the window allows, their features are being cut out of the frame.
The issues above highlight why we recommend that any uploaded image also be attached to the vender email. Subjects which are out of center in the original or which are too wide or tall in general may be fixable by pre-press after the order is placed by editing this raw photo.
In all the examples so far the photo block has ben anchored in the center of the image, which is the recommended setting. However some designs will call for a photo to bleed. Photo or image blocks function in the same way that al other blocks function the anchors can be changed to accommodate bleeds or other design needs. If you have a bleed and the photo flows off the trimmed dimensions, simply anchor the photo in the corner (of the full bleed).
There are cases where you want to move blocks around on a design, based on a variety of different conditions. VIPER supports the following common examples of ways to have blocks move around dynamically.
You may need to create a style wherein a block of text moves in a certain situation - say, a certain number of lines appears in another block, crowding the block in question on the item.
In the example below, we will move the NameBlock up 10 points if the AddressBlock has 5 lines of text, or up 20 points if the AddressBlock has 6 or more lines of text.
NameBlock = DWIMBLOCK([F1, name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F2, card_title1, NEWLINE,
card_title2], (12,70), (LEFT, TOP))
AddressBlock = DWIMBLOCK([F2,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, IF(', ', card_state),
' ', card_zip], (12,12), (LEFT, BOTTOM))
if len(AddressBlock.lines) == 5:
NameBlock.move(0, 10)
elif len(AddressBlock.lines) >= 6:
NameBlock.move(0, 20)
You could similarly move the block horizontally by adjusting the first parameter (y) in the move command. You could use this to test the length of a line and then move the block if it bumps into another block, for example.
You may need to create a style wherein a block of text 'floats' between two other blocks on the card, with the whitespace between this item and the other blocks even above and below. This is quite easy to accomodate with our system:
First, define the blocks that will reside above and below this block of text. Lets say - for this example - that the top block is the NameBlock, and it grows down from the top of the item; the bottom block is the AddressBlock, and grows from the bottom up. We will have a third block, called WebEmailBlock, floating evenly between these two blocks.
NameBlock = DWIMBLOCK([F1, name_first, IF(' ', name_middle), ' ',
name_last, IF(', ', name_suffix), NEWLINE,
F2, card_title1, NEWLINE,
card_title2], (12,240), (LEFT, TOP))
AddressBlock = DWIMBLOCK([F2,
card_division, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_street3, NEWLINE,
card_city, IF(', ', card_state),
' ', card_zip], (12,12), (LEFT, BOTTOM))
Next, we will draw the middle block (WebEmailBlock), but center it between the two blocks by specifying a Y (height) anchor point using the HCENTER in the block anchor point definition, as shown below:
EmailWebBlock = DWIMBLOCK([
F1, card_email, NEWLINE,
'www.nationsprint.com'],
(12,HCENTER(TopBlock,BottomBlock)), (LEFT, MIDDLE))
The HCENTER command automatically finds the 'middle' of these two blocks and returns the appropriate y-height for this coordinate. Telling our middle block (EmailWebBlock) to grow from the MIDDLE ensures that the whitespace will be equalized on top and bottom. It is critical that the blocks above and below the middle block are 'drawn' first so that HCENTER knows how to find the middle, so the sequence of blocks does matter in this regard.
A similar command exists for finding the x-coordinate for the middle of two blocks. In this case, you use VCENTER, and would replace the x-coordinate in your block anchor definition.
Occasionally you will need to have a block of text 'grow off' the end point of another block.
For the example below, we have two blocks of text. The block on the left side of the item (LeftBlock) grows from the bottom of the product, upward. The second block of text (RightBlock) grows from the top downward, but the top line of this block needs to be aligned with the top of the LeftBlock, regardless of how few or how many lines are in the LeftBlock.
This is easy with VIPER. First, setup the LeftBlock with the BOTTOM anchor - make sure this is listed first in your style. After this, add your next block that will grow from the TOP down, with the anchor point set to the top of the first block per the example shown below.
LeftBlock = DWIMBLOCK([F2, LEFT,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, ', ', card_state, ' ', card_zip, NEWLINE,
card_email, NEWLINE,
card_www,
], (12,12), (LEFT, BOTTOM), (110, 0))
RightBlock = DWIMBLOCK([F2, RIGHT,
mail_street1, NEWLINE,
mail_street2, NEWLINE,
mail_city, ', ', mail_state, ' ', mail_zip, NEWLINE,
card_email2, NEWLINE,
card_www2,
], (240,LeftBlock.calc_top()[1]-3.0), (RIGHT, TOP), (110, 0))
Note how we have replaced a traditional anchor point (an integer) with a function:
LeftBlock.calc_top()[1]-3.0
Let's break this function down a bit. The first part:
LeftBlock.calc_top()[1]
...gives you the _approximate_ Y coordinate (height) for the top baseline of this block - depending on how many lines are on this particular order, this will change to reflect the actual height for that particular imprint.
In our experience, it is necessary to adjust this with an 'adjustment factor' to get things to line up perfectly... in the case above, we are subtracting 3 points from the calculated value to get the actual "top" of the block:
LeftBlock.calc_top()[1]-3
The best way to find the 'adjustment factor' is to open actual artwork generated by the style and measure how far off the block is in Illustrator, then adjust the number and test again until you are dead-on. The top of both blocks will from this point forward stay locked together 100% accurately.
Make sure your block names are updated from the examples above - for example, if your block is not called "LeftBlock", you would need to change that name in the calculate statement above.
If you need to find the bottom of a block, the function to use to find the bottom of a block is:
LeftBlock.calc_lower_left()[1]
Once more, you can adjust this by adding or subtracting points, if needed, such as:
LeftBlock.calc_lower_left()[1]-15
There are four other block methods you can use: _get_top(), _get_right(), _get_left(), _get_bottom(). Each method gets that edge (top, right, left, or bottom) of the block. Here is an example how it would look:
LeftBlock._get_right()
or
LeftBlock._get_right()+15
This is useful if you want to grow the right block off the right edge of the left block, for example.
First, create your block as you would normally. Below is a simple block with only a single field - a hard coded website address:
NameBlock = DWIMBLOCK([F1, 'www.yourwebsite.com' ], (126,75), (LEFT, TOP_BASELINE))
Now, all we need to do is wrap this block with the ANGLE command, specifying how many degrees (in increments of 90) we wish to have this block rotated. In this case, we are going to rotate the block upside down - 180 degrees:
NameBlock = ANGLE(DWIMBLOCK([F1, 'www.yourwebsite.com' ], (126,75), (LEFT, TOP_BASELINE)), 180)
In the example code below a vertical line was required to separate phone designations from phone numbers. The length of the line needed to vary depending on the number of phone lines used. In order to achieve this the real height of the block must be calculated and the line must be added as a separate block from the phone words.
Block2 = DWIMBLOCK([LEFT,
IF(F5, ph1_label, ' ', Phone1Word), NEWLINE,
IF(F5, ph2_label, ' ', Phone2Word), NEWLINE,
IF(F5, ph3_label, ' ', Phone3Word), NEWLINE,
IF(F5, ph4_label, ' ', Phone4Word), NEWLINE,
], (18.5, 10.2), (LEFT, BOTTOM))
x = (Block2.height-3.7)
Line = DWIMBLOCK([VLINEWORD( .90, x, .90, x, color=BLACK), ], (122.6,
Block2.calc_lower_left()[1]-.1), (LEFT, BOTTOM))
First set the main block of type in position on the item.
Second figure out how tall that block of type is and how tall to make the line. ( Block2.height-3.7) reads - calculate the total height of Block2 and subtract 3.7 points from the total. Making a line which is shorter than the block. Change (Block2.height-3.7) to (Block.height+3.7) to make a line which is taller than the block.
Third start to draw the line using the VLINEWORD command. VLINEWORD( .90, x, .90, x, color=BLACK) VLINEWORD In the example below the line has a stroke weight of .9 points while it's height is x or the height of Block2-3.7 points
Fourth, position the line block so that it falls in the correct position in relation to the phone designations and numbers.
![]() | Tip |
|---|---|
The method described below may be achieved more easily with Sub Logo Setup in the menu and a Sublogo Selection field in an Item Form. Please see the documentation for sublogo - Sublogo Selection Field. |
Let's assume for the sake of demonstration that you have a business card which can optionally include 1, 2 or 3 'sublogos', depending on user selection while ordering. These logos need to be placed such that they do not write over each other.
To further illustrate the power of programming in styles, we are additionally going to show an example where these sublogos are required to higher on the card if the user has additional title lines - so as to keep consistent white-space between the name and title block and these sublogos:
The below example illustrates our goal:
First, we need to prepare our sublogos. Save sublogos in EPS format, making sure the bounding box around the sublogo is tight and consistent between multiple sublogos. Save your sublogos with simple, memorable filenames lacking spaces or 'funny characters'.
In this example, we will have three possible sublogos: 1) CCIE.eps 2) CCDP.eps 3) CCNP.eps - save your sublogos to a location on your computer you can remember later when we enter Style Editor Gold and upload the files.
In the 'Edit Items' interface, activate the 'sublogo' item form for your item by selecting 'sublogo' from the item_form option (shown below) and then Save your item.
Now return to the Menu and locate your item form, which will appear in a new Menu section titled "Item Form Templates". The menu item will have the 'tag' of your style in the name. In this example, we are editing a style with a tag of "bc_1", so the menu item appears as follows:
Click this link to open the sublogo form configuration interface. For our example, we will configure our form to have Checkboxes and three sublogo options. We will opt to have the products' tag appended to the field name, in case we wish to add sublogo forms to other items on the site later.
Upload your EPS files to the site using Style Editor Gold. Click the "Upload" button for your style (in our case, 'bc_1.sty') and then un-check the "Make EPS word/preview block" option. We un-select this option each time we upload because we are going to create our blocks manually later - right now we simply want to upload the EPS files to the /con directory on the site for later reference.
Upload all EPS files, one at at time, and then click on the 'Blocks' tab. First we need to insert some code into our style to force the user input into a 'list', no matter what the user submitted:
import notions try: bc_1_sublogos = notions.force_list(bc_1_sublogos) except: bc_1_sublogos = [] notions = None
This code ensures that the list of sublogos is in a list format.
Now we will set default x and y positions for the three possible sublogo blocks:
sublogo_1x = 25 sublogo_1y = 35 sublogo_2x = 25 sublogo_2y = 35 sublogo_3x = 25 sublogo_3y = 35
Now count how many sublogos we have in total.
sublogo_count = 0 if 'CCIE.eps' in bc_1_sublogos: sublogo_count = sublogo_count + 1 if 'CCDP.eps' in bc_1_sublogos: sublogo_count = sublogo_count + 1 if 'CCNP.eps' in bc_1_sublogos: sublogo_count = sublogo_count + 1
In the situation where we have a single block, the block will be in the correct position based on our default x, y positions. However, if we have 2 or 3 sublogos, we need to move some of the sublogos around so that the sublogos are not on top of each other:
if sublogo_count == 2:
if 'CCIE.eps' not in bc_1_sublogos:
sublogo_3x = sublogo_3x + 17
else:
if 'CCDP.eps' not in bc_1_sublogos:
sublogo_3x = sublogo_3x + 17
if 'CCNP.eps' not in bc_1_sublogos:
sublogo_2x = sublogo_2x + 17
if sublogo_count == 3:
sublogo_1x = sublogo_1x + 17
sublogo_2x = sublogo_2x + 34
Now we need to move the blocks around if the user has more titles, as these titles would bump against the sublogos if we didn't move them. This may or may not be necessary based on your style.
if card_title1 != '': sublogo_1y = sublogo_1y + 10 sublogo_2y = sublogo_2y + 10 sublogo_3y = sublogo_3y + 10 if card_title2 != '': sublogo_1y = sublogo_1y + 10 sublogo_2y = sublogo_2y + 10 sublogo_3y = sublogo_3y + 10 if card_title3 != '': sublogo_1y = sublogo_1y + 10 sublogo_2y = sublogo_2y + 10 sublogo_3y = sublogo_3y + 10
Lastly, we write the blocks themselves, but only if the user checked that particular checkbox. Note that each blocks under the "if" statements begin indented in two spaces from the left margin:
if 'CCIE.eps' in bc_1_sublogos:
SublogoBlock1 = DWIMBLOCK([
EPSWORD('con/CCIE.eps'),
],
(sublogo_1x, sublogo_1y),
(LEFT, BOTTOM), layer=-1)
if 'CCDP.eps' in bc_1_sublogos:
SublogoBlock2 = DWIMBLOCK([
EPSWORD('con/CCDP.eps'),
],
(sublogo_2x, sublogo_2y),
(LEFT, BOTTOM), layer=-1)
if 'CCNP.eps' in bc_1_sublogos:
SublogoBlock3 = DWIMBLOCK([
EPSWORD('con/CCNP.eps'),
],
(sublogo_3x, sublogo_3y),
(LEFT, BOTTOM), layer=-1)
There are cases where you want to change color shown in a style file dynamically based on user input. Following is one way to configure this. There are two steps: configuring a form to allow user color selection, and then style logic to change the color in the layout.
STEP 1: CONFIGURE GENERIC GOLD FORM:
To control a color in a style dynamically from a user input, the first step is to build the custom Drop-Down list using a "Generic Gold" form input. In this case, let's say that the two PMS colors we want to allow are:
PANTONE 7455 C (blue)
PANTONE 149 C (peach).
You would want your drop-down to present something human-understandable to the users (such as a color name) so we will use the following for our Generic Gold drop-down list values:
7455|Blue
149|Peach (light orange)
When using this format, the code to the left of the vertical bar will be sent to the style - the name to the right of the vertical bar will be displayed to users. In this case we are using the fieldname "bc_color" for the drop-down list:
STEP 2: CONFIGURE STYLE LOGIC
One way to define colors in PageDNA’s system is the CUSTOMCOLOR command.
In most cases colors are defined in the 'fonts' tab and are given a code (eg: C1) that is referred to later - for example, when defining a font. A custom color definition looks like the following:
C1 = CUSTOMCOLOR('PANTONE 7455 C', 0.86, 0.73, 0.01, 0.00)
The four numbers shown after the formal Pantone name define the cyan, magenta, yellow and black percentages... for the above font, these are:
c: 86% m: 73% y: 1% k: 0%
This happens to be a medium blue color. You can get these out of Adobe Illustrator or Photoshop using the "custom" and "picker" color palettes.
Next, at the top of the fonts tab we need to add the following logic to test the value selected by the user and change the custom color definition dynamically. Depending on what is chosen, one of two possible colors is set to be 'C1' for this proof:
if bc_color == '7455': color1_c, color1_m, color1_y, color1_k, color1_name = 0.86, 0.73, 0.01, 0.00, 'PANTONE 7455 C' else: color1_c, color1_m, color1_y, color1_k, color1_name = 0.02, 0.25, 0.51, 0.00, 'PANTONE 149 C' C1 = PROCESSCOLOR(color1_name, float(color1_c), float(color1_m), float(color1_y), float(color1_k))
Note that the section where we assign the CMYK and font color values are indented two spaces - this is important for the code to work right. If you need more than two colors, use the 'elif' term to add as many as needed:
if bc_color == '7455': color1_c, color1_m, color1_y, color1_k, color1_name = 0.86, 0.73, 0.01, 0.00, 'PANTONE 7455 C' elif bc_color == '149': color1_c, color1_m, color1_y, color1_k, color1_name = 0.91, 0.73, 0.03, 0.00, 'PANTONE 100 U' else: color1_c, color1_m, color1_y, color1_k, color1_name = 0.02, 0.25, 0.51, 0.00, 'PANTONE 149 C' C1 = PROCESSCOLOR(color1_name, float(color1_c), float(color1_m), float(color1_y), float(color1_k))
It is recommended that you always have an 'else' logic test as the final test to catch any possible exception so the user does not ever see a "fatal error" when proofing.
Lastly, just below this login, simply define your font or fonts using the C1 color definition:
F1 = FONT('Univers-CondensedOblique', 8, 1, -.15, color=C1)
Whichever C1 is currently selected by the end-user would be used for that artwork proof.
There are cases where you want your users to be able to change the font on a product. PageDNA supports this.
One way to configure this is to give the user a drop-down list of fonts. In this approach, there are two steps: first configuring a form to allow font selection, and then changing the fonts in your style to "listen" for the input your user chose.
STEP 1: CONFIGURE GENERIC GOLD FORM:
To control a user in a style dynamically from a drop-down list, the first step is to build a custom item form. Edit your item in the "Item Editor". Click on the "custom" tab and look at the item form - if not already enabled, add a "generic_gold" form. Upon saving, you will see a new link to edit the "item form". Click this and scroll down to configure your first input (Below the first "Jump Bar").
In your generic_gold form, create a custom "drop down list" and enter one font name your users will be allowed, per line. You will need to know the official font name for each font you use. Provided you own a copy of the font you select, you can get the PostScript names of your uploaded fonts at http://www.nationsprint.com/hub/font/showfonts.cgi?text=1
Times-ExtraBold Times-Semibold Times-SemiboldItalic
The above format shows how the exact spelling and capitalization was copied from the list of installed fonts. This is important because without the exact spelling, the font will not work. You usually will want your drop-down to present something human-understandable to the users (such as a color name) so we will use the following for our Generic Gold drop-down list values:
Times-ExtraBold|Extra Bold Times-Semibold|Semi-Bold Times-SemiboldItalic|Semi-Bold Italic
When using this format, the code to the left of the vertical bar will be sent to the style - the name to the right of the vertical bar will be displayed to users. In this case we are using the fieldname "bc_font" for the drop-down list:
STEP 2: CONFIGURE STYLE LOGIC
Now that we have the font selection from the user, we need to add it to some or all fonts on the product. This is done in the "Fonts" tab of the style. Visit the Item Editor and edit your item. Once editing your item, click the name of the style - it will appear similar to 'bc.sty'. Two sided items will have two styles - each style may need to be edited.
A normal font definition looks like this:
F1 = FONT('HelveticaNeue-Bold', 6.0, 0.0, 0.0)
As you can see, the font name is 'hardcoded' in quote marks. To activate the font, we simply pass in the field name from the custom form we just created. In the example above, I used bc_font. If I wished to activate the font above, I would merely change the definition to:
F1 = FONT(bc_font, 6.0, 0.0, 0.0)
Voila! The font is changed to whatever the user selected. Be sure to always give a unique field name for every drop-down list, so the inputs don't "collide".
Dingbats and Wingdings are types of fonts that fall outside the "normal" definitions. In order for the font to work you need to select NONISOFONT from the drop list of types in the fonts tab when you create the font. You can also change the font type after you have created the font. By default the Change Type drop-down list is set to FONT.
Phones are a bit of a different story. US style phones are made up of up to 6 different inputs. these are the ones associated with Phone 1:
ph1_label--> designation or phone label
ph11-->area code
ph12-->phone prefix
ph13-->phone suffix
ph1_ext_lbl-->extension label
ph14--> extension number
Normally a PhoneWord handles the formatting for you. In this case the need to use a special character as a separator removes the PhoneWord as a good option.
In SEG, all the following code needs to be placed before the block with the phone number.
First, you need to define your Dingbat or Wingding as its own variable:
dingbat = [FX, ' D ', FY]
Where FX is the font that uses the dingbat font and FY is the font for the rest of the phone number and the string "space bar D space bar" is a leading and trailing space with the correct character to make the symbol you need.
You can set a phone number up in a regular block with a little effort. The following statement would work if the first phone number always had to have a label and an extension.
IF(ph1_label, ' ', ph11, dingbat, ph12, dingbat, ph13, ' ', ph1_ext_lbl, ' ', ph14)
If not, you need some code to set the phones even if some parts are missing and to remove the phone label if the phone is missing.
The following logic, which needs to be done for each phone, will print the extension label only if there is an extension number:
if not ph14:
ph1_ext_lbl = ''
else:
ph1_ext_lbl = (' '+ph1_ext_lbl+' ')
This will set the extension label to either nothing or it will append a leading and trailing space bar to the label if there is an extension.
And the following logic, which must also be done for each phone, will prevent the phone label from printing if the phone prefix is missing:
if not ph12:
ph1_label = ''
Now a JOIN3 statement will work in your block to join the elements comprising the phone number with the separating character:
Block0 = DWIMBLOCK([LEFT,
F1, JOIN3(ph1_label, ' ',
JOIN3(ph11, dingbat,
JOIN3(ph12, dingbat,
JOIN3(ph13, ph1_ext_lbl, ph14)))), NEWLINE,
], (128.0, 32.3), (CENTER, TOP_BASELINE))
This will result in something like this:
You can use commands in a block instead of adding a font to the style's Fonts tab to print a barcode in black. (This does not preclude the need for you to own the font.) Clicking on the commands for the supported fonts below will take you to their documentation in the Style Command Reference Guide. The commands for the supported fonts are:
| CODE128 |
| CODE39 |
| DATAMATRIX |
| EAN13 |
| QRCODE |
| UPCA |
Additional documentation for QRCODE and how to apply it can be found here.
![]() | Important |
|---|---|
If you are using VSE, you will need to enable Block Logic to use the barcode commands. The block will need to be placed in either the Preblocks tab or Postblocks tab. |
You can use the scalefactor command to uniformly scale the barcode, or you can specify the height and width of the barcode.
Here is an example using scalefactor with the CODE128 barcode command applied to the numbers 0-9:
Block0 = DWIMBLOCK([CENTER,
CODE128('0123456789', scalefactor=.5), NEWLINE,
], (126, 9), (CENTER, BOTTOM))Here is an example resizing the barcode to 72 points wide by 48 points tall:
Block0 = DWIMBLOCK([CENTER,
CODE128('0123456789', 72, 48), NEWLINE,
], (126, 9), (CENTER, BOTTOM))
Table of Contents
This portion of the documentation shows how to use PageDNA’s logic features when building styles. Logic in this case refers to using both built in PageDNA features as well as in some cases actually doing true programming in Python, our native programming language.
Anyone with experience in variable data template creation on any platformknows how important "logic" is to make sure that a template can handle various exceptions that may happen between orders run through said template. This document will start with some basic concepts used on almost every PageDNA style and then get into more rare situations.
Using IF in your Styles
An IF statement allows for some simple, yet powerful logic within a style.
Take the following street address as it might display on a printed item:
2055 Woodside Road Suite 250 Redwood City, CA 94061
In a style, the code for this item would probably look something like this:
card_street1, NEWLINE, card_street2, NEWLINE, card_city, ', ', card_state, ' ', card_zip
The above code would work just fine - provided the user always entered a state. Without a state for a particular imprint, the results would look like this:
2055 Woodside Road Suite 250 Redwood City, 94061
Without a state or a zip code it would look like this:
2055 Woodside Road Suite 250 Redwood City,
Without a city, state or zip code it would look like this, with the comma present:
2055 Woodside Road Suite 250 ,
In short, the problem is that the comma will always be included even if the city state and zip code are missing. A comma is something a user could easily overlook (thinking for example this is a smudge on their screen, or missing it entirely otherwise). This could lead to a request for a reprint and/or an otherwise unhappy customer.
While it is possible and in many cases desirable to make certain fields "required" in the form the user completes, in many cases we want to make the style behave more intelligently if these fields are not present. We can use an IF statement to prevent the comma from printing if the city is missing.
An IF statement has parenthesis, inside which are two or more style layout elements. IFs logic functions as follows: "If any one item between the parentheses is missing, NONE of the items within the parentheses will display on the imprint."
To prevent the comma from printing, we need to place it in an IF statement as shown below:
card_city, IF(', ', card_state), ' ', card_zip
This would appear as follows if the state were missing:
2055 Woodside Road Suite 250 Redwood City 94061
Note that technically, you could also do this using the example that follows:
IF(card_city, ', '), card_state, ' ', card_zip
This would appear as follows if the state were missing for that particular imprint:
2055 Woodside Road Suite 250 Redwood City, 94061
As noted above, PageDNA Support recommends the first approach - this second example could create a problem if the user had a city and ZIP code but no state - namely: a comma, a space and another space would be between the city and ZIP code. This example shows that you need to think through the combinations that will be possible before choosing a strategy.
Using an IF statement allows for fixing other types of situations such as a complex name:
Mr. Charles Emerson Winchester, III
If we didn't use IF statements, the style code would read:
name_prefix, ' ', name_first, ' ', name_middle, ' ', name_last, ', ', name_suffix
If the user left off the prefix, middle name, and suffix, the style would look like this:
Charles Winchester,
Note the space before Charles, the two spaces between first and last names, and the comma and extra space at the end.
To prevent this, we add IF statements for the prefix, middle name, and suffix.
IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '), name_last, IF(', ', name_suffix)
In the first IF statement, the variable comes first and the "literal" text of a space follows. At the end of the line, the literal text (a comma and a space) appear first, and then the suffix variable.
Also worth nothing that an IF statement isn't limited to only two arguments.
IF('Tel: ', Phone1Word, bullet2)
If and only if the user had a phone number (Phone1Word) the above example would return,
Tel: (650) 555-1234 *
When isn't an IF statement needed?
Use of an IF statement is NOT needed to prevent a single argument, or variable, from printing in either of the following two examples:
card_street1, NEWLINE, IF(card_street2), NEWLINE, card_city, ', ', card_state, ' ', card_zip
card_street1, NEWLINE, IF(card_street2, NEWLINE), card_city, ', ', card_state, ' ', card_zip
NEWLINE is "smart" enough not to leave a blank line if nothing appears on that line. So these IFs above are both superfluous and have no affect on the operation of the style. In other words, if the code was as follows:
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, IF(', ', card_state), ' ', card_zip
And card_street2 was missing, the result would still be:
2055 Woodside Road Redwood City 94061
It would not matter how the block is aligned vertically (whether you set the block using TOP, TOP_BASELINE, MIDDLE or BOTTOM block anchoring) - NEWLINE always will ensure that block text "snugs up" all lines in a block together.
Using JOIN3 in your Styles
There are instances where IF isn't practical as it can only do one test. In particular, this approach would not work when combining three items - two phone numbers with a separator between them - with the separator appearing ONLY if BOTH of the phones are present:
Phone 650 555 8900 * Toll-Free 800 555 8901
What we'd want is a test that would ensure that whether the user entered one phone number OR the other, OR both, the results would look correct. If either phone number is entered singularly, we don't need the bullet; it's only when both are present that the bullet should be visible.
The temptation is to use an IF statement like this:
Phone1Word, IF(bullet2, Phone2Word)
This would work if Phone 1 was mandatory, and Phone 2 was optional. However, if the user omitted Phone 1 and only entered phone 2, the line would look like this:
* Toll-Free 800 555 8901
Not what we wanted.
For these cases, a different command is needed - JOIN3. JOIN3 does exactly what its name describes; it joins three elements together. Please note that JOIN3 requires that there be only three arguments, or elements. The contents of the parentheses are like this:
JOIN3(Item1, separator, Item2)
Item1 and Item2 are replaced with your code. In short, JOIN3 says if, and only if, both of the outer items (Item1 AND Item2) are present, only then should the separator be visible. If only one element is present it appears as normal in the style.
Setting the phone numbers with the bullet between in a JOIN3 should look like this:
JOIN3(Phone1Word, bullet2, Phone2Word)
Advanced Uses:
JOIN3 commands can also be "nested". For example, if we have the end of an address line consisting of a zip code, a bullet, and two phone numbers separated by a bullet:
2055 Woodside Road * Redwood City, CA * 94061 * 650 555 8900 * Toll-Free 800 555 8901
and the code to handle such a line might look like this:
CENTER, F2, card_street1, bullet2, IF(card_street2, bullet2), card_city, ', ', card_state, bullet2, card_zip, bullet2, JOIN3(Phone1Word, bullet2, Phone2Word), NEWLINE
The results, if all of the pieces were entered, would look like this:
2055 Woodside Road * Redwood City, CA * 94061 * 650 555 8900 * Toll-Free 800 555 8901
If the user omitted either of the two phone numbers, these would be the results:
2055 Woodside Road * Redwood City, CA * 94061 * Toll-Free 800 555 8901 2055 Woodside Road * Redwood City, CA * 94061 * 650 555 8900
A user could use both, or either, of the phone numbers. But if they left all phone numbers off, the results would leave a trailing bullet like this:
2055 Woodside Road * Redwood City, CA * 94061 *
To fix this, we can treat the last JOIN3 command as one of the items in another JOIN3, which we call a "nested JOIN3".
CENTER, F2, JOIN3(card_street1, bullet2, JOIN3(card_street2, bullet2, JOIN3(card_city, ', ', JOIN3(card_state, bullet2, JOIN3(card_zip, bullet2, JOIN3(Phone1Word, bullet2, Phone2Word)))))), NEWLINE
This may be shown so it can be seen more easily for educational purposes as:
CENTER, F2, JOIN3(card_street1, bullet2,
JOIN3(card_street2, bullet2,
JOIN3(card_city, ', ',
JOIN3(card_state, bullet2,
JOIN3(card_zip, bullet2,
JOIN3(Phone1Word, bullet2, Phone2Word)))))), NEWLINE
Note the following:
The last JOIN3 has three elements
Each of the first five JOIN3 commands all have two elements because the JOIN3 command that follows acts as the third element
All the closing parentheses are at the end after the last JOIN3
PageDNA Support recommends the following method to use JOIN3:
Start from the end and work backwards
It is best to have a bullet, space, comma or another "conjunction" as the last of the two elements in all but the last JOIN3
In our example above, the first JOIN3 would add the bullet only if card_street2 was present. card_street2 and its bullet form the third element or "test" for the first JOIN3.
In some cases, commands can be used in tandem.
Let's say you want two phone numbers joined with a comma, but only if both phones are present. The phones need to work so that if a phone number is missing, the label and space don't show up.
Here is the solution:
JOIN3(IF(Phone3Word, ' ', ph3_label), ', ', IF(Phone4Word, ' ', ph4_label))
Changing this graphically shows more clearly what's happening:
JOIN3( IF(Phone3Word, ' ', ph3_label), ', ', IF(Phone4Word, ' ', ph4_label) ),
Note the two outer elements ("bookends", so to speak) are Phone3 and Phone4. IF they are both present, and only if they are both present, JOIN3 will add the middle "bridge" element - which is a comma and space inside quotes. Otherwise, Phone3 and/or Phone4 will flow through unscathed.
The IFs around the phoneWords, spaces and labels enforce that if a particular phone is not completed, nothing will be shown for that phone number... they work just fine inside JOIN3s.
However, JOIN3 does not always work well with an IF statement. This will become evident in testing because you will get undesirable results: either the style will not save without an error or what you are trying to prevent from printing by using an IF statement does not work. Below are two examples.
EXAMPLE #1: The example has the IF preceding the JOIN3 and includes the COL command to force the phone numbers into columns. The IF is meant to prevent the phone label "P" before Phone1Word from printing if Phone1Word and Phone4Word are missing. The problem is that if both are missing, the following returns the JOIN3 with a value and won't work with an IF statement:
JOIN3(Phone1Word, ' ', Phone4Word)
In a case such as this, using a debug command, DBG, will reveal whether one of the PhoneWords is returning a value even though the user does not enter a phone number. Documentation on the use of DBG can be found at http://www.nationsprint.com/hub/docs/html/StyleBuilding/using_dbg.html
So, in order to get the JOIN3 to work, we have to add something that will return a null value if both PhoneWords are missing
IF('P', ' ', COL, F2, JOIN3(Phone1Word, ' ', Phone4Word) or ''))
If both phone numbers are missing, the "or" comes into play and passes a null value for the IF statement so the "P" will not print.
EXAMPLE #2: This example is when you cannot use an IF statement inside of a JOIN3 command, as in the case of phone labels attached to phone numbers. This will become evident in testing and may be revealed by using the debug command, DBG, documentation for which can be found at http://www.nationsprint.com/hub/docs/html/StyleBuilding/using_dbg.html
In a case such as this, the phone label needs to be defined as part of the PhoneWord. In VSE it would be set in the Phones tab of your style as follows:
If you are using SEG, you need to define each of the phone labels in the Words tab of your style, or if you are using VSE you can also define each of the phones in the Preblocks tab as follows:
Phone1Word = PHONEWORD(F1, (ph1_label, ph11, ph12, ph13, ph1_ext_lbl, ph14), '* (*) *-* * *')
Note that an asterisk has been added as a representation or place holder for the phone label (marked in red).
This will allow you to write a JOIN3 without using IF and still prevent the phone labels from printing if the phone number is missing, for example:
JOIN3(Phone1Word, bullet2, Phone2Word)
This will print the phone labels and numbers only if the phone number is present if you have defined the PhoneWords to include the phone labels.
Table of Contents
This portion of the documentation shows how to use PageDNA’s form and style features to allow a logo to vary based on which address was selected by a user when ordering.
Linking a Logo to a location
Scenario: Is there a way to tie the address list to a logo graphic or photo?
For example, we want to have- say 10 different distributors for a sell sheet that all want their logo and company address info on the sell sheet. With the address list, it’s easy to create a drop down menu with the 10 different choices for addresses, how can we also have a graphic linked to an address, flowing in automatically?
Solution: The answer is "yes, you can do this with PageDNA". Following are steps to link a logo to a location:
Prepare the logo files with consistent file naming conventions, eg:
sell_sheet_chicago.eps sell_sheet_newyork.eps
Upload these files to the 'con' (content) folder of your site using the File Uploader.
Add a new field to the "Address List Editor" using the "Change Field Names" button, and name it "logo". This is where the information for the image will be stored. Note: if needed, you could create multiple fields for different logos used on different products (logo_lh for letterhead, etc)... for now we'll assume one logo is suffient for this tutorial.
For each "Personal Page" on your site (sites can have several if you’re using the "Multiple Personal" Feature), add a field named "logo" to the "extra field names" found under the "Addresses > Drop Down" section of the Personal form. Again, make sure all Personal forms have this field added.
Within each address, in the spot for the logo, you are going to substitute the path to your files. For Chicago, you'd have the logo field as:
sell_sheet_chicago_logo.eps
Repeat this for each address making sure that every address has a logo both uploaded to the con directory, and stored in the Address List Editor. The "Show All" button can be helpful to review all addresses in a glance.
Changes in Style - Using Visual Style Editor (VSE)
Edit your style(s) - Using Visual Style Editor
If using the new "VSE" (Visual Style Editor) add a new "Photo Block" (image icon with a green "+") and give it a Variable name of "logo". Configure the block such that it is anchored in the lower left corner of the style, at 0, 0 (x,y coordinates). You will need to choose the "Filename Path : con/[variable]..." option on the right. This configures the block to look for a file in the "con" folder (Content).
Note that "No Image" will show up in the VSE as a placeholder - but will be populated with the selected image when you choose choose an address during an ordering session.
Changes in Style - Using Style Editor Gold (SEG)
If you’re using the old "Style Editor Gold" editor, you’ll need to add a block looking something like this:
LogoBlock = DWIMBLOCK([EPSWORD('con/'+logo, xscale=1.0,
yscale=1.0)],
> (0.0,0.0), (LEFT,BOTTOM) , layer=-1)
Note the word "logo" above - this will come from the address list and pop in the correct logo for you in "real time". This is obviously more difficult to handle than using the Visual Style Editor.
If you allow an "other" option (whereby a user can type in their own address), you may want to add some logic to show a default logo in those cases.
Table of Contents
![]() | Warning |
|---|---|
Note: this chapter is updated to reflect the use of the VSE. However in cases where the VSE misses the functionality to make the examples possible, the code for the old SEG UI is left in place with a warning, like this one, above the example. If you are looking for the documentation of the old SEG UI, please go to "Style Building Tips and Tricks, Old User Interface". |
This portion of the documentation shows 'tips and tricks' we recommend for building high-quality ordering sites.
![]() | Tip |
|---|---|
Note that you can learn how to configure the window that pops up in the Configuring the "Preview" (Proofs) page section of the Site Configuration documentation. |
Go to the "Preview" tab and add a new zoom block, let's assume it is "zoom1" and set the scale to 200 %. Also make sure that the "normal" preview has it's scale set to 100% (for this example to be truth full). Your "zoom1" should look like this:
Then click the edit link of the "html" preview. and put the following html in there:
<table> <tr> <td align=left> <font face="Arial"> <B>Business Card, Actual Size:</B><BR> <a href="%(p.zoom1_src)s" target="_blank"><img src="%(p.normal_src)s" border=0></a> <BR><font size=2>Click image for enlarged proof in new window</font></font> </td></tr> </table>
Your window should like the following screen shot:
In the html example above, the "normal" preview shows when users first proof, as displayed in the custom HTML section. We define (shown in the first screen shot) a "zoom1" preview that will display at 200 percent. Note the "delay" flag has been enabled on the zoom11 preview in the screen shot. This tells the system to wait to generate this proof on-demand, saving proofing time for the initial proof.
The custom HTML section is required for this approach as we need to define (as shown in bold above) a link defined around the normal preview image. When clicked, this opens a new blank window.
![]() | Tip: Remember to escape % signs |
|---|---|
If your HTML code contains % signs, for instance you want to set a width, like ' width="90%" ' you need to double the % sign, like so: ' width="90%%" ' this is because the % sign is "meaningful" to our form processing system. This is explained in Using Percentage (%) Symbol. So a literal % sign needs to be doubled, but the % sign in href="%(p.big_src)s" is a processing instruction. |
![]() | Tip: Code View |
|---|---|
If you click "Code View" you will see something like the following listing. Actually this is the same code that is used in the SEG mode of Style Editor Gold:
'normal': {
'scale': 1.0,
'use_magick': 1,
},
'zoom1': {
'delay': 1,
'scale': 2.0,
'use_magick': 1,
},
'html': '''
<table>
<tr>
<td align=left>
<font face="Arial">
<B>Business Card, Actual Size:</B><BR>
<a href="%(p.zoom1_src)s" target="_blank"><img src="%(p.normal_src)s" border=0></a>
<BR><font size=2>Click image for enlarged proof in new window</font></font>
</td></tr>
</table>
''',
|
![]() | Warning |
|---|---|
Note: in general the following in this section does not apply to the VSE, since on most tabs there is no code anymore. However there are two exceptions: The "Preblocks" and "Postblocks" tabs. These tabs are not enabled by default. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. This following example is based on the old SEG UI. |
Commented lines can be added as a way to disable code, or to place a note in the style and mark it in such a way that it is ignored when the style is processed and turned into a file that can be printed.
Comments in a style may be added for a number of reasons, among them being: adding comments for clarity; adding comments so you will be reminded of what and why you did something; "Commenting-out" a line for testing purposes; or, if you need to remove a line from your style, but want to retain it should your client change their mind.
A line may be commented-out by placing the pound symbol (#) followed by a space to separate it from the code that follows.
The EGG tool adds commented lines automatically. An example of an auto-added comment line is noted in bold face below:
# auto-added by upload button LogoBlock = DWIMBLOCK([EPSWORD('con/Your_File_Name.eps', xscale=1, yscale=1)], (0.0,0.0), (LEFT,BOTTOM) , layer=-1) # end auto-add
You can add comments in the middle of code as follows:
titles = [card_title1, card_title2, card_title3] titles = [t for t in titles if t] # filter list to only include titles that are set. titles = titles + ['', '', ''] # pad titles so that there are at least 3.
You can comment out a line in the middle of a block. Only the line preceded by the '#' sign will be ignored when the style is processed. Also note the auto-added line at the end denoting dimensions:
NameBlock = DWIMBLOCK([RIGHT, WRAP,
F10, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, IF(', ', name_suffix), NEWLINE,
F4, card_title1, NEWLINE,
card_title2, NEWLINE,
# card_title3, NEWLINE,
], (110,87), (RIGHT,TOP_BASELINE), (101,0) )
# x: LEFT=104.8 RIGHT=151.2 y:BOTTOM=18.3
You can run into a problem if you comment-out a line that contains the 'font call' for the block. Subsequent lines in your style will default to being set with Helvetica until another 'font call' is encountered, as in the following example:
NameBlock = DWIMBLOCK([RIGHT, WRAP,
F10, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, IF(', ', name_suffix), NEWLINE,
# F4, card_title1, NEWLINE,
card_title2, NEWLINE,
# card_title3, NEWLINE,
Phone_Word1
], (110,87), (RIGHT,TOP_BASELINE), (101,0) )
# x: LEFT=104.8 RIGHT=151.2 y:BOTTOM=18.3
In the above example, card_title2 would be set using Helvetica because the line with the 'font-call' that includes card_title1 has been commented out. The next line that would be set correctly is the one that begins with Phone_Word1 because, as a rule, Phone_Words (defined on the Words tab) have 'font calls' as denoted below by 'F1':
Phone1Word = PHONEWORD(F1, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '(*) *-* * *')
You can comment out a whole section using three double quotes (""") before and after the section instead of putting a pound symbol (#) in front of each line. For example:
""" NameBlock = DWIMBLOCK([CENTER, F2, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '), name_last, IF(', ', name_suffix), NEWLINE, card_title1, NEWLINE, ], (128.0, 32.3), (CENTER, TOP_BASELINE)) """
This will prevent the entire NameBlock from being processed.
![]() | Note |
|---|---|
JPG or EPS files can be used. |
Setting the layer in the VSE is done in the settings window of a block, i.e. select a block and click the "Edit a block's settings" icon, the one with the wrench. The layers setting is a select list with some common predefined options and an option "Other...". Selecting "Other..." allows you to enter a new value for the layer in a pop up window. When entering a new value for layer, this new value will be added to the options and set as selected.
Consider for example a full-size EPS representation of the 'master' for a business card (MasterShellBlock) that has been lowered to level '-2' so that a photo (PhotoBlock) on layer '0' will float higher in the 'stack' of EPS files. Remember that negative numbers get LOWER and the number increases. Failing to set the layers properly may bury the photo image below the master.
Another option for 'layer' is PREVIEW_LAYER, which stands for -1500 — this shows the image of the EPS file to the user, but does not send the EPS file to press.
The above example shows an EPS file in a block called "PreviewBlock" in the proof,
but would not send this file to press. Note the select list setting of the Layer field:
"Preview layer: -1500", so this is set deep in the stack of files and is often
used to show optional items that are pre-printed on masters (goil foil seals, etc).
Any layers between -1000 and -1999 have this "preview layer" behavior, so if you still need to stack and layer files but not send them to press, use this layer range.
A final 'layer' option is the OUTPUT_LAYER option — this does not show the image to the user, but it DOES send the image in the EPS output file. The default OUTPUT_LAYER is reserved at -2500. Similar to the "preview layer", the "output layer" is actually a range as well. So if you need to have stacked images that are all in the output layer, you can set the layer=-2500 for the image on top and and layer=-2501 for the next image below, etc.
Any layers between -2000 and -2999 have this "output layer" behavior, so if you still need to stack and layer files amd send them to production but not to the proof, use this layer range.
The OUTPUT_LAYER can be handy when used in conjunction with the PREVIEW_LAYER. For example, if you need to display a blue EPS file to the user, but send a black EPS file to production, you could set up two DWIMBLOCKs. One would display the blue EPS file and use the 'PREVIEW_LAYER'. The other DWIMBLOCK would use the black EPS file and would use the 'OUTPUT_LAYER'.
Stacking layers can be used for many purposes. Creative masking effects can be generated through creative use of white-out layers stacked above EPS files.
A preview layer in an item's style can be used to create a watermark on a proof. A watermark is an image that displays on the proof presented to users, but which does NOT get sent to press. This is especially useful to ensure the users simply download the proof and have it printed elsewhere.
To add a watermark to an item begin by building an functioning item. Once you have a fully tested item, create your own watermark image as an EPS file with a bounding box the same size as item including your full bleed and save it as an Adobe Illustrator Version 8 EPS in line with our standards as presented in the artwork help document.
Go to the Visual Style Editor for the item. Add a new photo block using the tool on the menu bar.
In the options screen give the block a name, such as "proof" or "watermark" and set the layer to Preview Layer -1500. Use the Browse button to locate your watermark EPS file and click Create.
Now you will have an additional layer that displays your watermark on any previews but will not pass along to the actual production file.
For information about to to achive this using the Style Editor Gold tool, click here.
![]() | Warning |
|---|---|
Note: in general the following in this section does not apply to the VSE, since on most tabs there is no code anymore. However there are two exceptions: The "Preblocks" and "Postblocks" tabs. These tabs are not enabled by default. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, under the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. So the following example is mostly based on the old SEG UI. |
Debugging a style can be difficult at times. There are times when you as the programmer need to know exactly what value a specific variable has assigned to it. These values can be very hard to 'see' at times. That is where the DBG command comes into play.
In the style add a single line of code which will print the value of a variable to the testing screen from style editor gold. (The screen that appears when hitting the Test button from Style Editor Gold, which has the gray background.)
DBG('Title One=%s', card_title1)
In the example above, the string Title One=(value of card_title1) will print directly under the normal section of the preview test page.
Any variable can be used in a DBG statement. In Python %s is used to add a variable to a string. The variable itself is added after the comma.
Create a block for your text or image in your style in the correct position and size. Then make a new block and make an exact copy of the content of the block, use a unique the name for the block. Then set the right alignment, same as the original block you copied from, and give the new block a small offset in its anchor points.
Then go to the settings window and use the "Layer" field to move the offset block behind the original block, i.e. set the layer to a lower number then the original block.
Make new colors in the fonts section to make the offset block a different color or screen value than the original block. See the example code below.
Original block, let's say anchor has x,y = 324, 757.7 and layer = -4 Content: CENTER, WRAP, F3, card_company, NEWLINE, Shadow block, let's say this one's anchor has x,y = 326, 753.7 and it's layer = -5: Content: CENTER, WRAP, F3_black, card_company, NEWLINE,
Procedure 13.1. Creating Great Proofs
The key to creating great proofs is in choosing the right size to display the item at to the end user. We recommend that for a standard business card, make your GIF 7 inches by 4 inches at 72 dpi. This is for a 2x preview, which looks good on a standard-sized browser window, with very clear legibility even on small fonts.
Use the WHOLE card image and put all "static info" -- be it GIF (preview) or EPS(print) -- into the site IN POSITION. Because GIFS are NOT scalable, make at the 2x size for business cards. For letterhead and other products we recommend any width around 550 points for this image.
Upload this image into your Style by clicking the "Upload" button and then choosing the "GIF" option, browsing for your image, and clicking Upload. The size for the preview will be set by the size of the image you uploaded. You can confirm the scale in the "preview" tab of Style Editor Gold.
These same principles apply to all other products. For the sake of showing proofs and imprint info on larger products (e.g. letterhead, envelopes, anything bigger than a memo pad (8.5 x5.5), we recommend a scale of .7 of original size for the product and a zoom of 1.5x to 2x. For memo pads and mailing labels, we generally use a 1x on the product and a 1.5x to 2x zoom.
The general rule is to try to get the final size to be around 550 points wide at 72 dpi.
Scenario: "Jaggies" or "halos" appear around variable type floating over a background (master) image
We offer two ways to show 'master' (pre-printed shell) images - which are shown to the user when proofing but not sent to press - on our system. One way, which is now depreciated, is to use the GIF images which normally works just fine. One issue with GIF images in this situation is that when you show text over a darker background, you will see "jaggies" or that 'halo' which can confuses users. This does not affect the print, but obviously is something to avoid.
Fortunately, VIPER also supports the use of an EPS file as your background 'master' image, which gets rid of this problem and shows crystal clear text, even over background images. Here are the steps to do this for a layout:
STEP 1) CREATE NEW EPS MASTER IMAGE: Create an EPS file with the exact size as your output file (go to the "blocks" or "other" tab in the Style Editor if you need the dimensions), having just the contents of the master image (the pre-printed element). Save this as an Adobe Illustrator EPS file to your desktop.
STEP 2) CREATE A MASTER IMAGE BLOCK: Create a photo block in the style for the side in question, on the blocks tab in the Style Editor. Set the "Layer" field to preview layer. Note you need to set the "Layer" field in the settings window: select the block and click the "Edit a block's settings" icon. You do not need to change any other settings, but if you may wish to use something unique like "MasterBlock" for the block name. PREVIEW_LAYER essentially tells VIPER to display this EPS file, but not to sent it to press.
STEP 3) Lastly, you need to de-reference the GIF file, if there is one, so the EPS is used. Go to the 'preview' tab of the Style Editor and if you use the "List View", click "edit " of the normal preview and on that form, if there is any "Combine" value, click the "clear" button. Note there will be no "clear" button if there is no "Combine" value. If you are using "Code View", you will see something like this:
{
'normal': {
'combine': 'con/bc1_combine.gif',
'scale': 2.0,
'use_magick': 1,
},
Remove in its entirety the bold line above (select the whole line including the comma at the end and delete it), and then save your style with the Gold "Save" button.
STEP 4: Refresh your item proof or start a fresh order - the jaggies will be gone!
You can use what are known as Zoom Blocks to ‘zoom in’ on one or more particular blocks of text. This technique works very well for letterhead. The default envelope and letterhead Style files included with new sites have a zoom block. Explore these Styles to learn more about this feature, and also see our more detailed documentation on Zoom Blocks that includes a "how to" on this feature.
![]() | Warning |
|---|---|
Note: the following is based on the old SEG UI. But since the "Preview" still has the "Code View", this example can be use unaltered for converted styles. However you can easily translate the code so you can fill out the forms in "List View" in the VSE. If you unsure how, just use "Code View" to paste in the example and change to "List View" to see how it translates. |
PageDNA offers the ability for you to provide your users with a link to a PDF link, directly above the GIF proofs shown on the "Proofs" step of the ordering process. This is sometimes helpful on large items with smaller text (such as letters, invites and other direct mail pieces), where the user needs to really 'zoom in' and take a look. Many customers do NOT like to provide this option because of the risk that users will take this file and simply print it on their local laser printer or inkjet. Keep this in mind before adding PDF links to your styles.
To add the PDF links to your products, go to the "Previews" section of Style Editor Gold. You need to add the following within the first brace, but before the zoom or 'normal' blocks:
'pdf': {'PDF': 1},
For example:
{
'pdf': {'PDF': 1},
'zoom1': {
'scale': 2.0,
'use_magick': 1,
'block': 'Block0',
},
'zoom2': {
'scale': 2.0,
'use_magick': 1,
'block': 'Block1',
},
'normal': {
'scale': 0.5,
'combine': '/con/1-sps-vda-002-0704_combine.gif',
'use_magick': 1,
},
}
Note: If you use a custom HTML preview for your layout, you will need to manually call the PDF link in your preview HTML. Below is an example showing custom preview HTML with a link to the PDF preview displayed.
{
'html': '''\
<table>
<tr><td align=center>
<font face="Arial"><B>Product Preview:</B> <a href="%(p.pdf_pdf)s" target="_blank">View PDF</a><BR>
<img src="%(p.normal_src)s"></font></td></tr>
</table>
''',
'normal': {
'scale': 1.4,
'use_magick': 1,
},
'pdf': {
'PDF': 1,
'use_magick': 1,
},
}
Two sided items will automatically add a note to the front side proof indicating it as the front. Sometimes it is nice to add a label to the back side proof indicating that it is the back. Here is how.
Start in the 'preview' section of Style Editor Gold for your 'back-side' style and add some html, i.e. when in "List View", click the "edit" for the html preview, where you enter the following HTML code:
<table>
<tr><td align=center>
Product Back Side:
<img src="%(p.normal_src)s"></td></tr>
</table>
The text "Product Back Side" will print above the main proof of the back side. This text can contain anything required.
For further information about SosBackItems go to "Two Sided Items"
Note: this applies mostly to the old SEG UI. Since the VSE uses forms in most places, proper quoting is less of an issue. One exception is that to include a single or double quote in a string in the block editor you must quote the string with the other type of quotes. Another exception is when you use the "Preblocks" and "Postblocks" tabs. These contain code and the following applies.
Text must be enclosed in a 'quote' of some kind so that it will be seen as text. If your text includes a single quote, comma, apostrophe or double quotes, and must retain them, the line (or string) of text must be enclosed by a style of quote that is not included in the string of text. These styles are single quotes ('xxx yyy'), double quotes made by holding the shift key in conjunction with the single quote key ("xxx, yyy") and triple quotes created by three single quotes ('''"xxx's yyy"'''). Examples follow.
The following is the recommended method to include a line of text that does not contain a comma, single quote or double quotes, the line of text must be enclosed by single quotes. This will ensure that the entire string of text is seen as a single unit. This is also the case for single words.
'The lazy brown fox jumped over the fence.'
If the line of text has an apostrophe or comma, or is enclosed in single quotes, it must be enclosed by double quotes.
"The lazy brown fox jumped over the neighbor's fence, then fell on his face."
Not that in the example above, when output, the text will read: The lazy brown fox jumped over the neighbor's fence, then fell on his face.
"'The lazy brown fox...'"
Note that in the example above, when output, the text will read: 'The lazy brown fox...'
If the text is a quotation, such that double quotes must be retained, the line of text must be enclosed in single quotes as follows:
'He said, "Thar she blows!"'
In the example above, when output, the text will read: He said, "Thar she blows!"
Double quotes are seen as a single character. So the order in which you type the single and double quotes will determine what is being enclosed so the text can be output correctly.
However, if the text contains an apostrophe and double quotes as in: He said, "The brown fox jumped over the lazy dog's bowl." The string must be enclosed in three single quotes, also called triple quotes, as follows:
'''He said, "The brown fox jumped over the lazy dog's bowl!"'''
In the example above, if double quotes were used instead of the triple quotes, the text would appear as: He said,(space) because the next double quote encountered closes the string, the rest of the sentence would be lost.
If single quotes were used, the line would break at the apostrophe as: He said, "The brown fox jumped over the lazy dog and the rest of the sentence would be lost. So, in this case triple quotes must be used.
![]() | Tip |
|---|---|
While Double quotes will work in almost any instance, we recommend that you use single quotes as much as possible. We find single quotes easier to read and trust that you will as well. Also, Double quotes can be hard to distinguish in the Block Section of the Style Editor from two single quotes next to each other. |
Note: this applies mostly to the old SEG UI. The VSE uses forms in most places and % signs in the forms are not an issue. However when you use the "Preblocks" and "Postblocks" tabs the following does apply because these tabs contain code.
The % symbol is "meaningful" to our form processing system.
Therefore, to retain the % symbol in a style in a string of text, e.g. "25%", it needs to appear as:
"25%%"
Please note that this does not affect users when ordering. Nothing out of the ordinary needs to be done to retain the % symbol when they enter their information.
![]() | Warning |
|---|---|
Note: the following in this section is currently not possible on the VSE's "Blocks" tab. However you can use this example on the "Preblocks" tab. If you don't see the "Preblocks" tab, go to the "Blocks" tab. Open the "Page window" and click the "Enable" check mark at the bottom of the page window, nder the sub heading "Block logic", then click the "Apply"button and after the screen refreshes you will have the two extra tabs. |
If you have several phone numbers or titles, and need them to self adjust so that so many will appear on the first line, and so many will appear on the second line, you may use the following code as an example. This can be adjusted to accommodate any number of phone numbers. A second example for three 'floating' titles is also given below.
In the following case, there are five phone numbers. The following code will place up to two phone numbers on the first line, and up to three phone numbers on the second line. Note: the fifth phone number in this example is hard coded for 'parts sales'.
It does not matter which phone numbers are selected by the user, they will self adjust. If, for example, phones 1 and 3 are selected, the first line would have phones 1 and 3, while line two would have phone 5 (because phone #5 is hard coded). So, If no phone number is selected, the phone number for 'parts sales' would appear on the first line.
Note: the following code goes on the "Preblocks" tab. The # precedes informative notes in the code. These notes will not be executed.
phones = [Phone1Word, Phone2Word, Phone3Word, Phone4Word, ('parts sales 888 888 8888')]
phones = [p for p in phones if p] # filter list to only include phones that are set or have copy.
phones = phones + ['', '', '', '', ''] # pad phones so that there are at least 5.
PhoneBlock = DWIMBLOCK([LEFT,
F4, phones[0], IF(' ', phones[1]), NEWLINE,
phones[2], IF(' ', phones[3]), IF(' ', phones[4]), NEWLINE,
card_email, NEWLINE,
], (18,23.6), (LEFT,BOTTOM))
In the following case, there are three titles. The code example below will place up to two titles on the first line and one title on the second line. Again, it does not matter which titles are selected. For example, if title1 and title3 are selected, they will appear on the first line; if only title 3 is selected, it will appear on the first line by itself.
Note: again, the following code goes on the "Preblocks" tab. The # precedes informative notes in the code. These notes will not be executed.
titles = [card_title1, card_title2, card_title3]
titles = [t for t in titles if t] # filter list to only include titles that are set.
titles = titles + ['', '', ''] # pad titles so that there are at least 3.
Block0 = DWIMBLOCK([LEFT,
F1, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, IF(', ', name_suffix), NEWLINE,
F3, titles[0], IF(', ', titles[1]), NEWLINE,
IF(titles[2]), NEWLINE,
], (18,75.7), (LEFT,TOP_BASELINE) )
If your phone labels are hard coded, e.g. phone 1 is always Main Phone then you can call an EPS or JPG file inline in the Block like this:
LEFT, F5, EPSWORD('con/mainphone_icon.eps'), SPACER(3), SHIFT(2),Phone1Word, SHIFT(0), NEWLINE,![]() | Note |
|---|---|
JPG or EPS files can be used. |
This example uses Phone1Word, but this could be done for other labels such as for Website.
Use the SHIFT command to move the type up or down in order to align the logo with the text. Set the bounding box of the logo to equal the height of the type plus leading and that will help keep the type aligned closely. Using the SPACER command will control the amount of space after the icon before the phone number begins. In this case the value 3 was used and that will result in 3 points of space between the icon and the phone number.
If the phone labels are dynamic you can use the Personal Page to pass a file name in place of the label choice. When defining the drop-down list use the right hand column to provide the path to the image including the filename. (e.g. 'con/image_icon.eps')
When using dynamic phone labels you will want to use this code in the Block:
LEFT, F5, EPSWORD(ph1_label), SPACER(3), SHIFT(2),'Main Phone', SHIFT(0), NEWLINE,
Replace 'ph1_label' to match what you defined the variable to be when setting up the drop-down list.
When using Visual Style Editor (VSE), you will need to enable Block Logic and put this in the Preblocks tab. Documentation on enabling Block Logic can be found at: http://www.nationsprint.com/hub/docs/html/StyleBuilding/vse-pre-and-post-blocks-tabs.html
The code below will take precedence over phone configuration in the Phones tab in VSE.
Standard code for the configuration of phones is as follows:
if not ph14: ph1_ext_lbl = ''
if not ph24: ph2_ext_lbl = ''
if not ph34: ph3_ext_lbl = ''
if not ph44: ph4_ext_lbl = ''
if not ph54: ph5_ext_lbl = ''
if not ph64: ph6_ext_lbl = ''
Phone1Word = PHONEWORD(F1, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '(*) *-* * *')
Phone2Word = PHONEWORD(F1, (ph21, ph22, ph23, ph2_ext_lbl, ph24), '(*) *-* * *')
Phone3Word = PHONEWORD(F1, (ph31, ph32, ph33, ph3_ext_lbl, ph34), '(*) *-* * *')
Phone4Word = PHONEWORD(F1, (ph41, ph42, ph43, ph4_ext_lbl, ph44), '(*) *-* * *')
Phone5Word = PHONEWORD(F1, (ph51, ph52, ph53, ph5_ext_lbl, ph54), '(*) *-* * *')
Phone6Word = PHONEWORD(F1, (ph61, ph62, ph63, ph6_ext_lbl, ph64), '(*) *-* * *')The asterisks represent the parts of the PhoneWord: area code, prefix, last 4 digits, extension label and extension number, along with the format, e.g. the area code surrounded by parentheses or the hyphen following the phone prefix.
The code for a bullet is "\x95". (You can find the octal code for standard glyphs in the Variables tab of a style.) We can substitute the parentheses, spaces and hyphens with a bullet. The format would be as follows:
if not ph14: ph1_ext_lbl = ''
if not ph24: ph2_ext_lbl = ''
if not ph34: ph3_ext_lbl = ''
if not ph44: ph4_ext_lbl = ''
if not ph54: ph5_ext_lbl = ''
if not ph64: ph6_ext_lbl = ''
Phone1Word = PHONEWORD(F1, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '*\x95*\x95* * *')
Phone2Word = PHONEWORD(F1, (ph21, ph22, ph23, ph2_ext_lbl, ph24), '*\x95*\x95* * *')
Phone3Word = PHONEWORD(F1, (ph31, ph32, ph33, ph3_ext_lbl, ph34), '*\x95*\x95* * *')
Phone4Word = PHONEWORD(F1, (ph41, ph42, ph43, ph4_ext_lbl, ph44), '*\x95*\x95* * *')
Phone5Word = PHONEWORD(F1, (ph51, ph52, ph53, ph5_ext_lbl, ph54), '*\x95*\x95* * *')
Phone6Word = PHONEWORD(F1, (ph61, ph62, ph63, ph6_ext_lbl, ph64), '*\x95*\x95* * *')Phone numbers will print as 555•123•1212
If you need a space before and after each bullet, the format would be:
'* \x95 * \x95 * * *'
Phone numbers will print as 555 • 123 • 1212
You can copy and paste the code above into your style. When you do, don't forget the code above the PhoneWord definitions to remove the extension label if the extension number is missing. And remember to change the font, F1, if you need a different font for phone numbers.
Images inline with text run from relatively simple to very complex logic. They can be "hard coded" or linked to a user's profile, an address or a division. The user may be able to select the image from a drop-down list, checkboxes or radio butons. Thumbnails can be associated with checkboxes or radio buttons. You could use the Form Editor to create a Sublogo Field to allow the user to see and choose their image. These are just a few wys in which this can be done. We have quite a bit of documentation you can use to achieve many of these. Here are a few links:
Sublogo - Sublogo Section Form
Sublogo Selection with Thumbnails Using a Drop-Down List
How to Use Images as Phone Labels in a Drop-down List
One of the most common needs for inline images with text is for phone labels. Here is a simple example. If phone #1 needed a "T" (for telephone), phone #2 needed an "F" (for fax) and phone #3 needed an "M" (for mobile), and the user was not allowed to change the order in which they would be typeset, you could replace the phone labels with images as follows:
phone1 = (IF(EPSWORD('con/label_T.eps'), SPACER(2), Phone1Word))
phone2 = (IF(EPSWORD('con/label_F.eps'), SPACER(2), Phone2Word))
phone3 = (IF(EPSWORD('con/label_M.eps'), SPACER(2), Phone3Word))
In this example we have created three new variables: phone1, phone2 and phone3, and defined them using an IF statement to prevent the phone label from printing if the PhoneWord (phone number) is missing.
You cannot move the image up or down inline with the type. However, you can move the type. So, you can use the SHIFT command and apply it to the text.
Upload the phone label EPS or JPG files to the site using the File Uploader in the site's menu.
![]() | Note |
|---|---|
JPG or EPS files can be used. |
In Visual Style Editor (VSE), you will need to add the three new variables to the Variables tab, without a Default Value and with the Type drop-down list as Text.
In VSE, the sample code above would need to be in the Preblocks tab because the engine runs the style from left to right, beginning with the Variables tab. So, the PhoneWords would be defined in the Phones tab before applying the label in the Preblocks tab, and the type could be set in the Blocks tab by using the new variables you created (phone1, phone2 and phone3) in the Blocks tab instead of PhoneWords.
It is difficult to write one piece of documentation with examples of all the different ways to implement inline images. It often requires combining information from more than one piece of documentation to achieve what is needed. If you cannot find what you need here, please contact PageDNA Support for assistance and provide us with all the details of what is needed.
If you wish to have the system auto populate the current date on an item or use the current date to calculate something such as an expiration date, you can do so with the following process.
In the Pre Blocks area add this section of code:
# calculate date 4
import notions, time
days = 86400
date = notions.fmttime('%B %e, %Y', time.time())In the style block you will need to call the variable 'date' to have the date displayed. The result would look like this: Month Day, Year (i.e. August 23, 2008)
The style and format of the date can be customized by altering some of the variables in the last line of the code.
For a the Month variable, you may use any of the following values.
%B = Full month name (i.e. August) %b = Abreviated month name (i.e. Aug) %m = Number of the month (i.e. 8)
Additionally you can place different types of formatting in to the code. For example, %b-%e-%Y would show as Aug-03-2008 and %m/%e/%y woudl display as 08/08/09. Any text value between the variables should work since everything between the single quotes will be displayed.
If you wish to display a date that is dynamic to some time in the future, such as coupon that expires 45 days from the current date, you can add this code to the last line:
+ 45*days)
Change the number of days to fit your specific need. The code as a whole would look like this:
# calculate date 4
import notions, time
days = 86400
date = notions.fmttime('%B %e, %Y', time.time()+ 45*days)tags: automatic date, time stamp, date stamp
In instances where you need the EPS or PDF file to come to you rotated in order to facilitate the the imposition process we offer several different ways to achieve this.
On the "Other" tab of the Visual Style Editor or Style Editor Gold enter the degrees of rotation to use in the "EPS Imprint rotate" field (default is 0). Entering the value 90 will rotate the file clockwise 90 degrees. You can use + or - to indicate the direction of rotation. By default the items will be rotated clockwise. This method will only rotate the EPS or PDF files, not the preview.
Build the styles rotated (using ANGLE to rotate type sideways, etc) and then rotate the preview shown to the user. This is a more difficult method. Both the Preview and the EPS/PDF will be rotated in this method. You can learn more about the ANGLE command here.
Use the system's Imposition tool. This provides tools to design output plates, combine orders onto a plate, and download postscript. Be aware that only works for entire plates, not individual files. To learn more about the Imposition tool click here.
The following is a limited application for setting type on a path (please see notes at the end). These commands were specifically designed for setting type for round stamps.
There are two commands: TOPCIRCLEWORD and BOTTOMCIRCLEWORD. These commands let styles set text on a curved path or radius. The radius is defined in points. TOPCIRCLEWORD is for the upper half of the radius and BOTTOMCIRCLEWORD is for the bottom half. These two commands can be used separately.
Visual Style Editor (VSE): If you are using VSE, you will need to enable Block Logic to use these commands, and they need to be placed in either the Preblocks or Postblocks tabs of the style.
![]() | Setting the Radius |
|---|---|
In all the examples below, the font is followed by the value of the radius in points. |
TOPCIRCLEWORD could yield something like the:
Your block would look like this to set "HOT FUDGE" as above:
Block1 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('HOT FUDGE', F2, 30),))
], (50, 50), (CENTER, CENTER))
F2 is the font used to set "HOT FUDGE", which is followed by the radius in points.
To set both halves, top and bottom like this:
To do this, the block would look like this:
Block1 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('DELICIOUS ICECREAM', F2, 30),
BOTTOMCIRCLEWORD('DELICIOUS ICECREAM', F2, 30)))
], (50, 50), (CENTER, CENTER))
There are two supplemental parameters that will draw arcs inside and outside the text that will not join OR that will draw semicircles inside and outside the text that will join. The parameters are show_inside and show_outside.
When these parameters are set to be equal to 1, they draw arcs that will not join the top and bottom halves if you draw both the top and bottom arcs. They are essentially like underlines and "overlines."
When they are set to be equal to 2, they draw semicircles that will join if you draw both the top and bottom arcs.
![]() | Relationship of Top and Bottom Arcs |
|---|---|
In using these parameters, please be aware that the bottom arc for the TOPCIRCLEWORD is the top arc for the BOTTOMCIRCLEWORD and vice versa. |
In the following example show_inside and show_outside are equal to 1, so they draw arcs that are not joined:
To do this, the block would look like this:
Block2 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=1, show_outside=1),
BOTTOMCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=1, show_outside=1)))
], (180, 50), (CENTER, CENTER))
In the following example show_inside and show_outside are equal to 2, so they draw full semicircles that are joined:
To do this, the block would look like this:
Block2 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=2, show_outside=2),
BOTTOMCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=2, show_outside=2)))
], (180, 50), (CENTER, CENTER))
![]() | About Fonts and Arcs |
|---|---|
Apart from the relationship of the arcs, noted above, the font plays a VERY important factor. Important Points:
|
PageDNA has some special "variables" that are reserved for some very specific applications, described below.
All of these variables use a special format - two underscores, the variable name, and then two more underscores. All variables are case sensitive.
If you are using Visual Style Editor (VSE), it requires you to define these variables in the "Variables" tab before using them and use them in the Preblocks or Postblocks tabs, which become available after you enable Block Logic (in the Page tool in the toolbar of the Blocks tab).
You can use any of the variables below in the Blocks tab in VSE if you first define them in the Preblocks tab. For example, if you want to use the my_variable as a replacement for __tag__ (because __tag__ cannot be used in the Blocks tab), you would define it in the Preblocks tab as follows:
my_variable = __tag__
Table of Contents
This portion of the documentation shows 'tips and tricks' we recommend for building high-quality ordering sites.
'normal': {
'scale': 1.0,
'combine': '',
'use_magick': 1,
},
'big': {
'scale': 2.0,
'combine': '',
'delay': 1,
'use_magick': 1,
},
'html': '''
<table>
<tr>
<td align=left>
<font face="Arial">
<B>Business Card, Actual Size:</B><BR>
<a href="%(p.big_src)s" target="_blank"><img src="%(p.normal_src)s" border=0></a>
<BR><font size=2>Click image for enlarged proof in new window</font></font>
</td></tr>
</table>
''',
In the example above, the "normal" preview shows when users first proof, as displayed in the custom HTML section. Then we define (shown in bold) a "big" preview that will display at 200 percent. Note the 'delay' flag has been enabled on the big preview. This tells the system to wait to generate this proof on-demand, saving proofing time for the initial proof.
The custom HTML section is required for this approach as we need to define (as shown in bold above) a link defined around the normal preview image. When clicked, this opens a new blank window.
Commented lines can be added as a way to disable code, or to place a note in the style and mark it in such a way that it is ignored when the style is processed and turned into a file that can be printed.
Comments in a style may be added for a number of reasons, among them being: adding comments for clarity; adding comments so you will be reminded of what and why you did something; "Commenting-out" a line for testing purposes; or, if you need to remove a line from your style, but want to retain it should your client change their mind.
A line may be commented-out by placing the pound symbol (#) followed by a space to separate it from the code or note that follows.
The EGG tool adds commented lines automatically. An example of an auto-added comment line is noted in bold face below:
# auto-added by upload button LogoBlock = DWIMBLOCK([EPSWORD('con/Your_File_Name.eps', xscale=1, yscale=1)], (0.0,0.0), (LEFT,BOTTOM) , layer=-1) # end auto-add
You can add comments in the middle of code as follows:
titles = [card_title1, card_title2, card_title3] titles = [t for t in titles if t] # filter list to only include titles that are set. titles = titles + ['', '', ''] # pad titles so that there are at least 3.
You can comment out a line in the middle of a block. Only the line preceded by the '#' sign will be ignored when the style is processed. Also note the auto-added line at the end denoting dimensions:
NameBlock = DWIMBLOCK([RIGHT, WRAP,
F10, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, IF(', ', name_suffix), NEWLINE,
F4, card_title1, NEWLINE,
card_title2, NEWLINE,
# card_title3, NEWLINE,
], (110,87), (RIGHT,TOP_BASELINE), (101,0) )
# x: LEFT=104.8 RIGHT=151.2 y:BOTTOM=18.3
You can run into a problem if you comment-out a line that contains the 'font call' for the block. Subsequent lines in your style will default to being set with Helvetica until another 'font call' is encountered, as in the following example:
NameBlock = DWIMBLOCK([RIGHT, WRAP,
F10, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, IF(', ', name_suffix), NEWLINE,
# F4, card_title1, NEWLINE,
card_title2, NEWLINE,
# card_title3, NEWLINE,
Phone_Word1
], (110,87), (RIGHT,TOP_BASELINE), (101,0) )
# x: LEFT=104.8 RIGHT=151.2 y:BOTTOM=18.3
In the above example, card_title2 would be set using Helvetica because the line with the 'font-call' that includes card_title1 has been commented out. The next line that would be set correctly is the one that begins with Phone_Word1 because, as a rule, Phone_Words (defined on the Words tab) have 'font calls' as denoted below by 'F1':
Phone1Word = PHONEWORD(F1, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '(*) *-* *
*')
You can comment out a whole section using three double quotes (""") before and after the section instead of putting a pound symbol (#) in front of each line. For example:
""" NameBlock = DWIMBLOCK([CENTER, F2, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '), name_last, IF(', ', name_suffix), NEWLINE, card_title1, NEWLINE, ], (128.0, 32.3), (CENTER, TOP_BASELINE)) """
This will prevent the entire NameBlock from being processed.
![]() | Note |
|---|---|
JPG or EPS files can be used. |
MasterShellBlock = DWIMBLOCK([EPSWORD('con/bcard-master.eps', xscale=1, yscale=1)],
(0.0, 0.0), (LEFT,BOTTOM) , layer=-2)
PhotoBlock = DWIMBLOCK([EPSWORD('con/photo.eps', xscale=1, yscale=1)],
(20, 232), (LEFT,BOTTOM) , layer=-1)
In the example above, a full-size EPS representation of the 'master' for a business card (MasterShellBlock) has been lowered to level '-2' so that the photo (PhotoBlock) will float higher in the 'stack' of EPS files. Remember that negative numbers get LOWER and the number increases. Failing to perform this may have buried the photo image below the master.
Another option for 'layer' is PREVIEW_LAYER - this shows the image of the EPS file to the user, but does not send the EPS file to press.
NoPrintBlock = DWIMBLOCK([EPSWORD('con/stopsign.eps', xscale=1, yscale=1)],
(20, 232), (LEFT,BOTTOM) , layer=PREVIEW_LAYER)
The above example would show an uploaded EPS file called "stopsign.eps" in the proof, but would not send this file to press. PREVIEW_LAYER is set deep in the stack of files and is often used to show optional items that are pre-printed on masters (goil foil seals, etc).
Any layers between -1000 and -1999 have this "preview layer" behavior, so if you still need to stack and layer files but not send them to press, use this layer range.
A final 'layer' option is the OUTPUT_LAYER option - this does not show the image to the user, but it DOES send the image in the EPS file. The OUTPUT_LAYER is reserved down at -2500 so if you need to have stacked images that are all in the OUTPUT layer, you can set the layer=-2500 for the image on top and and layer=-2501 for the next image below, etc.
PrintOnlyBlock = DWIMBLOCK([EPSWORD('con/stopsign_black.eps', xscale=1, yscale=1)],
(20, 232), (LEFT,BOTTOM) , layer=OUTPUT_LAYER)
The OUTPUT_LAYER can be handy when used in conjunction with the PREVIEW_LAYER. For example, if you need to display a blue EPS file to the user, but send a black EPS file to production, you could set up two DWIMBLOCKs. One would display the blue EPS file and use the 'PREVIEW_LAYER'. The other DWIMBLOCK would use the black EPS file and would use the 'OUTPUT_LAYER'.
Any layers between -2000 and -2999 have this "output layer" behavior, so if you still need to stack and layer files amd send them to production but not to the proof, use this layer range.
Stacking layers can be used for many purposes. Creative masking effects can be generated through creative use of white-out layers stacked above EPS files.
A preview layer in an item's style can be used to create a watermark on a proof. A watermark is an image that displays on the proof presented to users, but which does NOT get sent to press. This is especially useful to ensure the users simply download the proof and have it printed elsewhere.
To add a watermark to an item begin by building an functioning item. Once you have a fully tested item, create your own watermark image as an EPS file with a bounding box the same size as item including your full bleed and save it as an Adobe Illustrator Version 8 EPS in line with our standards as presented in the artwork help document.
From your Storefront Menu use the File Uploader to add your watermark EPS or JPG file to the CON directory.
![]() | Note |
|---|---|
JPG or EPS files can be used. |
Go to the Blocks tab of your item's style and add the following piece of code:
NoPrintBlock = DWIMBLOCK([EPSWORD('con/WATERMARK.EPS', xscale=1, yscale=1)],
(20, 232), (LEFT,BOTTOM) , layer=PREVIEW_LAYER)
In this example you will need to replace WATERMARK.EPS with the name of your actual EPS file.
Now you will have an additional layer that displays your watermark on any previews but will not pass along to the actual production file.
For information about to to achive this using the Visual Style Editor tool, click here.
Debugging a style can be difficult at times. There are times when you as the programmer need to know exactly what value a specific variable has assigned to it. These values can be very hard to 'see' at times. That is where the DBG command comes into play.
In the style add a single line of code which will print the value of a variable to the testing screen from style editor gold. (The screen that appears when hitting the Test button from Style Editor Gold, which has the grey background.)
DBG('Title One=%s', card_title1)
In the example above, the string Title One=(value of card_title1) will print directly under the normal section of the preview test page.
Any variable can be used in a DBG statement. In Python %s is used to add a variable to a string. The variable itself is added after the comma.
Create a block for your text or image in your style in the correct position and size. Then make an exact copy of the entire block, change the name of the block and give the new block and offset in its anchor points.
Use the layers command to move the offset block behind the original block.
Make new colors in the fonts section to make the offset block a different color or screen value than the original block. See the example code below.
Block0 = DWIMBLOCK([CENTER, WRAP,
F3, card_company, NEWLINE,
], (324, 757.7), (CENTER, TOP_BASELINE), (250,0), layer=-4)
Block0_black = DWIMBLOCK([CENTER, WRAP,
F3_black, card_company, NEWLINE,
], (326, 753.7), (CENTER, TOP_BASELINE), (250,0), layer=-5)
Procedure 14.1. Creating Great Proofs
The key to creating great proofs is in choosing the right size to display the item at to the end user. We recommend that for a standard business card, make your GIF 7 inches by 4 inches at 72 dpi. This is for a 2x preview, which looks good on a standard-sized browser window, with very clear legibility even on small fonts.
Use the WHOLE card image and put all "static info" -- be it GIF (preview) or EPS(print) -- into the site IN POSITION. Because GIFS are NOT scaleable, make at the 2x size for business cards. For letterhead and other products we recommend any width around 550 points for this image.
Upload this image into your Style by clicking the "Upload" button and then choosing the "GIF" option, browsing for your image, and clicking Upload. The size for the preview will be set by the size of the image you uploaded. You can confirm the scale in the "preview" tab of Style Editor Gold.
These same principles apply to all other products. For the sake of showing proofs and imprint info on larger products (e.g. letterhead, envelopes, anything bigger than a memo pad (8.5 x5.5), we recommend a scale of .7 of original size for the product and a zoom of 1.5x to 2x. For memo pads and mailing labels, we generally use a 1x on the product and a 1.5x to 2x zoom.
The general rule is to try to get the final size to be around 550 points wide at 72 dpi.
Scenario: "Jaggies" or "halos" appear around variable type floating over a background (master) image
We offer two ways to show 'master' (pre-printed shell) images - which are shown to the user bwhen proofing but not sent to press - on our system. One way, which is standard, is to use the GIF images which normally works just fine. One issue with GIF images in this situation is that when you show text over a darker background, you will see "jaggies" or that 'halo' which can confuses users. This does not affect the print, but obviously is something to avoid.
Fortunately, VIPER also supports the use of an EPS file as your background 'master' image, which gets rid of this problem and shows crystal clear text, even over background images. Here are the steps to do this for a layout:
STEP 1) CREATE NEW EPS MASTER IMAGE: Create an EPS file with the exact size as your output file (go to the "other" tab in the Style Editor if you need the dimensions), having just the contents of the master image (the pre-printed element). Save this as an Adobe Illustrator EPS file to your desktop.
STEP 2) UPLOAD EPS MASTER IMAGE: Edit the style for the side in question, then click the "Upload" button in the lower right corner of the Style Editor. On the page that follows, make sure "eps" is selected and then browse and find the EPS file you created above. You do not need to change any other settings, but if you have other logos you've uploaded you may wish to change the default name of this block from "LogoBlock" to something unique like "MasterBlock".
STEP 3) MOVE LOGO TO PREVIEW LAYER: Next, having uploaded the logo, visit the "blocks" section - at the top you will see your newly uploaded EPS file as "LogoBlock" or "MasterBlock". Now, if you want to show this to users but not send that EPS or JPG file to press, you need to change the 'layer' from -1 to 'PREVIEW_LAYER' (with no quotes). For example, your code might look something like this:
LogoBlock = DWIMBLOCK([EPSWORD('con/bcard-master.eps', xscale=1, yscale=1)],
(0.0, 0.0), (LEFT,BOTTOM) , layer=-1)
which you will want to change the bold text above to:
LogoBlock = DWIMBLOCK([EPSWORD('con/bcard-master.eps', xscale=1, yscale=1)],
(0.0, 0.0), (LEFT,BOTTOM) , layer=PREVIEW_LAYER)
PREVIEW_LAYER essentially tells VIPER to display this EPS file, but not to sent it to press.
STEP 4) Lastly, you need to de-reference the GIF file so the EPS is used. Go to the 'preview' tab of the Style Editor, where you will see something like this:
{
'normal': {
'combine': '/mnt/sdb1/inet/www/clients/yoursite/con/bc1_combine.gif',
'scale': 2.0,
'use_magick': 1,
},
Remove in its entirety the bold line above (select the whole line including the comma at the end and delete it), and then save your style with the Gold "Save" button.
STEP 5: Refresh your item proof or start a fresh order - the jaggies will be gone!
You can use what are known as Zoom Blocks to ‘zoom in’ on one or more particular blocks of text. This technique works very well for letterhead. The default envelope and letterhead Style files included with new sites have a zoom block. Explore these Styles to learn more about this feature, and also see our more detailed documentation on Zoom Blocks that includes a "how to" on this feature.
PageDNA offers the ability for you to provide your users with a link to a PDF link, directly above the GIF proofs shown on the "Proofs" step of the ordering process. This is sometimes helpful on large items with smaller text (such as letters, invites and other direct mail pieces), where the user needs to really 'zoom in' and take a look. Many customers do NOT like to provide this option because of the risk that users will take this file and simply print it on their local laser printer or inkjet. Keep this in mind before adding PDF links to your styles.
To add the PDF links to your products, go to the "Previews" section of Style Editor Gold. You need to add the following within the first brace, but before the zoom or 'normal' blocks:
'pdf': {'PDF': 1},
For example:
{
'pdf': {'PDF': 1},
'zoom1': {
'scale': 2.0,
'use_magick': 1,
'block': 'Block0',
},
'zoom2': {
'scale': 2.0,
'use_magick': 1,
'block': 'Block1',
},
'normal': {
'scale': 0.5,
'combine': '/con/1-sps-vda-002-0704_combine.gif',
'use_magick': 1,
},
}
Note: If you use a custom HTML preview for your layout, you will need to manually call the PDF link in your preview HTML. Below is an example showing custom preview HTML with a link to the PDF preview displayed.
{
'html': '''\
<table>
<tr><td align=center>
<font face="Arial"><B>Product Preview:</B> <a href="%(p.pdf_pdf)s" target="_blank">View PDF</a><BR>
<img src="%(p.normal_src)s"></font></td></tr>
</table>
''',
'normal': {
'scale': 1.4,
'use_magick': 1,
},
'pdf': {
'PDF': 1,
'use_magick': 1,
},
}
Two sided items will automatically add a note to the front side proof indicating it as the front. Sometimes it is nice to add a label to the back side proof indicating that it is the back. Here is how.
Start in the 'preview' section of Style Editor Gold for your 'back-side' style and add some html:
# A standard preview section looks like:
{
'normal': {
'combine_offset': (0, 0),
'scale': 2,
'combine': 'con/combine.gif',
'combine_scale': 1,
'use_magick': 1,
},
}
which could be changed to:
{
'normal': {
'combine_offset': (0, 0),
'scale': 2,
'combine': 'con/combine.gif',
'combine_scale': 1,
'use_magick': 1,
},
'html': '''\
<table>
<tr><td align=center>
Product Back Side:
<img src="%(p.normal_src)s"></td></tr>
</table>
''',
}
Notice the addition of the html code in the example above. The text "Product Back Side" will print above the main proof of the back side. This text can contain anything required.
For further information about SosBackItems go to "Two Sided Items"
Text must be enclosed in a 'quote' of some kind so that it will be seen as text. If your text includes a single quote, comma, apostrophe or double quotes, and must retain them, the line (or string) of text must be enclosed by a style of quote that is not included in the string of text. These styles are single quotes ('xxx yyy'), double quotes made by holding the shift key in conjunction with the single quote key ("xxx, yyy") and triple quotes created by three single quotes ('''"xxx's yyy"'''). Examples follow.
The following is the recommended method to include a line of text that does not contain a comma, single quote or double quotes, the line of text must be enclosed by single quotes. This will ensure that the entire string of text is seen as a single unit. This is also the case for single words.
'The lazy brown fox jumped over the fence.'
If the line of text has an apostrophe or comma, or is enclosed in single quotes, it must be enclosed by double quotes.
"The lazy brown fox jumped over the neighbor's fence, then fell on his face."
Not that in the example above, when output, the text will read: The lazy brown fox jumped over the neighbor's fence, then fell on his face.
"'The lazy brown fox...'"
Note that in the example above, when output, the text will read: 'The lazy brown fox...'
If the text is a quotation, such that double quotes must be retained, the line of text must be enclosed in single quotes as follows:
'He said, "Thar she blows!"'
In the example above, when output, the text will read: He said, "Thar she blows!"
Double quotes are seen as a single character. So the order in which you type the single and double quotes will determine what is being enclosed so the text can be output correctly.
However, if the text contains an apostrophe and double quotes as in: He said, "The brown fox jumped over the lazy dog's bowl." The string must be enclosed in three single quotes, also called triple quotes, as follows:
'''He said, "The brown fox jumped over the lazy dog's bowl!"'''
In the example above, if double quotes were used instead of the triple quotes, the text would appear as: He said,(space) because the next double quote encountered closes the string, the rest of the sentence would be lost.
If single quotes were used, the line would break at the apostrophe as: He said, "The brown fox jumped over the lazy dog and the rest of the sentence would be lost. So, in this case triple quotes must be used.
![]() | Tip |
|---|---|
While Double quotes will work in almost any instance, we recommend that you use single quotes as much as possible. We find single quotes easier to read and trust that you will as well. Also, Double quotes can be hard to distinguish in the Block Section of the Style Editor from two single quotes next to each other. |
The % symbol is "meaningful" to our form processing system.
Therefore, to retain the % symbol in a style in a string of text, e.g. "25%", it needs to appear as:
"25%%"
Please note that this does not affect users when ordering. Nothing out of the ordinary needs to be done to retain the % symbol when they enter their information.
If you have several phone numbers or titles, and need them to self adjust so that so many will appear on the first line, and so many will appear on the second line, you may use the following code as an example. This can be adjusted to accommodate any number of phone numbers. A second example for three 'floating' titles is also given below.
In the following case, there are five phone numbers. The following code will place up to two phone numbers on the first line, and up to three phone numbers on the second line. Note: the fifth phone number in this example is hard coded for 'parts sales'.
It does not matter which phone numbers are selected by the user, they will self adjust. If, for example, phones 1 and 3 are selected, the first line would have phones 1 and 3, while line two would have phone 5 (because phone #5 is hard coded). So, If no phone number is selected, the phone number for 'parts sales' would appear on the first line.
Note: The # precedes informative notes in the code. These notes will not be executed.
phones = [Phone1Word, Phone2Word, Phone3Word, Phone4Word, ('parts sales 888 888 8888')]
phones = [p for p in phones if p] # filter list to only include phones that are set or have copy.
phones = phones + ['', '', '', '', ''] # pad phones so that there are at least 5.
PhoneBlock = DWIMBLOCK([LEFT,
F4, phones[0], IF(' ', phones[1]), NEWLINE,
phones[2], IF(' ', phones[3]), IF(' ', phones[4]), NEWLINE,
card_email, NEWLINE,
], (18,23.6), (LEFT,BOTTOM))
In the following case, there are three titles. The code example below will place up to two titles on the first line and one title on the second line. Again, it does not matter which titles are selected. For example, if title1 and title3 are selected, they will appear on the first line; if only title 3 is selected, it will appear on the first line by itself.
Note: The # precedes informative notes in the code. These notes will not be executed.
titles = [card_title1, card_title2, card_title3]
titles = [t for t in titles if t] # filter list to only include titles that are set.
titles = titles + ['', '', ''] # pad titles so that there are at least 3.
Block0 = DWIMBLOCK([LEFT,
F1, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, IF(', ', name_suffix), NEWLINE,
F3, titles[0], IF(', ', titles[1]), NEWLINE,
IF(titles[2]), NEWLINE,
], (18,75.7), (LEFT,TOP_BASELINE) )
If your phone labels are hard coded, e.g. phone 1 is always Main Phone then you can call an EPS or JPG file inline in the Block like this:
LEFT, F5, EPSWORD('con/mainphone_icon.eps'), SPACER(3), SHIFT(2),Phone1Word, SHIFT(0), NEWLINE,![]() | Note |
|---|---|
JPG or EPS files can be used. |
This example uses Phone1Word, but this could be done for other labels such as for Website.
Use the SHIFT command to move the type up or down in order to align the logo with the text. Set the bounding box of the logo to equal the height of the type plus leading and that will help keep the type aligned closely. Using the SPACER command will control the amount of space after the icon before the phone number begins. In this case the value 3 was used and that will result in 3 points of space between the icon and the phone number.
If the phone labels are dynamic you can use the Personal Page to pass a file name in place of the label choice. When defining the drop-down list use the right hand column to provide the path to the image including the filename. (e.g. 'con/image_icon.eps')
When using dynamic phone labels you will want to use this code in the Block:
LEFT, F5, EPSWORD(ph1_label), SPACER(3), SHIFT(2),'Main Phone', SHIFT(0), NEWLINE,
Replace 'ph1_label' to match what you defined the variable to be when setting up the drop-down list.
When using Style Editor Gold (SEG), this can be done in the Words tab of a style.
Standard code for the configuration of phones is as follows:
if not ph14: ph1_ext_lbl = '' if not ph24: ph2_ext_lbl = '' if not ph34: ph3_ext_lbl = '' if not ph44: ph4_ext_lbl = '' if not ph54: ph5_ext_lbl = '' if not ph64: ph6_ext_lbl = '' Phone1Word = PHONEWORD(F1, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '(*) *-* * *') Phone2Word = PHONEWORD(F1, (ph21, ph22, ph23, ph2_ext_lbl, ph24), '(*) *-* * *') Phone3Word = PHONEWORD(F1, (ph31, ph32, ph33, ph3_ext_lbl, ph34), '(*) *-* * *') Phone4Word = PHONEWORD(F1, (ph41, ph42, ph43, ph4_ext_lbl, ph44), '(*) *-* * *') Phone5Word = PHONEWORD(F1, (ph51, ph52, ph53, ph5_ext_lbl, ph54), '(*) *-* * *') Phone6Word = PHONEWORD(F1, (ph61, ph62, ph63, ph6_ext_lbl, ph64), '(*) *-* * *')
The asterisks represent the parts of the PhoneWord: area code, prefix, last 4 digits, extension label and extension number, along with the format, e.g. the area code surrounded by parentheses or the hyphen following the phone prefix.
The code for a bullet is "\x95". (You can find the octal code for standard glyphs in the Variables tab of a style.) We can substitute the parentheses, spaces and hyphens with a bullet. The format would be as follows:
if not ph14: ph1_ext_lbl = '' if not ph24: ph2_ext_lbl = '' if not ph34: ph3_ext_lbl = '' if not ph44: ph4_ext_lbl = '' if not ph54: ph5_ext_lbl = '' if not ph64: ph6_ext_lbl = '' Phone1Word = PHONEWORD(F1, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '*\x95*\x95* * *') Phone2Word = PHONEWORD(F1, (ph21, ph22, ph23, ph2_ext_lbl, ph24), '*\x95*\x95* * *') Phone3Word = PHONEWORD(F1, (ph31, ph32, ph33, ph3_ext_lbl, ph34), '*\x95*\x95* * *') Phone4Word = PHONEWORD(F1, (ph41, ph42, ph43, ph4_ext_lbl, ph44), '*\x95*\x95* * *') Phone5Word = PHONEWORD(F1, (ph51, ph52, ph53, ph5_ext_lbl, ph54), '*\x95*\x95* * *') Phone6Word = PHONEWORD(F1, (ph61, ph62, ph63, ph6_ext_lbl, ph64), '*\x95*\x95* * *')
Phone numbers will print as 555•123•1212
If you need a space before and after each bullet, the format would be:
'* \x95 * \x95 * * *'
Phone numbers will print as 555 • 123 • 1212
You can copy and paste the code above into your style. When you do, don't forget the code above the PhoneWord definitions to remove the extension label if the extension number is missing. And remember to change the font, F1, if you need a different font for phone numbers.
Images inline with text run from relatively simple to very complex logic. They can be "hard coded" or linked to a user's profile, an address or a division. The user may be able to select the image from a drop-down list, checkboxes or radio butons. Thumbnails can be associated with checkboxes or radio buttons. You could use the Form Editor to create a Sublogo Field to allow the user to see and choose their image. These are just a few examples of how it could be done. We have quite a bit of documentation you can use to achieve many of these. Here are a few links:
Sublogo - Sublogo Section Form
Sublogo Selection with Thumbnails Using a Drop-Down List
How to Use Images as Phone Labels in a Drop-down List
One of the most common needs for inline images with text is for phone labels. Here is a simple example. If phone #1 needed a "T" (for telephone), phone #2 needed an "F" (for fax) and phone #3 needed an "M" (for mobile), and the user was not allowed to change the order in which they would be typeset, you could replace the phone labels with images as follows:
phone1 = (IF(EPSWORD('con/label_T.eps'), SPACER(2), Phone1Word))
phone2 = (IF(EPSWORD('con/label_F.eps'), SPACER(2), Phone2Word))
phone3 = (IF(EPSWORD('con/label_M.eps'), SPACER(2), Phone3Word))
In this example we have created three new variables: phone1, phone2 and phone3, and defined them using an IF statement to prevent the phone label from printing if the PhoneWord (phone number) is missing.
You cannot move the image up or down inline with the type. However, you can move the type. So, you can use the SHIFT command and apply it to the text.
Upload the phone label EPS or JPG files to the site using the File Uploader in the site's menu.
![]() | Note |
|---|---|
JPG or EPS files can be used. |
In Style Editor Gold (SEG), phone numbers, or PhoneWords, are defined in the Words tab. The sample code above should be placed in the Blocks tab before the block that sets the phone numbers. You would use the new variables you created (phone1, phone2 and phone3) in the block with the phone numbers instead of using PhoneWords.
It is difficult to write one piece of documentation with examples of all the different ways to implement inline images. It often requires combining information from more than one piece of documentation to achieve what is needed. If you cannot find what you need here, please contact PageDNA Support for assistance and provide us with all the details of what is needed.
If you wish to have the system auto populate the current date on an item or use the current date to calculate something such as an expiration date, you can do so with the following process.
In the Blocks area, prior to the section where you need to show the date add this section of code:
# calculate date 4
import notions, time
days = 86400
date = notions.fmttime('%B %e, %Y', time.time())You will need to call the variable 'date' in your code to have the date displayed. The result would look like this: Month Day, Year (i.e. August 23, 2008)
The style and format of the date can be customized by altering some of the variables in the last line of the code.
For a the Month variable, you may use any of the following values.
%B = Full month name (i.e. August) %b = Abreviated month name (i.e. Aug) %m = Number of the month (i.e. 8)
Additionally you can place different types of formatting in to the code. For example, %b-%e-%Y would show as Aug-03-2008 and %m/%e/%y woudl display as 08/08/09. Any text value between the variables should work since everything between the single quotes will be displayed.
If you wish to display a date that is dynamic to some time in the future, such as coupon that expires 45 days from the current date, you can add this code to the last line:
+ 45*days)
Change the number of days to fit your specific need. The code as a whole would look like this:
# calculate date 4
import notions, time
days = 86400
date = notions.fmttime('%B %e, %Y', time.time()+ 45*days)In instances where you need the EPS or PDF file to come to you rotated in order to facilitate the the imposition process we offer several different ways to achieve this.
On the "Other" tab of the Visual Style Editor or Style Editor Gold enter the degrees of rotation to use in the "EPS Imprint rotate" field (default is 0). Entering the value 90 will rotate the file clockwise 90 degrees. You can use + or - to indicate the direction of rotation. By default the items will be rotated clockwise. This method will only rotate the EPS or PDF files, not the preview.
Build the styles rotated (using ANGLE to rotate type sideways, etc) and then rotate the preview shown to the user. This is a more difficult method. Both the Preview and the EPS/PDF will be rotated in this method. You can learn more about the ANGLE command here.
Use the system's Imposition tool. This provides tools to design output plates, combine orders onto a plate, and download postscript. Be aware that only works for entire plates, not individual files. To learn more about the Imposition tool click here.
The following is a limited application for setting type on a path (please see notes at the end). These commands were specifically designed for setting type for round stamps.
There are two commands: TOPCIRCLEWORD and BOTTOMCIRCLEWORD. These commands let styles set text on a curved path or radius. The radius is defined in points. TOPCIRCLEWORD is for the upper half of the radius and BOTTOMCIRCLEWORD is for the bottom half. These two commands can be used separately.
![]() | Setting the Radius |
|---|---|
In all the examples below, the font is followed by the value of the radius in points. |
TOPCIRCLEWORD could yield something like the:
Your block would look like this to set "HOT FUDGE" as above:
Block1 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('HOT FUDGE', F2, 30),))
], (50, 50), (CENTER, CENTER))
F2 is the font used to set "HOT FUDGE", which is followed by the radius in points.
To set both halves, top and bottom like this:
To do this, the block would look like this:
Block1 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('DELICIOUS ICECREAM', F2, 30),
BOTTOMCIRCLEWORD('DELICIOUS ICECREAM', F2, 30)))
], (50, 50), (CENTER, CENTER))
There are two supplemental parameters that will draw arcs inside and outside the text that will not join OR that will draw semicircles inside and outside the text that will join. The parameters are show_inside and show_outside.
When these parameters are set to be equal to 1, they draw arcs that will not join the top and bottom halves if you draw both the top and bottom arcs. They are essentially like underlines and "overlines."
When they are set to be equal to 2, they draw semicircles that will join if you draw both the top and bottom arcs.
![]() | Relationship of Top and Bottom Arcs |
|---|---|
In using these parameters, please be aware that the bottom arc for the TOPCIRCLEWORD is the top arc for the BOTTOMCIRCLEWORD and vice versa. |
In the following example show_inside and show_outside are equal to 1, so they draw arcs that are not joined:
To do this, the block would look like this:
Block2 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=1, show_outside=1),
BOTTOMCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=1, show_outside=1)))
], (180, 50), (CENTER, CENTER))
In the following example show_inside and show_outside are equal to 2, so they draw full semicircles that are joined:
To do this, the block would look like this:
Block2 = DWIMBLOCK([
STACK( (TOPCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=2, show_outside=2),
BOTTOMCIRCLEWORD('DELICIOUS ICECREAM', F2, 30, show_inside=2, show_outside=2)))
], (180, 50), (CENTER, CENTER))
![]() | About Fonts and Arcs |
|---|---|
Apart from the relationship of the arcs, noted above, the font plays a VERY important factor. Important Points:
|
PageDNA has some special "variables" that are reserved for some very specific applications, described below.
All of these variables use a special format - two underscores, the variable name, and then two more underscores. All variables are case sensitive.
If you have a need to simplify or redefine any of the variables below, you can redefine them in the Blocks tab as follows:
my_variable = __tag__
This chapter describes some tips to help with common issues when dealing with color separations.
Issue: Too many separations are created by the style. Extra files appear to be blank.
Generally this type of behavior is caused from extra unused colors being included in eps files. Each extra unused color can create an additional file, for that separation only, which will be blank.
The solution is to remove all extra color swatches from the color palette prior to saving the final production files.
Extra color separations can also be made if a Spot color name is not an exact match between the color in the style and the color that was used in the eps file. i.e. PANTONE 1234 is not the same as PANTONE 1234 C even thought they are referring to the same physical color. In this case the extra files will not be blank, the Spot color in question will have a portion of its objects in one file and the rest in another file.
A good way to check your output is to download a test eps file from Style Editor Gold, open that file in Illustrator and print the file to separations. Turning on all of the labels, and allowing blank pages to print will tell you very quickly how many separations to expect.
In some cases it is difficult to tell where the problem is. Using the layers command to turn items on and and off is the trick here - turn off all of your EPS files by setting the layer for your blocks containing EPS files (or colors of concern) to PREVIEW_LAYER can help to isolate the problem.
Learn more on layers in our DWIMBLOCK and Stacking Layers documentation.
Issue: Item needs different screen values for same color. When proofed, the wrong or a solid color shows on the proof and is sent to production.
Example color setup for type printing in as a screen of Black:
C1 = CUSTOMCOLOR('Black', 0.0, 0.0, 0.0, 1, tint=.2)
C2 = CUSTOMCOLOR('Black', 0.0, 0.0, 0.0, 1, tint=.4)
C3 = CUSTOMCOLOR('Black', 0.0, 0.0, 0.0, 1, tint=.8)
The above code will produce a proof with all text in 100% black.
The issue has to do with how the colors are named. Having 3 colors named Black was confusing the color handler. The fix is to change the type of color from a CUTOMCOLOR (best for PMS spot colors) to a PROCESSCOLOR (best for tints of black or CMYK custom values). By changing to a Process color build the tint values for 3 blacks, can be named separately.
Solution code
C1 = PROCESSCOLOR('Black20', 0.0, 0.0, 0.0, 0.20, tint=1)
C2 = PROCESSCOLOR('Black40', 0.0, 0.0, 0.0, 0.40, tint=1)
C3 = PROCESSCOLOR('Black80', 0.0, 0.0, 0.0, 0.80, tint=1)
IMPORTANT NOTE: Black and White are reserved colors in Postscript and should be avoided as names in general.
For example, if the color in question was a spot color, PMS 293, the colors definition in the fonts tab of the style would look like this:
C1 = CUSTOMCOLOR('PANTONE 293', 1, 0.57, 0, 0.02, tint=.2)
C2 = CUSTOMCOLOR('PANTONE 293', 1, 0.57, 0, 0.02, tint=.4)
C3 = CUSTOMCOLOR('PANTONE 100', 0, 0, 0, 1, tint=.8)
In this case converting to a PROCESSCOLOR will cause the output file to be incorrect and include too many separations. In your style, switch colors briefly in the blocks section to force the correct tint value to be used, while keeping the Color named the same thing.
Block0 = DWIMBLOCK([C1, name_first, ' ', name_last, NEWLINE,
card_title1, C3, ' ', NEWLINE,
C2, card_division], (50, 100), (LEFT, BOTTOM))
Setting a blank space at the end of the title line with a new font call, should cause the color handler to set the tint values of your PMS color correctly.
Table of Contents
This portion of the documentation shows how to use PageDNA’s inline tagging feature on your style so that users can change formatting of their text in the middle of a sentance or any other text input.
PageDNA supports the following palette of layout commands at this time: bold, italic, underline, bigger, smaller, subscript, superscript - plus combinations of these commands.
Please note that all styles on your site need to be modified per the below example for this function to work on your site. If you do not implement the coding shown in these pages on certain layouts, your users might actually 'tag' the imprint on their items, leading to frustration.
Each variable that you want users to be able to perform in-line tagging on needs to be wrapped in code such as the following example:
YourBlock = DWIMBLOCK([ ...
TAGTEXT( my_field_name, basefont=F1 )
...], (LEFT, BOTTOM), (0, 0))
In the example above, the variable 'my_field_name' has been prepared for use with in-line tagging, set to use the base font of F1. Let's take this further. Note that you can specify precisely which fonts will be used for italic or bold inside that particular TAGTEXT fragment. In the example below, we are using font F2 as the base font, but
YourBlock = DWIMBLOCK( [
WRAP, TAGTEXT( my_field_name, basefont=F2, italic='Times-Italic', bold='Times-Bold')
], (20.6, 347.6), (LEFT, TOP_BASELINE), (282, 180) )
Note that for the example above, you need to use the exact font name as shown in the list of currently installed fonts. Alternatively, if you have the fonts already displayed in the "fonts" tab of your Style file, you can shorten the above to reference the font names found therein. In the following example, we are using F3 for the bold font and F4 for the italic font:
YourBlock = DWIMBLOCK( [
WRAP, TAGTEXT( my_field_name, basefont=F2, italic=F3, bold=F4)
], (20.6, 347.6), (LEFT, TOP_BASELINE), (282, 180) )
Make sure to test your style from inside the site, adding tagging to test all allowed variations before making the product live to your customers.
The instance above also shows how to force text to fit inside a vertical constraint when using TAGTEXT with WRAP. Below is the same block as above, showing the two keys to making this work - the WRAP command and the use of the vertical block height maximum near the end of the block definition. In this case, 180 points of vertical space is allowed.
YourBlock = DWIMBLOCK( [ WRAP, TAGTEXT( my_field_name, basefont=F2, italic=F3, bold=F4) ], (20.6, 347.6), (LEFT, TOP_BASELINE), (282, 180) )
Procedure 16.1. Exposing Documentation To Users
First, ensure that ALL of the styles on your site have been modified to use this feature using instructions on the previous page of the docs.
Currently, you can add a link to documentation explaining the above by giving your item an Item Form or Shared Item Form using the Form Editor. Next, visit each form on your site and in a Form/Group Section field, add the following code:
<a onclick="window.open('showtmpl.cgi?doc=tagging','tagging_info','width=425,height=500,scrollbars=yes')
.focus();">Special Formatting Instructions</a>
This will add a link to the Item Form, giving users instructions on how to add comments to their text - including all examples below.
Following are examples of how your users would add tags to their input to effect different typography changes:
| Start Tag | End Tag | Description |
|---|---|---|
| <b> | </b> | Formats text between the Start and End Tags in BOLD type |
| <i> | </i> | Formats text between the Start and End Tags in ITALIC type |
| <big> | </big> | Formats text between the Start and End Tags in LARGER type |
| <small> | </small> | Formats text between the Start and End Tags in SMALLER type |
| <u> | </u> | Formats text between the Start and End Tags in UNDERLINED type |
| <sup> | </sup> | Formats text between the Start and End Tags in SUPERSCRIPTED type. The font is smaller and the baseline is shifted upwards to achieve this effect. |
| <sub> | </sub> | Formats text between the Start and End Tags in SUBSCRIPTED type. The font is smaller and the baseline is shifted downwards (below the baseline of the normal text) to achieve this effect. |
Also note that your users can use combinations of tags to create different effects:
| Start Tag | End Tag | Description |
|---|---|---|
| <b><i> | </i></b> | Formats text between the Start and End Tags in BOLD and ITALICED type |
| <big><big> | </big></big> | Formats text between the Start and End Tags in EVEN LARGER type |
Table of Contents
When editing an existing style, you must plan ahead in order to be sure that your edits don't cause errors. The order in which you make changes can effect how your item is validated. Since the PageDNA system, especially the Style Editor Gold (SEG), uses some strict error checking you cannot start at any arbitrary place to begin your edits. A style must be valid at the time that it is saved. This includes the working copy that is automatically saved by the system each time you change tabs within the SEG of Visual Style Editor (VSE).
Consider the following example that illustrates the point.
Let's say that a change in the corporate identity of a customer now requires you to change the font used on an item. Here is the sample snippet of code that we want to edit.
PhoneBlock = DWIMBLOCK([ CENTER, F2, IF(ph4_label, ' ', Phone4Word), NEWLINE ], (126, 12.0), (CENTER, BOTTOM))
For the example, you need to change the font F2 into font F3. If you simple change F2 to F3 in the Blocks tab without having already defined the font F3 in the Fonts tab, you will generate an error. That is because the system is trying to validate the code but can't since it does not yet know what font F3 is
Instead you need to go to the fonts tab first, make sure the font F3 is defined. However, don't delete the font F2 yet since it's still in use. Deleting it at this point would also give you an error.
Once you have defined font F3 in the Fonts tab, then go back to the Blocks tab and change font F2 into font F3. Finally you can go back to the Fonts tab and remove font F2 if it is not being used anywhere else in the style, but this is optional.
So here's the general recipe:
First define the new font, (or color or other variable)
Then change the code to use this new font (or color or other variable)
Finally you can delete any unused font (or color or other variable), but this is optional. Don't delete fonts (or colors or other variables) that are still in use.
In VSE things are in principle the same, although it's little easier there because you can see which fonts and variables are available on the block edit window.
This is designed to augment the preceding documentation on Tips for Editing an Existing Style
You can do one of four things depending upon the type(s) of changes needed, how extensive they are and, perhaps, the time of day, e.g. after business hours:
The simplest is: If you want to keep the item visible but prevent users from ordering it while you are making your edits, you can password protect the item by editing the item and going to the Display Info link where you can enter a password. The advantage of this is that the item stays visible so users know that the item is on the site. You can provide the site's reviewer with the password so they can test the item before you remove the password.
If you are making changes to *just* the style and *not* to the Item Form or Personal Form for an item, you can
Start an order and go through the Proof step where you will see the token number at the end of the URL.
Edit your style, make the necessary changes, DO NOT save your style, and use the test button and the token from the Proof step to generate a proof.
When you are satisfied with the changes, save your style
If you are making changes to the Personal Page and/or Item Form and the style, temporarily hide the item so only admins can see it. This can be done by editing the item in the Item Editor > Display Info and make the item Hidden in the Product Visibility drop-down list. Then edit the item and make the necessary changes.
For extensive changes, you can clone the item and use the following steps:
Give it a new tag, e.g. bc_1_2010
Edit the item and go to the Display Info link and hide this new item so you can edit it and prevent users from ordering it
Make edits to the item and/or its style
Go to the custom link for the new item, to the Replaces field and enter the old item tag. This will link the new item with the old one for reorders.
For reorders to work, you have two options:
In the Item Editor, locate the old item and delete it.
If you do not want to delete the old item, you will have to change the item's tag, e.g. bc1_OLD. You can then make it invisible.
Ultimately, if the old item exists, it will not be replaced with the new item when a user reorders the old item.
Go to the Display Info link for the new item and make the item Visible in the Product Visibility drop-down list to make it available for ordering.
![]() | Caution |
|---|---|
If you change the site mode, you will affect the ordering capability of users for the entire site. Ordinarily, changing the site mode is not needed or recommended unless you need to take the *entire* site offline to make site wide changes that could affect orders. |
Procedure 18.1. How to Test a Style
Place Test Orders and Make Basic Typesetting Adjustments
Browser Recommendations & Site Settings
As with Site Building, we recommend that you use two browser windows or tabs for this part of the testing process – one with your style and another with an ordering session. Make sure you have saved your style to be able to see your latest changes in an ordering session. The first pass of testing a style is to simulate a live order on your site. It is preferable that your site is in Test Mode, especially if you want to receive the Vendor email with the production file, which is sent once the user clicks the Send Order button at the end of the ordering session.
Initial Testing Goals
Your goal at this point is to do a visual "rough-cut" test to ensure that everything is behaving approximately how you want it. If the position of a text block looks slightly off, this should not be a concern at this point – your goal is to ensure that the blocks are behaving as you expect in different ordering situations. We will do a more precise check of your style after it passes the rough-cut test.
About Test Orders & Recommendations
After you have saved the style, place a test order for the item. It is best to use the same information as in the original file your customer supplied so you can accurately test the fonts later with test files. Once you get to the "Proof" step in the process, you will see a GIF representation (proof) of your item, typeset according to the last saved version of your style. You will also see the six character temporary "token", or order number, for your order in your browser's address bar. The URL will end with "token=XXXXXX". You will be able to use this token for testing in your style, as noted below in step 2. At the time of writing this documentation, all "live" tokens begin with the letter "G". An order is assigned a live token when the user clicks the "Send Order" button at the end of the ordering process.
About Style Editing Using a Text Editor
If you want to edit a block outside of a style because it may be easier to read and edit, you cannot use a word processing program because it inserts odd characters which the style cannot recognize and will generate errors. You must use a text editor. On a PC, you can use Notepad by clicking the Windows Start button > select Run > enter notepad > click OK. On a Mac, you can use TextEdit, which can be converted to pure text using command+Shift+T. You should convert TextEdit to text mode before pasting the block(s).
Save the Style
You can make changes to your style (ensuring that you save them) and then "Reload" or "Refresh" the Proofs page to see the results. You don't have to go back to the "Imprint" step, where the user's variable information is collected, and proof again to see your saved style changes, unless you need to change the information being typeset.
![]() | No Revert After Saving |
|---|---|
There is no option to revert a style after saving. The style's Revert button will revert the style to the last saved changes. Please make sure you want to retain a change before saving. |
Testing from the Style
You can also use the Test button in the right panel of the style to test a token from the drop-down list. If you are the only person ordering on the site, your most recent token will be at the top of the list. If you have never proofed an order on your site, this drop-down list may be blank. Orders do not have to be completed, or sent, for the token to appear in this drop-down list. You can make changes to the style and test them using your token's information without saving.
Procedure:
Click the Test button to see a proof of the information stored in a token in the drop-down list in the style's right panel. If there are no errors (see the next step below for style troubleshooting), the proofing engine will render the order's information in a new window, named Preview Window, and present you with a GIF image (similar to what the user will see at the Proof step in the ordering process), along with links to press-ready EPS and PDF files that you can use to download a production file. (These links are discussed below under "Use the Style to Create Test Files.") You can also use the drop-down list of tokens to the left of the Test With Token button in the Preview Window to select another token for testing, or you can enter a token into the Token field if the token you want to test is not available in the drop-down list.
If you make a change to the style, you will need to use the Test button in the style. You cannot test the change from the Preview Window until after first testing from the style.
After you have saved the style, you can go back to the ordering session, refresh the proof and see the style's saved changes.
Basic Style Troubleshooting
If the typesetting engine detects a problem with your style, you will receive an error message. While this may be disconcerting, it simply means that there is probably a syntax error in your style. The most common errors are misplaced commas, parentheses and single quotes. For more information about this or for other error messages, please refer to Appendix A: Interpreting Python Error Messages. Errors can be caused if you used a word processing program, e.g. Microsoft Word, to edit your style (see About Style Editing Using a Text Editor above). If you continue to be stumped by an error in your style, contact PageDNA support for assistance.
Testing Typesetting Variations
Once satisfied with your first test, it is time to change the imprint information and simulate another set of conditions to make sure the blocks of type are setting correctly. To do this, use the "Edit Imprint Information" button below the proof to return to the Imprint step. Once there, make changes to your order and re-proof. For example, this time you may wish to change the number of Phones, Titles, Street Address lines, etc. If more changes are required, make them in the style as before, making sure you save your changes before reloading the webpage with the proof.
Once you are generally satisfied with the way everything is behaving and have saved your changes, it is time to move into the final phase of the style testing process.
Use the Style to Create Test Files
You don't have to send orders to get a production file. This can be done from the style.
If you create a test EPS file using the same text as in your original file, you will be able to overlay the test file on the original and detect subtle variations between your style and the original, especially in regard to font attributes.
Click the Test button to see a proof of the information stored in a token in the drop-down list in the style's right panel. If there are no errors , the proofing engine will render the order's information in a new window, named Preview Window, and present you with a GIF image (similar to what the user will see at the Proof step in the ordering process), along with links to press-ready EPS and PDF files that you can use to download a production file. You can also use the drop-down list of tokens to the left of the Test With Token button in the Preview Window to select another token for testing, or you can enter a token into the Token field if the token you want to test is not available in the drop-down list.
If you receive an error, please see "Basic Style Troubleshooting" above.
To download an EPS file to your local computer, right click the link for "Download EPS file." To download a PDF, right click the link for "Download PDF file."
The following is our recommended "Best Practice" for how to do "final-cut" testing using the test EPS or PDF file you have just downloaded:
Open Both the Original File and the Test File in Illustrator
Copy your test order and paste it to overlay on top of the original file.
Measure Variance
Record, in points, exactly how far each of the blocks needs to move to match the original. If a block needs to move 1 point to the left and 5.5 points up, you may wish to note the change as (-1, 5.5) to indicate the adjustment in relative terms that must be made to that block.
Also look at font sizes, leading, tracking values, and any other elements of your style.
Modify the Style
Change blocks and fonts as needed and save the style or use the Test button without saving if you are not sure you want to retain the change.
![]() | No Revert After Saving |
|---|---|
There is no option to revert a style after saving. The style's Revert button will revert the style to the last saved changes. Please make sure you want to retain a change before saving. |
Repeat as Necessary
Use the Test button in the style to check your changes, and repeat the process until everything matches perfectly.
Save the Style
Save the style after you have completed this process. Your style is now ready to go live or be tested by your customer. You may wish to closely monitor production files when items initially go live to ensure everything is working correctly.
Certain variable imprint items - such as letterhead and envelopes - are fairly large in physical size, but feature small imprint areas. Sometimes there are multiple imprint areas, scatted across different physical places on the document. For these items, showing the entire item in a size large enough allow the user to Proof the text would require a VERY large preview image, thereby requiring the user to search around for the imprint areas and also potentially slowing down the generation of the proof.
This problem lead to the creation of a technology called "Zoom Blocks". Zoom Blocks give you the ability to 'zoom in' on one or more areas of your item, enlarging only that area to a larger magnification, while showing the entire item as a reasonably-sized 'thumbnail' preview.
Depending on whether you are using the "List View" or the "Code View", the procedure for adding zoom blocks is different. However, the underlying concepts are the same, let's cover that first. By default "List View" is selected when you go to the "Preview" tab of Style Editor Gold.
First, determine which areas on your item you wish to show as a Zoom Block. There are two ways you can define zoom areas: 1) by block name or 2) by physical location on the document.
Using the 'block name' method is easiest - you simply choose which Blocks (as defined in the blocks section of Style Editor Gold) you wish to show enlarged, and note the Block name as defined in the style.
Using the 'location on the document' method is slightly more complex, but provides you with the ability to create Zoom Images spanning multiple blocks, which may be useful. This method uses what is called "Dims", short for dimensions of the zoom area. To use this method, you need to record the four measurements in points that define the "Dims":
Distance from left edge of item to left edge of Zoom
Distance from bottom edge of item to bottom edge of Zoom
Width of Zoom Block to display (use a reasonable maximum width)
Height of Zoom Block to display
To have more control over the display to the user, you can add some HTML with 'place holders' in the HTML that represent your zoom blocks. The examples show you how to use this technique.
![]() | Tip: Remember to escape % signs |
|---|---|
If your HTML code contains % signs, for instance you want to set a width, like ' width="90%" ' you need to double the % sign, like so: ' width="90%%" ' this is because the % sign is "meaningful" to our form processing system. This is explained in Using Percentage (%) Symbol. So a literal % sign needs to be doubled, but the % sign in href="%(p.zoom1_src)s" is a processing instruction. Note this tip applies to both, the SEG way and the VSE way. |
Procedure 19.1. How to Add Zoom Blocks to your Item, the List View way
Define Zoom Block in 'Preview' Section of Style
Go to the "Preview" section of VSE (or SEG) and you should see a screen like the this (note the "Code View | List View" at the top left):
Now fill out the desired values. If you just want a zoomed preview of a block, select the block from the block list. Then set the scale, click "Apply" and you are done. But remember to "Save" when your style is production ready
If you want to zoom in on another area, use the "Dims" and put the values in their appropriate boxes, from left to right: bottom-left-x, bottom-left-y, w, h of the zoom area you want, then click "Apply".
Create HTML Section
On the "Preview" section of VSE, click the "edit" link in the row of the "html", usually in the top row of the list above the form. This will open a window like the following:
Remember that you must check the "Enable" check box. Then type your HTML in the text box. As you see in the example you refer to the previews (zoom blocks) with a reference: %(p.zoom1_src)s
So the recipe for the reference is: "%(p.zoom_block_name_src)s", thus you replace the bold with your zoom block name, i.e. zoom1, zoom2 or normal.
Finally save this to the working copy by clicking "Apply".
Procedure 19.2. How to Add Zoom Blocks to your Item, the Code View way
Define Zoom Block in 'Preview' Section of Style
To add a zoom block in the Code View you will now need to click on the "Code View" link on the 'Preview' section of your style file. Here is a regular preview section, the way it looks in Code View, (note that yours will vary, but should look similar), not featuring any Zoom Blocks:
{
'normal': {
'use_magick': 1,
'combine_scale': 1.0,
'combine': '/mnt/sdb1/inet/www/clients/acme/con/acme_lh.gif',
'scale': 0.5,
'combine_offset': (0.0, 0.0),
},
}
If using the 'block name' method, you will need to add the following bit of code to the preview section, marked in bold. Please note that - as in all coding examples - formatting matters greatly. If you leave out a parenthesis or a comma, your code will likely cause a fatal error.
{
'normal': {
'use_magick': 1,
'combine_scale': 1.0,
'combine': '/mnt/sdb1/inet/www/clients/acme/con/acme_lh.gif',
'scale': 0.5,
'combine_offset': (0.0, 0.0),
},
'zoom1': {
'scale': 1.5,
'block': 'AddrPhoneBlock',
'use_magick': 1,
},
}
In this example, we are 'Zooming' onto the block named "AddrPhoneBlock", and have chosen to enlarge this Block to 150% size (scale is set to 1.5). This Zoom Block is named "zoom1" - a detail which we will need to reference in a moment.
If you are using the 'location on document' method, your Zoom block definition will look a little bit different.
{
'normal': {
'use_magick': 1,
'combine_scale': 1.0,
'combine': '/mnt/sdb1/inet/www/clients/acme/con/acme_lh.gif',
'scale': 0.5,
'combine_offset': (0.0, 0.0),
},
'zoom1': {
'scale': 1,
'dims': (0, 16, 612, 35),
'use_magick': 1,
},
}
In the above sample, we are creating a Zoom Block named "zoom1" which starts in the lower left corner of the document and spans 612 points wide by 35 points tall. The scale is set to 1, to show the text in actual size.
Create HTML Section in 'Preview' Section of Style
Now that your Zoom Blocks have been defined, you need to display them to the user. This is done by adding HTML to your preview. The following example shows the normal proof and the zoom1 block displayed in a nice HTML format. The following example shows the 'Block Name' method as shown in the example above, although this same code would work for the 'location on document' method.
{
'normal': {
'use_magick': 1,
'combine_scale': 1.0,
'combine': '/mnt/sdb1/inet/www/clients/acme/con/acme_lh.gif',
'scale': 0.5,
'combine_offset': (0.0, 0.0),
},
'zoom1': {
'scale': 1.5,
'block': 'AddrPhoneBlock',
'use_magick': 1,
},
'html': '''\
<table>
<tr>
<td align=left><font face="Arial"><B>Imprint Info:</B><BR>
<img src="%(p.zoom1_src)s">
</td></tr>
<tr><td align=center>
<font face="Arial"><B>Product Thumbnail:</B><BR>
<img src="%(p.normal_src)s"></font></td></tr>
</table>
''',
}
This example makes a simple table, with the Imprint Info shown first (your Zoom block), followed by the full-sized image preview. Note that the word 'zoom1' is reference in the Image tag for the "Imprint Info" image - this, of course, directly refers to the name you gave your Zoom Block in the previous step.
If you need multiple Zoom Blocks for your item, simply define them as you did above, but give the zoom blocks a unique name (ie, 'zoom2'). Then make sure to add a new image into your HTML section so that this new zoom block is shown to the user when Proofing.
Table of Contents
Following is a guide to commands available within Styles.
ANGLE rotates a block at any angle. Note: previous versions of ANGLE could only rotate in 90 degree increments, this limitation is now gone. First, create a regular block(When using VSE, Block Logic must be enabled. This setting to can be found in the Page Window of the Blocks tab, or in the Other tab of your style. Enter your code into the PreBlocks or PostBlocks tab.):
WebBlock = DWIMBLOCK([LEFT,
F2, card_www
], (120, 120), (LEFT, BOTTOM))
Now surround this block with the bold text below, indicating how many degrees you want to rotate the block:
WebBlock = ANGLE(DWIMBLOCK([LEFT, F2, card_www ], (120, 120), (LEFT, BOTTOM)), 180)
The example above would rotate the block all the way around, upside down.
If you need help precisely aligning this rotated block, you may add the anchor parameters to specify how to align the rotated block in relation to the not rotated block. In the following example, we've added this parameter, specifying that the rotated block should align with the point defined by the lower right corner of the unrotated the block.
WebBlock = ANGLE(DWIMBLOCK([LEFT,
F2, card_www
], (120, 120), (LEFT, BOTTOM)), 180, (RIGHT, BOTTOM))
For a block with a rotation of 90 degree (RIGHT, BOTTOM), as in the example above, one corner of the rotated block will be exactly at the same point as the bottom right corner of the none-rotated block. For rotations not a multiple 90 degrees, the alignment corner of the rotated block is defined by outer the "bounding" rectangle of the rotated box. See illustration, 75 degree (LEFT, TOP).
Lastly, it is worth noting that you have the option of rotating the preview image itself, with or without rotated blocks. To rotate the preview image shown to the user when proofing, simply add:
'rotate': 270,
to the 'normal' combine image parameters in the 'Preview' tab of the style. This may be useful if the majority of the text on an item is 'rotated' and you wish to show the user a proof that they can read without doing a hand-stand on their desk.
| Argument | Description | Default |
|---|---|---|
| block | a block variable, or DWIMBLOCK definition. | |
| angle | what angle to rotate the block in degrees | |
| anchor | what point in the block to align the rotated block with. | (LEFT, BOTTOM) |
(deprecated) Use ANGLE(BLOCK(...), 90)
| Argument | Description | Default |
|---|---|---|
| lines | List of LINEs (from DWIMLINES or LINES) | |
| origin | (x, y) origin | |
| angle | Angle in multiple of 90 degrees. 0 points the baseline to the left, 90 points it up, 180 points it to the right (with text upside down) and 270 points baseline down. | |
| hg | Horizontal growth direction | LEFT |
| vg | Vertical growth direction | BOTTOM |
| mw | Maxwidth in points, 0 = use page margin | 0 |
| layer | layer of block. Positive numbers appear above and obscure layers with layer=0, while negative numbers fall below and are obscured by blocks with layer=0. | 0 |
ANGLEWORD rotates a word object at any angle. First, create a word object (like WORD or EPSWORD):
MyWord = WORD('The text for my word', F1)
Now surround this word object with the bold text below, indicating how many degrees you want to rotate the block:
MyWord = ANGLEWORD(WORD('The text for my word', F1), 180)
The example above would rotate the word object all the way around, upside down.
An ANGLEWORD can be used inside a DWIMBLOCK like this:
Block = DWIMBLOCK([LEFT,
'Our logo:', ANGLE(EPSWORD('./con/mylogo.eps', xscale=1.0, yscale=1.0), 5)
], (120, 120), (LEFT, BOTTOM))
Lastly, it is worth noting that you have the option of rotating the preview image itself, with or without rotated blocks. To rotate the preview image shown to the user when proofing, simply add:
'rotate': 270,
to the 'normal' combine image parameters in the 'Preview' tab of the style. This may be useful if the majority of the text on an item is 'rotated' and you wish to show the user a proof that they can read without doing a hand-stand on their desk.
| Argument | Description | Default |
|---|---|---|
| word | a word object variable, or word object definition. | |
| angle | what angle to rotate the word object in degrees |
Draws a border of variable color and width around and object, most commonly and EPSWORD (embedded EPS file). Example:
BORDER(EPSWORD('con/your_file.eps'), 3, BLACK)
In the above example, the EPS file is wrapped with a 3 point black border. The new code added is shown in bold. If you wish to a color other than black, you can refer to any color defined in the Fonts tab. Let's say you have the following color defined in the 'Fonts' tab of the Style Editor:
C1 = CUSTOMCOLOR('PANTONE 547 CVC', 0.95, 0.48, 0.43, 0.45, tint=1)
You could then refer to this color for your border as:
BORDER(EPSWORD('con/your_file.eps'), 3, C1)
It is also possible to have multiple borders around an EPSWORD, by nesting BORDER commands inside one another. The example below will add 2 borders around your object. One line as a 1 point keyline (set in BLACK), and the second as a 3 point rule 2 points away from the 1 point keyline (in color 'C1'). Mixing and matching colors and line weights is up to your imagination.
BORDER(BORDER(EPSWORD('/con/your_file.eps'), 1, BLACK, 0), 3, C1, 2)
Let's look at the above nested borders example from the inside-out. First, we wrap the EPSWORD with the black border with 1 point width and 0 points of padding:
BORDER(BORDER(EPSWORD('/con/your_file.eps'), 1, BLACK, 0), 3, C1, 2)
Next, we wrap the EPSWORD and inner border with the outer border, set in color C1 in 3 points with 2 points of padding (space inside the border):
BORDER(BORDER(EPSWORD('/con/your_file.eps'), 1, BLACK, 0), 3, C1, 2)
| Argument | Description | Default |
|---|---|---|
| word | Word, such as EPSWORD or CAPWORD, to put border around. | |
| linewidth | Linewidth in points | |
| color | Color object | |
| padding | Space inside the border in points | 0 |
BULLETWRAP is used inside a block (DWIMBLOCK) and converts lists of information (for example, a multi-line text input) into "bulleted lines" in a block. You simply add the BULLETWRAP command before the text that needs to be bulleted. NOWRAP turns this command off.
Here are some examples:
# This example formats var1 as one bullet per line. # var1 is a string which could come from a textarea on a form. # Every line feed in var1 is converted to a bullet. # if any line is longer than 80 points, it will be wrapped to the # following line. # The bullet will be ' \225 ', formatted using the font F1 Block1 = DWIMBLOCK([F1, BULLETWRAP, var1, NOWRAP, ], (100.5,81.7), (LEFT,TOP_BASELINE), (140, 0))
# This example is the same as above, except that an " X "
# character, will be used as the bullet.
# The bullet will use the font F1
# The var1 text (to be bulleted) will use the font F2
Block1 = DWIMBLOCK([F1, BULLETWRAP(' X '), F2, var1, NOWRAP,
], (100.5,81.7), (LEFT,TOP_BASELINE), (140, 0))
Lastly, here is a more complex example. The user - as before - has entered features into a multi-line text box (e.g., in a 'generic gold' form) and the system is to put each line on its own bulleted line. The bullet is a custom EPS file in this case.
Here is the code to make the above happen - contact support if you need help with any of this or another scenario.
WHITE = PROCESSCOLOR('White', 0, 0, 0, 0)
FeaturesListing = DWIMBLOCK([
LEFT, F5,
BULLETWRAP(BORDER(EPSWORD('con/yellowdot.eps', xscale=1, yscale=1),
0, WHITE, padding=(0,5,5,1))), pc1_features,
], (10,10), (LEFT,BOTTOM), (232,250))
| Argument | Description | Default |
|---|---|---|
| bullet | Symbol to use for bullet. Defaults to standard bullet dot. | \225 |
EmailWord = CAPWORD(card_email, F1, caps='lower')
| Argument | Description | Default |
|---|---|---|
| t | text - a string | |
| f | the FONT | |
| caps | Style of capitalization. See CASE for more information. | upper |
| shift | Baseline shift of word in points. Negative numbers shift word below baseline, positive numbers shift word above baseline. | 0 |
The CASE command lets you switch the type CASE used within a font. This is commonly used to either force upper or lower case on a particular bit of a text in a style file, regardless of what case the user entered on the form.
Note that the 'capwords' mode - which forces capitalization for the first letter in each word - is dangerous to use on Proper Names, as it would turn the last name 'McDonald' into 'Mcdonald', which may cause client concern. For the purposes of dealing with proper names starting with 'Mc', use the 'mccapwords' mode. This mode WILL successfully handle the 'McDonald' example, but note it will still fail for names such as 'VanRossum', which would be converted to 'Vanrossum'.
Another common scenario involves needing everything upper-cased EXCEPT the lower-cased 'c' in a name with a 'Mc' prefix, ie, "McDONALD". To accomplish this, use the 'McUPPER' case mode.
NOTE: If you are trying to make a section of text "small caps", such that all of the letters are capitalized, with the first letter in each word slightly higher than the rest, then you are advised to check out the SCFONT command, which handles this with ease.
NOTE: The CASE mode needs to be encased in a single quote, unless it is the mode None which switches CASE off, reverting to displaying text as entered by the user.
NameBlock = DWIMBLOCK([F4, CENTER,
name_first, ' ', name_last,
CASE('upper'), card_title1, NEWLINE,
card_title2, NEWLINE,
CASE('lower'), card_email, VSPACER(10),
CASE(None), card_division], (126,75), (CENTER, TOP_BASELINE))
# this example shows CASE being applied to upper-case the title lines, and
# then used to lower-case the Email address. Lastly, CASE is returned to
# the default of None for the card_division field.
| Argument | Description | Default |
|---|---|---|
| casemode |
| None |
note: If you want to join a list of things with a separator, use WORDJOIN. The CHAIN command implements a chained JOIN3. For instance, the following fragments are identical:
JOIN3(Phone1Word, bullet2, JOIN3(Phone2Word, bullet2, JOIN3(Phone3Word, bullet2, Phone4Word)))
CHAIN(Phone1Word, bullet2, Phone2Word, bullet2, Phone3Word, bullet2, Phone4Word)
| Argument | Description | Default |
|---|---|---|
| bit1 | some content (ie, a string, WORD or list of strings and WORDs) | |
| seperator1 | content that will separate the bits | |
| bit2 | another bit of content | |
| seperator2 | another seperator (you can repeat the bit, seperator as many times as you like.) | |
| bitN | the last bit of content |
Barcode word using the Code 128 symbology. The text of the barcode will be shown underneath the barcode. Code 128 uses three alphabets; one for letters, one for ascii codes, and one for sets of two digits. The alphabet is switched for maximum compactness automatically. The barcode can be sized using the width and height parameters.
| Argument | Description | Default |
|---|---|---|
| data | Data to be encoded in word | |
| width | Rescale barcode to be width point wide | None |
| height | Reduce line height to to be encoded in word | None |
| scalefactor | Scale barcode by given factor | 1.0 |
| color | COLOR object | None |
| backgroundcolor | COLOR object | None |
Barcode word using the Code 39 symbology. The text of the barcode will be shown underneath the barcode. The barcode can be sized using the width and height parameters.
| Argument | Description | Default |
|---|---|---|
| data | Data to be encoded in word | |
| width | Rescale barcode to be width point wide | None |
| height | Reduce line height to to be encoded in word | None |
| scalefactor | Scale barcode by given factor | 1.0 |
| color | COLOR object | None |
| backgroundcolor | COLOR object | None |
Used inside DWIMBLOCK. Defines a column, which is like a TAB but the minimum space needed is used.
Block1 = DWIMBLOCK([F1, 'Fax: ', COL, '800-992-5555', NEWLINE, 'Cell: ', COL, '542-123-6543', NEWLINE, ], (30, 92), (LEFT, BOTTOM))
In this example, the phone labels are left aligned, and the phone numbers are also left aligned. That is, the first character of the each phone number starts at the same position. This is because they are both after the first COL in a line. The 1st COL in all lines in the block will line up, as will the second, etc.
The COL can be pictured as a variable SPACER. The amount of space will always be 0 for one of the lines. Therefore it is typical to add some fixed white space after the labels when using COL.
| Argument | Description | Default |
|---|---|---|
| maxgap | Limits the space that a COL will insert. | 0 |
COND('m') stops the execution of a style immediately, returns the user to the Imprint Form, and displays the message in 'm' to the user. This is most commonly used within a check for the length of a field on a product and is used to show the user an error if the field is too long.
if F1.stringwidth(card_title1) > (200):
COND('Title 1 is too long. Please shorten this field')
# this example shows card_title1 being measured for its length
# using font F1. If longer than 200 points, the user is shown
# the error message. Note that indentation matters with 'if'
# statements - the conditional must be indented two spaces,
# as shown above.
| Argument | Description | Default |
|---|---|---|
| m | message to show user |
Specifies a color in CMYK, eg.
C1 = CUSTOMCOLOR('Sky Blue', .8, .2, 0, .2, 1)
A font using this color would be defined as follows:
F1 = FONT('Times-Bold', 8, 2, 0, color=C1)
The CUSTOMCOLOR's name is used to match up with colors in EPS files - if the color is Pantone, refer to it by the Pantone name, such as 'PANTONE 451 CV'. Valid values for the parameters in a custom color definition are between 0 to 1.
If an ink parameter is used, the CMYK values in there will be used for previewing. This is useful when you wish to show users one color, but export another to manufacturing. For example, the color defined below would show a brown hue to the user, but send BLACK in the EPS file:
C1 = CUSTOMCOLOR('Brown', 0, 0, 0, 1, ink=[0.45, 0.49, 0.72, 0.21])
In any case the generated EPS will export the color as a spot color, using the cmyk components and the color name. BLACK, YELLOW, MAGENTA, and CYAN are predefined process colors.
The CUSTOMCOLOR command should be used for spot colors. If using the Imposition system, this color will separate out on its own plate. If the color should be broken out onto different plate, the PROCESSCOLOR "PROCESSCOLOR" command should be used.
| Argument | Description | Default |
|---|---|---|
| name | name of the color | |
| c | cyan component | |
| m | magenta component | |
| y | yellow component | |
| k | black component | |
| tint | tint (1 = 100% 0 = 0%) | 1 |
| ink | [c, m, y, k] | None |
Barcode word using the DATAMATRIX 2-D symbology. The barcode can be sized using the scalefactor parameter. The size of the barcode cannot be pre-calculated and must be passed in. If the size is incorrect, then alignment (especially right alignment) of a block may be incorrect.
| Argument | Description | Default |
|---|---|---|
| data | Data to be encoded in word | |
| size | size in points, eg: size=100 | |
| scalefactor | Scale barcode by given factor | 1.0 |
| color | COLOR object | None |
| backgroundcolor | COLOR object | None |
The "Do-What-I-Mean" block. This is the standard command used to set type or graphical elements on a variable printed product.
For DWIMBLOCK processing without display, see DWIMLINES.
Note: In the sample below, the lines starting with a pound sign ('#') are comments are are ignored by VIPER. You can add comments to your own code - in this case, they are included to give you an idea of why we are using each command:
NameBlock = DWIMBLOCK([ # left justify the lines within the block. LEFT, # use font F1, show first name, then a blank space ' ', # and then show last name, then wrap to newline: F1, name_first, ' ', name_last, NEWLINE, # now switch to F2, show a variable and newline F2, card_title1, NEWLINE, # again, show a variable and newline. card_title2, NEWLINE, ], (126, 15), # position - required (LEFT, BOTTOM), # anchor - required (250, 0), # extent - optional (250 max width, no max height) layer=-1 # layer - optional )
Here is that block without all the comments, as you might encounter it during routine style building. Note that the formatting inside the block contents does not affect the block layout on the printed piece. You can format the inside of the block in any fashion that makes it easier for you to read/edit:
NameBlock = DWIMBLOCK([LEFT, F1, name_first, ' ', name_last, NEWLINE, F2, card_title1, NEWLINE, card_title2 ], (126, 15), (LEFT, BOTTOM), (250, 0), layer=-1)
The above example is a block of text elements that are LEFT justified inside the block. The block itself is anchored 126 points from the left side of the product to the LEFT of the block, and 15 points from the bottom of the product to the BOTTOM of the block - from which it will grow upward as additional lines are added. The block has a maximum width of 250 points, but no vertical high restriction is in place.
Some behavioral notes:
- NEWLINE wil not cause the insertion of a blank line if there is nothing on that line.
- Justification does not have to the same for the entire block but it will not change withina line. ie, given: LEFT, 'left ', RIGHT, 'right', NEWLINE this will show " left right" not "left right"
| Argument | Description | Default |
|---|---|---|
| args | list of LINES or WORDS or FONTS or strings or lists opr variables or justifications or NEWLINES | |
| origin | origin | |
| anchor | (LEFT|RIGHT|CENTER, TOP|TOP_BASELINE|MIDDLE|BOTTOM) | (LEFT,TOP_BASELINE) |
| extent | maximum width, height of the block in points. | unlimited |
| tabs | list of horizontal point offests that TAB will go to | [0, 36, 72, ...] |
| maxlines | number of lines allowed before a COND is raised | unlimited |
| maxmsg | what will get passed in the COND | "too many lines" |
| layer | block layer (depth inside file) - see stacking layers for more info and info on special layers | -1 (default). Other examples: -2, PREVIEW_LAYER, OUTPUT_LAYER |
Use DWIMBLOCK processing algorithm but return a list of lines. (Note that this means you use the result of a DWIMLINES directly instead of the lines attribute of a DWIMBLOCK.) Unlike DWIMBLOCK, does not get displayed.
The lines can be usefully counted (for logic), passed to ANGLEBLOCK, or used in a DWIMBLOCK. The arguments to DWIMLINES should be just the text you want to process; there is no anchor argument.
| Argument | Description | Default |
|---|---|---|
| args | args like DWIMBLOCK uses | |
| tabs | tabstops | every half inch |
| extent | (width, height) in points | unlimited |
Barcode word using the EAN 13 symbology also known as ISBN. The text of the barcode will be shown underneath the barcode. The data may be 12 or 13 digits, optionally followed by a space and 5 more digits. The barcode can be sized using the width and height parameters.
| Argument | Description | Default |
|---|---|---|
| data | Data to be encoded in word | |
| width | Rescale barcode to be width point wide | None |
| height | Reduce line height to to be encoded in word | None |
| scalefactor | Scale barcode by given factor | 1.0 |
| color | COLOR object | None |
| backgroundcolor | COLOR object | None |
EPSWORD is used to display either a fixed or a dynamic graphic image (of EPS format) on a product. EPSWORDS are used in blocks, and have many settings that can be used to help your images display correctly.
Static Images
Below is a block with a single hard-coded EPSWORD object. The content referenced in the EPSWORD is EPS file would have been previously uploaded using the "File Uploader" menu item:
BulletBlock = DWIMBLOCK([EPSWORD('./con/bullet_black.eps', xscale=1, yscale=1)],
(120, 85), (LEFT, BOTTOM), layer=-1)
The EPS file in the example above - "bullet_black.eps" - would be displayed at the same size it was uploaded - this is because the optional xscale and yscale parameters are set to 1 - for 100 percent scale. Changing either of these numbers would shrink or enlarge the image from its native size.
In the above example, our DWIMBLOCK is anchored in the LEFT, BOTTOM corner at 120 points over and 85 points up from the lower left corner of the product.
Dynamic Images
Images can also be dynamic - for example you can allow users to upload a photo from an item form. Control over image upload settings is configured in the Item Form itself on a field-by-field basis.
Once the image is passed to the style we need to choose how to display the image. We reference the "field name" from the Item Form - the example below is displaying an image named "bc_photo":
AgentPhotoBlock = DWIMBLOCK([EPSWORD(photo, resize=(240,320),aspect=1)],
(120, 85), (LEFT, BOTTOM), layer=-1)
We have the photo anchored in the lower left corner, and have activated uniform aspect scaling by adding the 'aspect=1' parameter. Uniform scaling is one of several techniques you can learn in our Typography Exceptions documentation.
| Argument | Description | Default |
|---|---|---|
| file | the path to the EPS file | |
| rot | amount to rotate the EPS. Only right angles are supported | 0 |
| xscale | scaling in x direction | 1 |
| yscale | scaling in y direction | 1 |
| resize | (width, height). Resizes (grows or shrinks) EPSWORD to fit within given point dimensions. Override xscale and yscale, if given. | None |
| aspect | Should resize preserve the aspect? | 1 |
F1 = FONT('Helvetica', 12, 2, qtracking=50)
| Argument | Description | Default |
|---|---|---|
| fontname | i.e. "Helvetica-Bold" | |
| pointsize | PostScript point size | |
| leading | space above line | 1 |
| tracking | space between chars, in points or em units. | 0 |
| vscale | scaling of the font | 1 |
| hscale | scaling of the font | 1 |
| qtracking | space between chars, in 1/1000 em | 0 |
| color | COLOR object | None |
| underline | If set to 1, will underline using font's underline info. If set to (distance below baseline, line weight) | 0 |
| shift | baseline shift, in points | 0 |
Draws a GLYPH using the glyph name. Allows inclusion of glyphs that are not mapped to characters.
| Argument | Description | Default |
|---|---|---|
| glyphname | PostScript glyph name | |
| font | font object | |
| shift | baseline shift | 0 |
Returns the y-coord between block1 and block2. This is very useful for keeping a block between two other blocks. The bottom of the uppermost block and the top (as defined by top baseline + top line height, not the same as TOP) lowermost blocks is used.
NameBlock = DWIMBLOCK(...)
PhoneBlock = DWIMBLOCK(...)
AddressBlock = DWIMBLOCK([
...
], (30, HCENTER(NameBlock, PhoneBlock)), (LEFT, CENTER))
As this example shows, in normal usage of HCENTER, one defines the top and bottom blocks first, then uses HCENTER to calculate the Y of the middle block, and finally uses CENTER vertical growth direction.
| Argument | Description | Default |
|---|---|---|
| block1 | A block reference, e.g. NameBlock | |
| block2 | The second block |
IF looks at its arguments (it can take any number of arguments) and if any of them are blank, it returns an empty tuple, otherwise returns all of its arguments. So IF(' ', name_last) will return () if name_last is blank ,and therefore not show the space, or (' ', name_last) if name_last is defined. You can include NEWLINE in an IF safely.
IFALL is an alias for IF, that describes the purpose better. IF is still the common usage.
| Argument | Description | Default |
|---|---|---|
| args | it takes any number of arguments. |
IFSET looks at its first argument; if that is true then the second argument is returned, otherwise the third argument (or nothing) is returned.
IFSET is used to conditionally output elements based on any condition. By comparison, IF can only be used to conditionally output elements based on those elements.
Block = DWIMBLOCK([...,
IFSET(include_www, ['WWW: ', card_www]), NEWLINE,
], ...)
In this example, the web address is shown when the include_www is set. It is common to use lists to include more than one element.
| Argument | Description | Default |
|---|---|---|
| test | an expression | |
| then_stuff | elements included when test is true | |
| else_stuff | elements included when test is not true | nothing |
JOIN3 is a command used to insert a 'bridge element' between two fields if they both exist on a particular imprint. If only one of the items exists, it is displayed without the middle 'bridge element'. This saves you adding custom logic to test if one or the other field exists.
For example, if you wished to show a bullet between two phones, but only if both phones were present, you might use JOIN3 as follows:
JOIN3(Phone1Word, bullet2, Phone2Word)
If Phone1Word and Phone2Word are both present, the bullet will appear between them. If only one of the Phones is entered for the imprint, it will appear alone - without a bullet. You can nest JOIN3's inside each other to join more than 2 pieces. We've used indentation below to help show the nesting of a complex example:
JOIN3(Phone1Word,
bullet2,
JOIN3(
Phone2Word,
bullet2,
JOIN3(
Phone3Word,
bullet2,
Phone4Word
)
)
)
...however, please note that it is far easier to use the CHAIN command in these more cases. See our CHAIN documentation for more on this extension of JOIN3.
| Argument | Description | Default |
|---|---|---|
| leftbit | some content (ie, a string, WORD or list of strings and WORDs) | |
| seperator | content that will separate the leftbit and rightbit should they both be visible | |
| rightbit | some content (ie, a string, WORD or list of strings and WORDs) |
lineline = LINELINE(6, .5, 3) When used in a DWIMBLOCK, draws a horizontal line 3 points above the baseline, with 6 points of space above the line. The linewidth (.5 points wide) is not added to the height calculations. The line's length is determined by the contents of the block.
LineBlock = DWIMBLOCK([CENTER, "text above line", NEWLINE, LINELINE(6, .5, 3), "text that is below the line", NEWLINE, ], (126, 72), (CENTER, MIDDLE))
In this example the line will be longer that the text above the line, and exactly as long as the text below the line.
TextAndLineBlock = DWIMBLOCK([CENTER, "text above line", NEWLINE, LINELINE(6, .5, 3), "text that is below the line", NEWLINE, ], (126, 72), (CENTER, MIDDLE))
When you need to make a line without accompanying text, use the width= parameter:
LineOnlyBlock = DWIMBLOCK([ LINELINE(6, .5, 3, width=100), ], (126, 72), (CENTER, MIDDLE))
Here's an example where the line is set in a color:
LineBlock = DWIMBLOCK([
LINELINE(6, 1, 3,width=110, color=C1)],
(126,72),(LEFT,BOTTOM))
| Argument | Description | Default |
|---|---|---|
| heightabove | Height from the line to the line above | |
| linewidth | width of the stoke. The length of the line is determined by the BLOCK's maximum width, or the width parameter (unless width is passed). | |
| heightbelow | height below the line | |
| leftextra | extra length on the left side | 0 |
| rightextra | extra length on the right side | 0 |
| width | When passed, sets a fixed length for the line. When not passed, the length of the line is determined by the length of the block. | None |
| align | Determines alignment for a fixed-length line. | None |
| color | color to draw the line in (eg BLACK, CYAN or CUSTOMCOLOR) | None |
Makes a string with embedded newline characters into a series of string, NEWLINE, string, NEWLINE, etc. If wrap is passed, then the text is also wrapped at the given point size and the font param is required. Note that existing line feeds in the "text" parameter are ignored unless wrap_lf=1 is set.
If maxheight is passed, the font size is reduced until the lines all fit. This behavior is different than the maxheight of a block, which vertically shrinks the lines to fit.
| Argument | Description | Default |
|---|---|---|
| text | ||
| font | None | |
| align | None | |
| wrap | None | |
| newline | NEWLINE | |
| maxheight | None | |
| wrap_lf | Use existing line feeds in file before wrapping | 0 |
LINEWRAP is a block command which tells the system to allow text to wrap to multiple lines based on a block max width setting. This command works exactly like WRAP with the exception that LINEWRAP looks for and honors user input hard returns, making it the ideal command to use for multi-line input situations.
The type will keep wrapping as long as the copy does not fit into a single line width and the system can find a break point. The type will not reduce in size unless limited by the overall height of the block as well as the width. Break points are set as space bars.
Important tip for testing - make sure that all sample text uses space bars or the type will not wrap to multiple lines.
To restrict the type size set a block max height, the system will wrap to as many lines as needed and the max height will force the type to reduce to fit in the vertical space allowed.
The LINEWRAP command can take a series of arguments which will do things like add space between paragraphs or auto indent for new lines. e.g LINEWRAP(newline_indent=SPACER(5)) every new line or hard return will force a spacer (indent) of 5 points to be used.
F1 = MIXEDFONT('AGaramond-Regular', 8.6, 'AGaramondExp-Regular', 9, charset="0123456789@")
# font F1, as defined above, would show all numbers (plus the '@' symbol)
# in Garamond Expert Regular, 9 points, whereas all other characters would
# be displayed in Garamond Regular, 8.6 points.
MIXEDFONT lets you mix fonts based on a set of characters. This is a commonly used feature, used mostly to show numbers in a different font, although this could also be used for typographically correct small caps - as well as for other applications. Please note the example below, showing how to indicate leading and tracking when defining a MIXEDFONT:
F1 = MIXEDFONT('BentonGothic-Regular', 6, 'BentonGothic-RegularItalic', 7, charset = '1234567890', leading=3, tracking=0)
Note that some special characters need to be quoted using their octal equivalent values. For example, if you wished to have the 'trademark' symbol super-scripted automatically, your MIXEDFONT would look like this:
F3 = MIXEDFONT('AGaramond-Regular', 9.0, 'AGaramond-Regular', 6, leading=1, charset='\231', shift=2)
The special character '\231' represents the trademark symbol. Other common codes are bullet ('\225'), copyright ('\251'), and registered ('\256'),.
| Argument | Description | Default |
|---|---|---|
| font1 | i.e. "Helvetica-Bold" | |
| size1 | PostScript point size | |
| font2 | font for chars in charset | |
| size2 | size for chars in charset | |
| charset | chars in this string use font2 and size2. NUMBERS and LOWERCASE are applicable constants | NUMBERS |
| pattern | Supercedes charset; provide a regular expression to match groups to characters to show in the second font. | None |
| leading | space above line | 1 |
| tracking | space between chars | 0 |
| qtracking | space between chars, in 1/1000 em | 0 |
| color | COLOR object | None |
| vscale | scaling of the font | 1 |
| hscale | scaling of the font | 1 |
| shift | Baseline shift for font2 | 0 |
F1 = MMFONT('Helvetica', 12, [axis value, axis value,...]) The axis values is a list of design values that one sees in the font menu. e.g.: F1 = MMFONT('MyriadMM', 12, [375, 425]) #new way
| Argument | Description | Default |
|---|---|---|
| fontname | i.e. "MyriadMM" | |
| pointsize | PostScript point size | |
| axis values | axis arguments | |
| leading | space above line | 1 |
| tracking | space between chars | 0 |
| qtracking | space between chars, in 1/1000 em | 0 |
| color | COLOR object | None |
Used inside DWIMBLOCK. Signals the end of a line. A NEWLINE that does not have any elements with content are ignored. There are no arguments, this is a constant.
| Argument | Description | Default |
|---|---|---|
| fontname | ||
| pointsize | ||
| leading | 1 | |
| tracking | 0 | |
| color | None | |
| kern | 0 | |
| qtracking | None |
Used inside DWIMBLOCK. Turns any currently-enabled special wrapping modes off. There are no arguments, this is a constant. For more information, see the following documentation pages: Word Wrapping - Overview, Word Wrapping - Wrap and Indent Subsequent Lines, and WRAP command
\ Formats numbers using a thousands separator and the given number of decimal points.
NUMFORMAT(9999.9, ',', 2)
Strings can be used, or variables that hold strings:
NUMFORMAT('1279.99', ',', 2)
Currency symbols can be added outside the format function. The digits parameter does not have to be passed, and if it isn't then the number of digits is not changed:
'$', NUMFORMAT('1279', ',')
| Argument | Description | Default |
|---|---|---|
| number | The string or numeric value to format | |
| thousands | Thousands separator, if passed will be inserted every three digits. | '' |
| digits | Number of decimal digits | '' |
NUPBLOCK takes a list of epsfiles and lays them out on a grid. Example:
block = NUPBLOCK(epsfile, (3,4), (0,0), (252,144))
This makes a block of 12 cells, 3 horizontally and 4 vertically. The lower left of the cells is at 0,0. The size of the cells is 252,144.
| Argument | Description | Default |
|---|---|---|
| epsfiles | list of filenames which are imposed in the cells | |
| (n, m) | number of cells to lay out horizontally (n) by vertically (m). | |
| (llx,lly) | lower left coordinate for the blocks | |
| card_size | size of the cells | (252,144) |
| gutters | amount of space between every cell | 0 |
| backside | if true, re-arranges the list of epsfiles for backprinting. Only supported down-reading work-and-turn | 0 |
| reading | determines how the cells are filled up. "d"=bottom to top, left to right, "l"=left-to-right, top-to-bottom | d |
| border | if true, a border will be drawn around the cells | 0 |
Word specialized to build a phone number out of some inputs. The phone layouts are handled in the WORDS tab of your Style. The PHONEWORD command builds the phone number together from the little bits and pieces that people enter in the Imprint page. For a North American phone number, the area code is a bit called ph11. The next three digits are ph12. The last four digits are ph13. The PHONEWORD command puts the bits together into one logical unit. The PHONEWORD command first defines the font of the phone number. The PHONEWORD command also defines all the bits of the phone number and lays out those elements in the format of the text string at the end. Each little "bit" replaces the stars "*" at the end of the PHONEWORD command. Example:
Phone1Word = PHONEWORD(F5, (ph11, ph12, ph13, ph1_ext_lbl, ph14), '*-*-* * *')
F5 is the font used for the phone number. This overrides any fonts defined in the blocks section of the style.
ph11 represents the area code; it will replace the first star in the layout string '*-*-* * *'
ph12 represents the phone prefix; it will replace the second star in the layout string '*-*-* * *'
ph13 represents the last 4 digits; it will replace the third star in the layout string '*-*-* * *'
ph1_ext_lbl represents the phone extension label; if it exists, it will replace the fourth star in the layout string '*-*-* * *'
ph14 represents the phone extension; it will replace the last star in the layout string '*-*-* * *'
The last element in the PHONEWORD command is the formatting string. In this case, we will have a dash between the area code (ph11) and the prefix (ph12) and a dash between the prefix (ph12) and the last four digits (ph13). There will be spaces between the last four digits and the phone extension label and between the phone extension label and the phone extension. For example: 650-364-8900 ext. 17
| Argument | Description | Default |
|---|---|---|
| font | a FONT | |
| digits | tuple of strings ie. ('555','555','5555') | |
| fmt | items from digits replace *'s | (*)*-* |
Specifies a color in CMYK, eg.
C1 = PROCESSCOLOR('Sky Blue', .8, .2, 0, .2, 1)
A font using this color would be defined as follows:
F1 = FONT('Times-Bold', 8, 2, 0, color=C1)
The PROCESSCOLOR's name is used to match up with colors in EPS files. Valid values for the parameters in a custom color definition are between 0 to 1.
The PROCESSCOLOR command should be used for composite colors. If using the Imposition system, this color will separate into the C,M,Y, and K plates. If the color should have its own plate, the CUSTOMCOLOR "CUSTOMCOLOR" command should be used.
If an ink parameter is used, the CMYK values in there will be used for previewing. This is useful when you wish to show users one color, but export another to manufacturing. For example, the color defined below would show a brown hue to the user, but send BLACK in the EPS file:
C1 = PROCESSCOLOR('Brown', 0, 0, 0, 1, ink=[0.45, 0.49, 0.72, 0.21])
In any case the generated EPS will export the color as a composite color, using the cmyk components and the color name. BLACK, YELLOW, MAGENTA, and CYAN are predefined process colors.
| Argument | Description | Default |
|---|---|---|
| name | name of the color | |
| c | cyan component | |
| m | magenta component | |
| y | yellow component | |
| k | black component | |
| tint | tint (1 = 100% 0 = 0%) | 1 |
| ink | [c, m, y, k] | None |
Barcode word using the DATAMATRIX 2-D symbology. The barcode can be sized using the scalefactor parameter. The size of the barcode cannot be pre-calculated and must be passed in. If the size is incorrect, then alignment (especially right alignment) of a block may be incorrect.
| Argument | Description | Default |
|---|---|---|
| data | Data to be encoded in word | |
| size | size in points, eg: size=100 | |
| scalefactor | Scale barcode by given factor | 1.0 |
| color | COLOR object | None |
| backgroundcolor | COLOR object | None |
Creates a rectangular area filled with color.
Example:
C1 = CUSTOMCOLOR('Sky Blue', .8, .2, 0, .2, 1)
R = RECTANGLE(60,54,color=C1)
TestBlock = DWIMBLOCK([R],(0,0),(LEFT,BOTTOM),layer=-1)
| Argument | Description | Default |
|---|---|---|
| width | Width of the rectangle in Postscript points | 0 |
| height | Height of the rectangle in Postscript points | 0 |
| color | Fill Color of the rectangle. |
Defines a color that will be printed on all plates. REGISTRATION is a pre-defined REGISTRATIONCOLOR with full tint.
| Argument | Description | Default |
|---|---|---|
| tint | Percentage ink coverage. 1.0 = full, 0.0 = none. | 1.0 |
Draws a box in the given color, with text knocked out. There are two ways the word size is determined. When align is None, the padding on each side is added to the size of the text. When align is given, then the padding on opposite sides add up to the total width or height. The align determines where the word is drawn, LEFT, CENTER, or RIGHT are valid values.
| Argument | Description | Default |
|---|---|---|
| text | text to draw | |
| font | font object | |
| color | color object | None |
| leftpad | padding on left | 0 |
| bottompad | padding on bottom | 0 |
| rightpad | padding on right | 0 |
| toppad | padding on top | 0 |
| align | If specified, word dimensions are independent of text dimensions and the text is horizontally aligned as given. | None |
RUN is a word that takes arbitrary postscript and runs it. You can also pass other words in. A good use of this is to change clipping or something else in postscript before running a word. The current point will be where the block has put the word. word = RUN(100, 12, "100 12 rlineto stoke")
| Argument | Description | Default |
|---|---|---|
| height | the height the word should report. you must calculate this. | |
| width | the width the word should report. you must calculate this. | |
| *args | either postscript fragments or WORDs |
F1 = SCFONT('Helvetica', 12, 0, 0)
Use this font type to handle 'small caps' - namely, having the entire passage appear in capital letters, with the first letter of each word slightly taller than the following letters in the word.
The LINEAR algorithm method means the small caps are the same aspect ratio as caps, NONLINEAR make the small caps a little wider. This will not use an expert set font, but will emulate small caps using a fairly standard algorithm.
If you wish to have the small letters be 85% the height of the tall letters, use a numerical value for the 'algoritm' field, ie:
F1 = SCFONT('Helvetica', 12, 0, 0, algorithm=.85)
| Argument | Description | Default |
|---|---|---|
| fontname | i.e. "Helvetica-Bold" | |
| pointsize | PostScript point size | |
| leading | space above line | 1 |
| tracking | space between chars | 0 |
| algorithm | LINEAR or NONLINEAR or numerical value | LINEAR |
| color | COLOR object | None |
| qtracking | space between chars, in 1/1000 em | 0 |
| vscale | scaling of the font | 1 |
| hscale | scaling of the font | 1 |
Use inside DWIMBLOCK. Sets the amount of points above the baseline (or below with negative numbers) subsequent text should be drawn. The effect is not cumulative, so SHIFT(0) will reset the baseline. SHIFT(None) is the same as SHIFT(0).
| Argument | Description | Default |
|---|---|---|
| n | amounts of points to set the baseline shift to. |
lay words out in two columns. Given a list of words, puts those words in two columns.
PhoneBlock = DWIMBLOCK[
SIDEBYSIDE([
Phone1Word, Phone2Word, Phone3Word, Phone4Word,
IF('WWW: ', card_www),
])
], ...)
This example assumes the phone words include a label. The website shows how to include a label. Empty words are filtered out.
| Argument | Description | Default |
|---|---|---|
| words | ||
| sep1 | COL | |
| sep2 | NEWLINE |
SPACED makes equal sized gaps between all words on a line. This line justification style is sometimes called "justified".
LetterHead = DWIMBLOCK[SPACED, card_street1, card_street2, citystatezip, NEWLINE, Phone1Word, Phone2Word, Phone3Word, NEWLINE ])
SPACER(w) makes adds 'w' points of horizontal space to a line at the current cursor position.
NameBlock = DWIMBLOCK([first_name, SPACER(3), last_name], (100,100), (LEFT,TOP)) # this example shows 3 points of space between the first and last name
| Argument | Description | Default |
|---|---|---|
| w | width of space | |
| h | height of space | 0.005 |
Draw words stacked.
STACK([WORD('hi', F1), WORD('there', F1)]), 'hello'
This example would result in:
hi there hello
That is, the word "hi" drawn on top of the word "there", with the left sides of the words aligned.
If you are using the same font for your WORDs, you can simplify the code, like this:
STACK(['hi', 'there'], f=F1), 'hello'
Note: In addition, you can use a variable in place of a WORD:
STACK(['hi', variable_name], f=F1), 'hello'
| Argument | Description | Default |
|---|---|---|
| words | ||
| align | LEFT | |
| f | font |
Used inside DWIMBLOCK. Marks movement of block over to the next tabstop. Tabstops are defined in the DWIMBLOCK and are relative to the left edge of a block. This example shows tab stops of an inch, two inches and three inches.
Block1 = DWIMBLOCK([F1, 'Fax:', TAB, '800-992-5555', NEWLINE, 'Cell:', TAB, '542-123-6543', NEWLINE, ], (30, 92), (LEFT, BOTTOM), tabs=[72, 144, 216])
The TAB can be pictured as a variable SPACER. The amount of space will be just enough to make the elements after the TAB on the same line start at one of the tabstops. If you want data to show up in columns, it would be best to use the TABLE command or the COL command.
The TABLE command is called for in situations where the TAB or COL commands do not yield the needed results to draw a table with the given rows and columns. The TABLE command is highly configurable and as such it requires extensive testing and manipulation to have it return the desired results. It should only be used in situations where the TAB or COL commands will not get you the output you need. Situations when it might be needed are when you have several lines of phone numbers and the individual numbers need to line up in columns, or a menu where the dishes and their descriptions need to be on the left and the prices need to be on the right.
The TABLE command was originally developed to be used in Style Editor Gold (SEG), so to use this command in the Visual Style Editor (VSE) you must enable Blocks Logic. This is done in the Other tab of your style. Once you enable Blocks Logic, the Preblocks and Postblocks tabs will become available. TABLE commands need to be placed in the Preblocks are of VSE.
The rows in a table can be defined before the command, or within the block in which TABLE is used.
Example of phone numbers displayed using TABLE
To achieve the results in the example above, showing the phone labels and phone numbers left justified, the rows can be defined outside the block. Using the TABLE command in this manner simplifies its usage by using just the variable "rows" in the block to call all the elements in the table.
TABLE([
rows = [IF(ph1_label, ' ', Phone1Word),
IF(ph2_label, ' ', Phone2Word),
IF(ph3_label, ' ', Phone3Word),
IF(ph4_label, ' ', Phone4Word)]
rows = filter(None, rows)
Block0 = DWIMBLOCK([LEFT,
F1, card_street1, NEWLINE,
IF(card_city, ', ', card_state, ' ', card_zip), NEWLINE,
TABLE(rows, font=F1, min_widths = [35.25], padding = 0, border = 0), NEWLINE,
card_email, NEWLINE,
], (126, 90), (LEFT, TOP))
Here, the rows are defined as the single variable "rows" and include four phone numbers and their corresponding labels.
There will be one column for each of the following: phone label, space, area code, prefix, and the last four digits of the phone number. Each column is defined as being 35.25 points wide. The phoneword has already been defined under the Words or Phones tab in your style.
Additional commands like CASE and font calls can be added to the rows definition. Notice that the general font to be applied follows the TABLE command in the Block.
Filtering the rows removes empty rows should one of the elements be missing.
The example shows the TABLE command being called in Block0 where the variable "rows" is followed by the general font call to be applied to all the rows.
The variable "min_widths" can be specified as a single number as in the example above when each of the columns is the same minimum size. Alternately "min_widths" can be specified for each of the columns in the table. In that case the minimum widths need to be separated by commas. All values for "min_widths" must be specified in points.
The variable "border" will add a rule around each cell if the value is changed from 0 to 1. Setting the"border" to a value of 1 makes the boarder visible and can be helpful in troubleshooting the TABLE command.
The TABLE command works best if TOP is used for the vertical starting point for the block instead of TOP_BASELINE or BOTTOM.
Here are some other helpful tricks to keep in mind when using the TABLE command.
How to declare case for the phone labels add the following before defining the rows for each of the phone labels
ph1_label = ph1_label.upper() or ph1_label = ph1_label.lower()
To move a block based on the number of rows:
if len(rows) == 4: Block0.move(0,7.5)
In the above example, if the number of rows is equal to 4, the block is moved up 7.5 points. Details on dynamic block positioning are covered in our documentation elsewhere
How to set more than one phone on a line with a bullet separating them and phone labels defined with a different font
This example is taken from a style that used a Wingding for the bullet. The phone label is a single character.
bullet = F5, ' ' + chr(167) + ' ', F6
Phone1Word = IF(F4, ph1_label+ ' ', F3, Phone1Word)
Phone2Word = IF(F4, ph2_label+ ' ', F3, Phone2Word)
Phone3Word = IF(F4, ph3_label+ ' ', F3, Phone3Word)
Phone4Word = IF(F4, ph4_label+ ' ', F3, Phone4Word)
rows = [Phone1Word + bullet + Phone2Word,
Phone3Word + bullet + Phone4Word]
rows = filter(None, rows)
Phones = DWIMBLOCK([F3, LEFT,
TABLE(rows, font=F3, min_widths = [2,42,4.75,2,42], padding = 0, border =0), NEWLINE,
], (48,60), (LEFT,TOP))
The min_widths for a single row are as follows: 2 for the phone label and space 42 for the phone number 4.75 for the bullet with the preceding and trailing spaces 2 for the phone label and space 42 for the phone number
The "+" was used to combine elements together so they set in a single cell in the table for the definition of the bullet and PhoneWords. It was used in the rows definition to get the phones and bullet to set on one line as opposed to having the second phone label and number its own line.
How to right align the label and left align the phoneword
phone1 = IF(RIGHT, F2, ph1_label, SPACER(5), LEFT, F3, Phone1Word)
phone2 = IF(RIGHT, F2, ph2_label, SPACER(5), LEFT, F3, Phone2Word)
phone3 = IF(RIGHT, F2, ph3_label, SPACER(5), LEFT, F3, Phone3Word)
phone4 = IF(RIGHT, F2, ph4_label, SPACER(5), LEFT, F2, Phone4Word)
email1 = IF(RIGHT, F2, email_label, SPACER(5), LEFT, F1, card_email)
rows = [phone1,
phone2,
phone3,
phone4,
email1]
rows = filter(None, rows)
PhoneEmailBlock = DWIMBLOCK([LEFT,
TABLE(rows, min_widths = [13.4,5,42], leading=2, padding=0, border=0), NEWLINE,
], (126, 110.25), (LEFT, TOP))
The default leading is 4 points. In our example, the leading has been reduced to 2 points.
Example of a more precise table for phones
The phone numbers in our first example do not line up precisely. The following example meets this requirement for more exact requirements.
To achieve a table such as this, your code will need to appear as follows:
phonerows = []
if ph11:
phonerows.append([RIGHT, TRACKFILL, ph11, SPACER(4), ph12, SPACER(5), ph13])
if ph21:
phonerows.append([RIGHT, TRACKFILL, ph21, SPACER(4), ph22, SPACER(5), ph23])
if ph31:
phonerows.append([RIGHT, TRACKFILL, ph31, SPACER(4), ph32, SPACER(5), ph33])
Block0 = DWIMBLOCK([RIGHT,
TABLE(phonerows, padding=0, border=0, font=F1, adjust_widths=0,
min_widths=[9.5479,0,9.5479,0,13.0654]), NEWLINE, F5, card_email, NEWLINE,
], (236, 130.3), (RIGHT, TOP))
Here, we are right justifying and using TRACKFILL to force justify each column of numbers along with the min_width for each column to get them to align as needed. Each part of the phone number (area code, prefix and last 4 digits) is broken out so that it sits in its own column in the definition of phonerows.
In this example, the phone labels are actually EPS files. Their placement was dependent upon the presence of each phone number’s respective prefix, not the area code. When writing an IF statement dependent upon part of a phone number, it's best to use the phone prefix because the user may elect to not use an area code. (The code for the placement of the phone label EPS files is not shown in this example.)
Example using Date and Time:
hours1 = hours_11_1 + ' ' + hours_11_2 + ' - ' + hours_12_1 + ' ' + hours_12_2
hours2 = hours_21_1 + ' ' + hours_21_2 + ' - ' + hours_22_1 + ' ' + hours_22_2
hours3 = hours_31_1 + ' ' + hours_31_2 + ' - ' + hours_32_1 + ' ' + hours_32_2
Block0 = DWIMBLOCK([LEFT,
F1, 'Service Hours:', NEWLINE,
TABLE([(F2, days_1, ' ', hours1),
(days_2, ' ', hours2),
(days_3, ' ', hours3)], min_widths=[35,30,76])
], (369.8, 714.1), (LEFT, TOP))
Example of a table with a header row:
It is often easier to set a string of text outside the block with the TABLE command. In this example, the text "Also Available" is set in its own block.
if sku1:
Block10 = DWIMBLOCK([LEFT,
F7, 'Also Available:', NEWLINE,
], (303.6, 90.8), (LEFT, TOP_BASELINE))
else : []
# x: CENTER=347 RIGHT=390 y:BOTTOM=91
head_rows = [(F9,'sku', ' ', 'finish', ' ', 'price'),]
data_rows = [WRAP, (F5, sku1, ' ', finish1, ' ',IF('$', price1)),
(sku2, ' ', finish2, ' ',IF('$', price2)),
(sku3, ' ', finish3, ' ',IF('$', price3)),]
all_rows = head_rows + data_rows
if sku1:
AlsoAvailableBlock = DWIMBLOCK([LEFT,
TABLE(all_rows, font=F5, min_widths = [17,10,28,10,20.5],padding=0, border=0), NEWLINE,
], (302.5, 87.0), (LEFT, TOP))
else : []
If the min_width for a column is too narrow and the data for the column is more than one word, WRAP may cause the line in that column to wrap. There are two ways to address this issue.
1) Increase the min_width for the column to accommodate the longest line
2) Remove the WRAP command
Example using LINEWRAP within a TABLE
Block1 = DWIMBLOCK([LEFT, TABLE([ (LINEWRAP, (F1, LEFT, 'CHICKEN CLUB'), (F1, RIGHT, gcbs_cc_8), (F1, RIGHT, gcbs_cc_12)), F2, NEWLINE, (LEFT, 'Solid white breast topped with bacon'), ], min_widths=[305, 28, 30], border=0, adjust_widths=0, padding=1.75), ], (18.0, 133), (LEFT, TOP), (363,332))
Notice that min_widths have only three values because the description line goes in the first cell on the left under the name of the item. The values 363 and 332 at the end of the block limit the block's width and height respectively to prevent it from oversetting other blocks or extending outside of its assigned column in the menu.
| Argument | Description | Default |
|---|---|---|
| rows | List of rows. Each row is a list of cells. Each cell can be text, a variable, a WORD, or a LINE | |
| min_widths | Optional list of minimum widths in points. Must be same length as cols | None |
| border | Width of border in points. | 0 |
| border_color | Not implemented | BLACK |
| padding | Space inside the border in points. | 3 |
| leading | Default leading | 4 |
| font | Default font for table - overridden by any font in row lists | None |
| align | Horizontal alignment of text within cells. Overridden by any alignment in row lists. | LEFT |
| valign | Vertical alignment of text within cells | BOTTOM |
| uniform_linescale | Use 1 to scale all lines if one is long, 0 for scale only too long lines | 1 |
Barcode word using the UPC-A symbology. The text of the barcode will be shown underneath the barcode. The barcode can be sized using the width and height parameters.
| Argument | Description | Default |
|---|---|---|
| data | Data to be encoded in word | |
| width | Rescale barcode to be width points wide | None |
| height | Reduce line height to be encoded in word | None |
| scalefactor | Scale barcode by given factor | 1.0 |
| color | COLOR object | None |
| backgroundcolor | COLOR object | None |
Returns the x-coord between block1 and block2. This is very useful for keeping a block between two other blocks. The right side of the leftmost block and the left side of the rightmost block is used.
NameBlock = DWIMBLOCK(...)
PhoneBlock = DWIMBLOCK(...)
AddressBlock = DWIMBLOCK([
...
], (HCENTER(NameBlock, PhoneBlock), 30), (CENTER, LEFT))
As with VCENTER, define the left and right blocks first, then use HCENTER to calculate the X of the middle block, and finally uses CENTER horizontal growth direction.
| Argument | Description | Default |
|---|---|---|
| block1 | A block reference, e.g. NameBlock | |
| block2 | The second block |
cworldline = VLINEWORD(4, 4, 1, 10, 20) Draws a line of any height, width or color. When used inline in a block, the line will be centered in the middle of the word's "space", (determined by the width parameter for the block) for the line's height.
| Argument | Description | Default |
|---|---|---|
| w | Width of the word | |
| h | Height of the word | |
| lw | Width of the line | |
| lh | Height of the line | |
| y | Lower position of the line | 0 |
| color | COLOR override | None (draws in black by default) |
VSPACER(h) adds h points of vertical space at the current cursor position
TitleBlock = DWIMBLOCK([card_title1, VSPACER(15), card_title2], (100,100), (LEFT,TOP))
# this example shows 15 points of vertical space between two title lines
Note that VSPACERs at the top and boottom of a block are ignored.
| Argument | Description | Default |
|---|---|---|
| h | height to space |
The WORD command allows you to define formatted text using a single variable. The syntax for the WORD command is as follows:
WORD('mytext', F1, shift=0)The shift parameter is optional and allows you to shift the baseline for the font outside the definition of the font in the Fonts tab of the style. Only one font can be applied following the WORD command.
In the example below, a new variable "bullet3" is defined using the WORD command:
bullet3 = WORD(bullet2, f=F1)
bullet2 is a predefined existing variable available to all styles for which the bullet is set with a preceding and trailing space (" • "). Defining it with the WORD command would let "spaced" bullets be set in font F1 where they occur.
| Argument | Description | Default |
|---|---|---|
| text | The text to display | |
| f | Font object | |
| shift | Baseline shift in points above baseline. Can be negative. | 0 |
The WORDJOIN command takes a list of objects and a separator. It first removes any empty objects from the list, and then joins any remaining items with the separator. This is useful to properly join, say, a list of phone numbers with bullets, even if some of the phone numbers are empty.
WORDJOIN("Oranges","","Apples","Bananas", " and ")
will produce the text "Oranges and Apples and Bananas". The empty string after "Oranges" is ignored More usefully, WORDJOIN ignores objects which are empty. In the example below, if Phone2Word is empty, WORDJOIN will still do the right thing and produce "Phone1Word bullet2 card_email"
WORDJOIN(Phone1Word,Phone2Word,card_email, bullet2)
| Argument | Description | Default |
|---|---|---|
| bit1 | some content (ie, a string, WORD or list of strings and WORDs) | |
| bit2 | more content | |
| bitN | ... repeat as many items as needed | |
| seperator | The seperator to join with. This is always the last item in the list. |
Similar to MIXEDFONT, allows words matching the given wordset to be displayed w/different font. The wordset should be passed as a list of strings, e.g.
wordset=['CPRM', 'ASID'],
The words are not limited to whole words, in fact they can include spaces. The words are matched case-sensitively.
| Argument | Description | Default |
|---|---|---|
| font1 | i.e. "Helvetica-Bold" | |
| size1 | PostScript point size | |
| font2 | font for chars in charset | |
| size2 | size for chars in charset | |
| wordset | words in this list use font2 and size2 | |
| leading | space above line | 1 |
| tracking | space between chars | 0 |
| qtracking | space between chars, in 1/1000 em | 0 |
| color | COLOR object | None |
| vscale | scaling of the font | 1 |
| hscale | scaling of the font | 1 |
| shift | Baseline shift for font2 | 0 |
This command is used inside a DWIMBLOCK and wwitches the wrap mode to WRAP. NEWLINEs are ignored, text will wrap if the line gets too long. There are no arguments, this is a constant. You will also want to define a maximum block width. For more information, see the following documentation pages: Word Wrapping - Overview and Word Wrapping - Wrap and Indent Subsequent Lines
WRAPHERE tells the typography engine to attempt to wrap the current line of text at a particular point, if necessary. WRAPHERE usually takes a single parameter: a text string to be added in-line into the style IF AND ONLY IF it is NOT necessary that the line wrapped at this point. See the example below for more information.
The typography engine determines if a line needs to wrap by looking at the current block's maximum width and comparing it to the length of the current line. If a maximum width is not defined explicitly, it is defined by default to be 6 points from the edge of the item.
AddressBlock = DWIMBLOCK([F2, LEFT,
card_street1, IF(WRAPHERE(', '), card_street2),NEWLINE,
card_street3, NEWLINE,
IF(card_city, ', '), card_state,
IF(' ', card_zip)], (134,14), (LEFT, BOTTOM),(106, 0))
# This example shows a block having a maximum width defined as 106 points.
# If card_street2 cannot fit on the same line as card_street1, it will wrap
# to a NEWLINE. If it DOES fit, a comma and a space will be inserted into
# the line before card_street2 is placed into the line.
Generally the WRAPHERE is replaced with a NEWLINE when wrapping takes place. An optional second argument can specify something other than a NEWLINE. Usually that will be a list that includes a NEWLINE. For instance:
AddressBlock = DWIMBLOCK([F2, LEFT,
email_part_1, '@',
WRAPHERE('', [NEWLINE, ' ']), emaildomain,
], (134,14), (LEFT, BOTTOM),(106, 0))
# This example shows an email address that can split to two lines. The
# domain is indented a bit if it wraps to two lines.
WRAPHERE takes at least one, optionally two arguments:
WRAPHERE(' add this if no wrap ', 'add this if it does wrap')
There is no need for WRAP at the beginning of the block - WRAP basically replaces every space with a WRAPHERE(' ') object, thus allowing the line to wrap at any point. If you are wrapping, and need to protect a phrase from wrapping, you can enclose it in a WORD object.
| Argument | Description | Default |
|---|---|---|
| nonwrappingtext | text to add to block if line does not need to wrap | |
| wrappingitems | items to add to the block if line does wrap | [NEWLINE] |
WRAPON simplifies the process of breaking text at a certain character boundary. WRAPON is used inside a DWIMBLOCK. The most common usage is to allow text to break after a certain character:
WRAPON('reallylongemailaddress@exeedinglylongdomainname.com', '@', wrap_before=1)
The email will be wrapped before the '@' character.
WRAPON('reallylongemailaddress@exeedinglylongdomainname.com', '@')
The email will be wrapped after the "@" character.
WRAPON works by turning the given text into two parts with a WRAPHERE object in the middle. The pattern is actually a regular expression and but the text is only split once. The example above is transformed into:
'reallylongemailaddress@', WRAPHERE(''), 'exeedinglylongdomainname.com'
To specify that a certain part of the text should not show if the line is wrapped, use parenthesis in the pattern. For example,
WRAPON('101 Alberquerque Parkway, Suite 100', '(, )')
That would be transformed into
'101 Alberquerque Parkway', WRAPHERE(', '), 'Suite 100'
| Argument | Description | Default |
|---|---|---|
| text | ||
| pattern | determines where to wrap. | |
| indent | indent of line if wrapping is needed | None |
| wrap_before | 0 or 1 If 1, wraps before the pattern, puts pattern on next line | 0 |
Table of Contents
SEG stands for "Style Editor Gold" and is a powerful tool editing a style, usually a style produced by EGG.
In the chapter about "Style Building". SEG is also discussed, but there the focus is on how to build a style. This chapter focuses on the features of SEG and especially the features of VSE, the visual mode of SEG, and as such serves more as a reference.
This reference chapter covers all sections (or tabs) of SEG and VSE. To be able to see the screen shots as shown in this chapter you need to load a style. After that you can follow most of the sections in this chapter by opening the tabs in your browser. The "Select Style" window automatically open when you choose "Style Editor Gold" from the menu:
Note: if you are on a brand new site, there are no converted style by default. But you can easily make one: select a style (bc,sty is a good starting point) and the when you see to the "Blocks" tab, then there is a "Convert" button. Click this button and when the page refreshes you are in VSE mode (note: the center block is selected here, this is not how it opens, but click on it and it is like the screen shot):
At first glance SEG and especially the VSE mode of SEG has much in common with design programs such as Adobe Illustrator. After all a style represents a design for printed artwork. But when looking more closely, you will learn that SEG is a rather different beast in a number of ways. A style represents a design for variable imprint and SEG is specifically created to edit those styles. In contrast, most other design programs are not setup for variable imprint. Thus this is the first important concept: SEG is for editing variable imprint.
Since styles are used in PageDNA’s online ordering system, it is very important to have a separation between styles used in production and styles being edited in a "staging" situation. If we would edit the production styles directly, a simple mistake could mean an inappropriate style is used for an order. For that reason SEG can load a production style, but doesn't automatically save it as the production copy, also referred to as the "live" style. So while editing in SEG the edits are saved in a working copy. Only when you know the style is good to go you save it to the live copy. For a non-production style, i.e. the item the style belongs to is hidden from ordering, this distinction is less of an issue. Yet PageDNA made it work this way so you actually can change a style already in production with a lot less risk of screwing up. So this is the second important concept: an edited style is a working copy until you save it to the live copy (i.e. hit the "Save" button).
Understanding these two concepts, editing variable imprint and working copy versus live style, will make working with SEG a lot easier. For instance, you better understand that when a button in the UI says "Apply", changes are applied to the working copy. When a button in the UI says "Save", the changes in your working copy are saved to the production copy.
Finally a word about the differences between SEG and VSE. This reference chapter will discuss both but most emphasis will be on VSE since it has more features. The title of a section will indicate to which the section applies.
Some sections (tabs) in SEG are so called "Code View" sections, like the "Words" tab and the "Blocks" tab. You edit these in a plain text area and the text you enter needs to be valid Python code. It used to be that most SEG sections were Code View sections. Fortunately in VSE the Code View is mostly gone. However, Code View is the only way to build advanced logic in your style and that's why VSE has optional Code View sections (tabs): the "Preblocks" and "Postblocks" tabs. See "VSE Preblocks and Postblocks Tabs". on how to use these sections.
After you change text in a Code View section, the changes are automatically applied to the working copy when you go to another tab. Remember, the changes are Not saved to the production copy automatically. Using a code view tab is relatively simple, although you need to keep in mind that the text you enter must be valid Python code. Otherwise SEG will complain about syntax errors. A Code View section looks like the screen shot below:
Note: if you want more information on Python, a great resource is the online Python documentation at:
http://www.python.org/doc/2.4.3/
The following link – taken from the tutorial above – is to an informal introduction to Python.
On the "Preview" tab you setup the previews or proofs that your ordering client will see. For small items that can be just one preview, but bigger items like a letter head do better with multiple previews: one in reduced size for the whole item and one or more other previews that only show a particular block of text, usually enlarged.
At the top, just below the tabs, you will see a "Code View | List View" pair, that allows you to toggle. The Code View will represent the Previews in a Code View as discussed in the "Seg Code View". section. The List View, as depicted below, is the default.
Let me explain the what you see on the above screen shot. As said, the default view of the "Preview" tab is a list of previews and a form under the list that allows you to add or edit a preview. The third column has the "Actions" links, clicking on an action link, like "edit" will change the form to edit the preview of that row. Note that "zoom1", a user added preview, also has a "del" action: delete. The form to edit an existing preview and the and the "Adding New Zoom Block" are identical. Of course the existing preview will have the existing values in the form.
The list on the Preview tab has always three preview present: "html", "normal" and "small", from which the normal preview is enabled by default. First we will look a the form for adding and editing user defined previews and then cover the differences in the three standard previews.
The following is a short description of the fields you will find on the "zoom preview" form:
The title of your preview
When in VSE the block field will be a select list from where you can select a block. That block will determine what you see on that preview (also called zoom, since the idea is to enlarge the that preview).
The values in the Dims fields serve the same purpose ot the "Block" field above: defining an area of your product that you want to have an enlarged preview (proof). The Dims fields have a preference over the dimensions of the block listed under the "Block" field above. The Dims values are: bottom-left-x, bottom-left-y, w, h of the zoom area you want.
How much to enlarge (or reduce) the preview block.
You can select a rotation value here, this can be useful when some type on the product is set vertically (or upside down). Rotating the preview helps the user to see the proof normally
Usually not used. This is there to preserve values that are not in the list of fields already discussed
To submit the form after filling it out, you use the "Apply" button. This will save the values to the working copy (and not to the live style).
If you click on the edit link for the html preview you will see the following form:
This form has only two fields: a check box to enable the preview (i.e. showing it on the proofs page) and a text area to enter the HTML to be used for this preview. More on how to use an html preview is in the "Click for Larger Proofs ". section.
Finally let's look at the normal and small forms, which are identical:
As you see there are a few additional fields:
This field is for showing or hiding the preview on the proofs page
Whether to provide a link to the PDF of the output.
To allow for the download of a PDF, first configure the "normal" view without enabling the PDF checkbox. Then, edit and enable the "small" view and enable its PDF checkbox. (Enabling the PDF checkbox for the Normal view does not work.)
The file name of a gif file to be used for the proof. Note how you can clear an existing "combine gif" with the button and select a new one with the "Choose File" button (note "Choose File" is often called "Browse" in other browsers). Also not that the use of combine gifs is becoming more and more obsolete. This is mostly here for backwards compatibility
The offset left and offset bottom of the combine gif image, measured from the origin of the product, in points
The scale factor of the combine gif in percent, must be greater then zero
The "Variables" tab contains a list of all the variables used in a style. The list starts out with all defaults. Normally the values of the variables in your style come from the online order forms. The values of the variables in this section will be used if the online form does not pass a value. This section is generally not changed unless you need to hard-code a value (not in a form) or when new a variable is added. Note the SEG adds in variables automatically here when you add a variable to one of your blocks. However there are a few rare cases that you need to add the variable yourself. The "Variables" looks like the next screen shot:
Filling out the form is rather straight forward. The one thing to note is that you can set the type of your variable, i.e. a string (string of characters), or a number, a whole number (integer) or a decimal number. The type default to a string, which is what is needed in most cases. However we provide the possibility to set the type since you sometimes need number in your code. You can add a new value: give a new variable name, optionally a value and also optionally a type (when type needs to be a number), then click the "Add" button. The new variable will be add under the heading "Custom Variables". Changing variables: just change the text in the input boxes and click the "Update"button. When there is a check mark in the "Delete?" column, the corresponding variable is deleted. Note that the "Add" and "Update"buttons change the working copy of your style not the production or live copy of the style. Again this is done so the working copy can be tested before committing the changed to the live copy, so the live copy is protected against unintended changes.
The default view of the "Fonts" tab is a list of fonts and a form under the list that allows you to add or edit the values for a font. When you have a style for use with the traditional SEG UI (that is not converted for use with VSE) you will see a "Code View | List View" pair above the list. This allows you to toggle between list view and code view. The List View is the default. The Code View will represent the Fonts (and Colors) in a Code View as discussed in the "Seg Code View". section.
Below is a picture of what the "Fonts" tab's list view looks like:
Looking at the screen shot above you will see that the are multiple font classes: 'FONT', 'MIXEDFONT', 'SCFONT', 'MMFONT', 'WORDSETFONT', and 'NONISOFONT'. Let's discuss the fields you see on the above screen shot first and then cover the additional fields found in the forms for the other font classes. So these are the standard fields:
Name is the variable name for the font. It is used in blocks and phones. Although you can freely choose a font variable name (as long as it is unique in your style), we strongly recommend using a naming scheme like 'F1', 'F2', 'F3' and so on. Styles produced by EGG use this naming convention.
Fontname has a drop down list of the font names currently in use. If you need a font not yet in the list, select "Other" and fill in the font name in the text box behind the select list. This name must be the name under which the font is known (as listed in the "show installed fonts" list).
Pointsize is the size of the font in points. You can use a decimal number.
Select a color from the list. If you need a color that is not in that list you need to define that color first on the Colors tab.
In PageDNA’s type setting engine leading is defined as the space above the line. The value is in points.
Tracking is the space between letters (the uniform space, positive or negative, between all letters set in this font). The tracking number is in em, except when the number is smaller then 5. When the number is 5 or greater then 5, the unit is one thousands of an em.
Qtracking, when used, has preference over tracking. It is mostly there for convenience. The only difference with Tracking is the units: 1/200 em
Hscale must be a value greater the zero. The hscale compresses the width of the letters horizontally when the value is smaller the 100 %, stretches them when the value is greater then 100%
Similar as Hscale, but for the vertical direction
Valid values are: 0 or None (no underline), 1 (uses the underline info defined in the font), (x, y) i. e. (distance below baseline, line weight). The last option just draws a line with given values, x point below the base line and a line weight of y.
Baseline shift, in points
Select on of the options. Speaks for itself.
The next font class to look at is the MIXEDFONT class:
MIXEDFONT defines to fonts and certain characters are type set in the second font. Which letters are in the second font is determined by either the field "Pattern" or the field "Charset". From the new fields — "Font2", "Size2", "Pattern" and "Charset" — we will only cover the last two since the first ones are just like "Fontname" and "Pointsize" as explained above.
Pattern is a regular expression. If text matches the expression it is type set in the second font.
Although a regular expression pattern is very powerful it can also be rather tricky to get it right. So in many cases there is a simpler way of setting what needs to be type set in the second font. Charset has a drop down list for the most common character sets. And selecting the "Other..." option allows you to make a character set of your own. So only characters occurring in the charset are type set inn the second font.
The WORDSETFONT is almost identical to MIXEDFONT. What it has as extra is the "Wordset" field:
The "Wordset" field allows you to enter a Python list of words that will be type set in the second font. So a valid entry must contain a comma separated list of strings (in single or double quotes). And the list must start with a '[' and end with a ']' (without the quotes though). Example: ['This', 'is', 'my', 'list', "of", "words"]
The SCFONT font class (smallcaps) is used to mimic a small caps font with a regular font. Here is how the form looks:
The new field is "Algorithm". The options are 'LINEAR', 'NONLINIAR' and "Other...'. Selecting other allows you to enter a decimal number, which is the ratio between the caps and the smallcaps. If you enter 0.8 the small caps letters (i.e. the lower case letters of the text to type set with this font) will be 80 % of the caps letters. The LINEAR option in the Algorithm field means the small caps are the same aspect ratio as caps, NONLINEAR makes the small caps a little wider.
To learn more about fonts visit the "Define Fonts". section.
When the "Fonts" tab is in list view, there is a separate section (tab) for the color definitions. For converted styles the Fonts tab is always in list view mode and thus there is always a Color tab in VSE mode. The following screen shot shows the Color tab:
The colors form has the following fields:
The name for the color. To use the color as a variable you use this name. Although a color can have any valid variable name we recommend strongly to use the common practise of naming colors like 'C1', 'C2 and so on. Also EGG uses this naming convention.
If you use CYMK, this name is just descriptive. However, in case you use a PMS color this must be the correct color name as the name is used when creating separations. So if an embedded EPS uses "PANTONE 123" and the style uses "blue" with the same CMYK, then two different separations would result.
The CMYK values in percent, the value must be between 0 and 100 %. Note the value can be a decimal number.
These fields lets the preview show a different color than the underlying CMYK color. In other words, it specifies the actual ink color used, when the COLOR object is applied. Preview = uses "ink", Output EPS = uses actual color.
This gives ink % coverage, especially useful for a custom color
The "Phones" tab on VSE allows you to configure the so called "PhoneWords" in a convenient way. This is what the form looks like:
Below is a description of the various fields you see on the form:
Choose the type for the PhoneWord: the familiar US (and Canadian) pattern or a more free form pattern useful for international phones
The font that all PhoneWords will share, except when a "Font Exception" is set. Just select from the list of defined fonts. If the font you need is not there, you need to define it first on the "Fonts" tab
Select from the drop down list if one of the PhoneWords needs a different font. Note to set the font back to the default, you must select the actual font, not the entry "Default font"
This field is for setting the separator between the phone label and the number. Either select a pattern from the list or select "Other..." and enter one or more separator characters in the tex box to the right (between "Other: label" and "number"
This field is for setting the separator between the extension label and the extension number. Select a pattern from the list or make a new one by selecting "Other..." from the list and enter the separator characters in the text box between "Other: label" and "ext"
This field is only used for the US formatted PhoneWords. You can select a pattern from the list of common patterns or make your own by selecting "Other..." from the drop down list and type in the new pattern in the text box labeled "Other:"
After filling out the form click the "Apply button so store the changes in the working copy of the style.
On the blocks tab you see a tool bar (the gray area at the top, just below the tabs)
where you can control the actions to take, first the icons, from left to right: the
icon ("Make a new
block"), the
icon
("Make a new photo block"), the
icon ("Edit a block"), the
icon ("Edit a
block's settings"), the
icon ("Delete a block"), the
icon ("Select next block"), the
icon ("Block
list, sorted by layer") and finally the
icon ("Open page Window").
Depending whether a block is selected the "edit" and "delete" icons will
be enabled or disabled. Following the action icons are the "Align" selector and
the "x" and "y" input boxes (more on that later). The "Block list
window" and the "Page window" are explained towards the end of this section.
The "+" and "-" control the zoom, while the percentage in between the
"+" and "-" shows the current zoom level.
To the right of the actions buttons is the "Align" selector. Select a block ( a block of text below the tool bar ) by clicking on it ( border becomes blue ) and you will see the "Align" selector become active. See the figure below, the selector has a small blue square some where (when a block is selected). In this example the dot is at the LEFT and BOTTOM This blue square indicates the alignment and the dot at LEFT and BOTTOM means lines are left aligned and the block grows from the bottom up if more lines are added. You can change the alignment by clicking on one of the blue squares in the "Align" image.
Now look at the tool bar next to the "Align" image and you will see input boxes for x and y and an "Apply" button to set the changed x and y. These two numbers in indicate the block position, measured from the lower-left corner of the item to the point of alignment or anchor point. In the figure below you will see the "Align" image with the blue dot, the block X, Y input and zoom controls:
![]() | Note |
|---|---|
When changing the X and or Y of a block it sometimes may seem that after a page refresh the newly entered values didn't "stick". This is especially true when the zoom percentage is lower then 100%. Although it seems that the value didn't change or changed incorrectly, the value entered in the X and Y tex box is actually saved to the style, just not accurately displayed. This is because you can drag a block into place and because of that the accuracy of the block positioning in the display is determined by the screen resolution. That means at low zoom percentage the inaccuracy can be a problem, upon a page load the displayed value might not be what it really is in the style. The solution to inaccuracy in the display of the position is to make the zoom percentage bigger, usually 100 % to 150 % is enough to give you a accuracy of about a half point or more. |
Under the tool bar you will what looks like a preview, except that the values of the variables are the variable names themselves. You can drag the blocks around to positioning them. And of course you can edit each block's content. Let's look at the block content edit window first. You can open the edit window by clicking on a block ( the border turns blue ) and then click "edit" in the tool bar. Or you can just double click a block. An edit window pops up which looks like this:
You can just type in the variables in the big text area, but we made it actually a lot easier by using the controls. Starting at the tool bar, you see the defined fonts (defined in this style). If you click on one of the fonts the font is inserted in the edit area including a trailing comma. If you want to replace a font, just select the font to replace (including the comma) and click the new font and you are done. The alignment icon more to the right on the tool bar work in the same way. These buttons insert (from left to right): "LEFT, ", "CENTER, ", "RIGHT, ", "SPACED, ". The last paragraph icon inserts a "NEWLINE, ".
To the right of the edit area you will see a list of variable. Again, clicking on any of these inserts that variable and a trailing comma at the cursor. The text box above the variables list that says "(search/add)" allows you to quick search a variable. Start typing a variable name and the list will be shortened to only show the variables that match what you typed.
This same text box serves a double function: it also allows you to add a new variable. Type the new variable name in the text box (note that the list becomes empty) and click the button with the "+" at the right next to the text box. This will do three things:
Insert your new variable at the cursor in the edit area
Put this variable in the variables list below the text box for future use in this style
Adds this variable to the style on the "Variables" tab (this is needed to prevent errors in the style)
Besides the edit window for text blocks there is the photo block edit window. There is
also a photo block create window, accessible by clicking the
"Make a new photo block"
icon, and the photo create window is almost identical to the photo edit window. You access
the photo edit window by selecting a photo block and clicking the pencil icon or just double
clicking a photo block.
In the photo block edit window you can edit properties for the block. Let's cover them briefly:
Variable name: you can set here a variable name on the order form to let the user choose a photo or image. This can be used with variables like "sublogos" or "corp_tag" but you can set it up to use it with other variables as well. If you use a variable, you most likely want to use the "Filename path" setting as well, see next point. Also note that using a variable here will add this variable to the "Variables" tab as well
Filename path: you can select a format for the filename path here. The option "con/[variable].eps" is used with "corp_tag", whereas "con/[variable]" is used with variables that contain the whole file name. Note that this requires that the EPS files are uploaded in the "con" directory
EPS file: this allows you to upload a file. Note that this has preference over the next field "Select file"
Select file: here you can select a file from the con directory that you uploaded earlier. As noted above, uploading an EPS file take preference over selecting a file. Note you can download a selected file from here too. This can be practical when you want to make a quick change: download, change and upload again. Note that if you upload a file or select a file when using a variable, the value of this variable in the "Variables" tab will be set to the uploaded/selected file. When you use the "Filename path" setting the value will be set accordingly: i.e. if the variable is "corp_tag" and the filename "marketing.eps" and the "Filename path" is "con/[variable].eps" the "corp_tag" on the "Variables" tab will be set to "marketing"; similarly if you would choose "con/[variable]", the value of "corp_tag" on the "Variables" tab would be set to "marketing.eps"; if you don't use "Filename path" at all, the value of "corp_tag" on the "Variables" tab would be set to "con/marketing.eps"
Layer: select the desired layer from the list. Or if the layer you want is not in the list, select "Other..." and enter the layer value in the text box in the window that pops up
Scale x/y: set the scaling, scaling x (width) and y (height) are independent of each other, unless you select "Preserve aspect ratio"
Resize x/y: set the values to resize to. Again independent of each other unless you select "Preserve aspect ratio". Note that resize has preference over scale
Rotate: quick way to set rotation in 90 degree steps. There is another way to set rotation: use "Switch" link/icon, which will edit the photo block in code mode. This allows you to use ANGLEWORD with the EPSWORD that contains the photo. ANGLEWORD allows arbitrary rotation
Preserve aspect ratio: speaks for itself, used with scaling/resizing
Crop: cropping only makes sense when preserving aspect ration and so it's only visible when "Preserve aspect ratio" is checked. Checking "Crop" will crop a resized or scaled photo such that it will fill the allotted space exactly
Switch: as already mentioned in a previous point, "Switch" will switch to the normal code edit window. This allows you to make a border and or type set the photo with an angle. Like so (photo with a border, under an angle):
ANGLEWORD(BORDER(EPSWORD('con/sample_bc_previewlayer.eps', xscale=0.1, yscale=0.1), 2, C1), 45)
There is another important pop up window, the block settings window. To access this window, select a block (so it has a blue border) and click the "Edit a block's settings" icon in the tool bar ( the one with the wrench ), a window pops up that looks like the figure below:
In the block settings window you can edit various settings for the block (note that only text blocks have a settings window). Let's discuss them briefly:
Block name: change the block name. Block names are used in the Previews tab so choosing a meaningful name is helpful. The name must start with a letter and use alphanumeric characters and underscores. It cannot contain any special characters like spaces or hyphens.
Max. Width and Max. Height: you can set the maximum width and/or height of the block. For the max. width the effect is that the font of long lines is scaled so the line will fit inside the block. If you want ALL lines to scale if one or more lines are to long, make sure to check the check box in front of "Uniform line scaling?" For max. height the effect is that the font of all lines is scaled so the lines will fit in the block.
Max. Lines: here you can set the maximum number of lines a block is allowed to have. If a user enters more information then will fit in the allowed number of lines the user will see the "Max. Message". You can customize the "Max. Message" in the next field.
Max. Message: see previous point.
Layer: you can set the layer on which the block appears. Note that "preview layer" and "output layer" are special layers. Blocks on the "preview layer" will show on the proof but are NOT send to the output for the printer. This is useful for preprinted masters or shells. A blocks on the "output layer" is not shown to the user, but the block IS send to the output for the printer. So it is just the opposite of preview layer. The option "Other..." is used to enter a value for layer that is not in the list of options. Selecting "Other..." will pop up a small window that allows you to enter a new value (whole numbers only) for the layer. This new value will be added to the options list and selected automatically.
Tabs: here you can set your custom tabs as a comma separated list of whole numbers. The unit is points. The default is every 36 point.
Uniform line scaling: see the earlier point about "Max. Width."
Now let's discuss the block list window. To access this window click the "Block list" icon in the tool bar ( the one second left next to the blue align image ) and a window pops up that looks like the figure below:
The block list window is an important helper, giving you access to different modes: besides the "Edit" mode there is a "Merge" mode, a "Vertical align" mode and a "Horizontal align" mode. Utilizing these modes the window provides the following functionality:
Managing the layer a block is on. The blocks in the list are sorted first by layer, then alphabetical. The left four icons (buttons) in the Block list window tool bar are used to move blocks from one layer to another: the first button moves the selected block to the top layer, the second moves the block to the bottom layer, the third moves the block one layer up and the fourth moves the selected block one layer down. You can also select a layer directly from the drop down list.
Selecting a block and/or opening the block edit window, only in "Edit" mode.
Merging two blocks. The fifth icon (button) in the tool bar (counting from the left) selects the "Merge mode" and this button is only available when a block is selected. In merge mode most other actions are disabled. This button acts as a toggle between "Edit mode" and "Merge mode". In merge mode the block list window shows a "Merge" button for every block that is a potential merge candidate. Also the candidate blocks have a blue dotted outline, clicking on a blue doted block will bring up a confirmation dialog and after clicking "OK" the merge will happen, preserving the white space there was between the blocks inside the new block. Note when entering "Merge mode" there might be a sort time the window disappears while the block list is updated, only when the merge candidates list is outdated Merge candidates are blocks that are vertically aligned with each other, i.e both are have for instance the anchor set to LEFT and the block origin's Ys are the same (or not more the a half point apart)
Here you see VSE in "Merge mode" in action, note how the selected block has one merge candidate, clicking the "Merge" button in the block list window or the block with the blue dotted line will fire the merge action (with a confirm dialog window):
Aligning two or more blocks. The last two buttons allows you to enter "Vertical align" and "Horizontal align" mode respectively. The se buttons act as toggle buttons, toggling between "edit" mode and the respective align mode. When entering one of these modes, which is only possible after selecting a block, the first selected block acts as the reference block. Any other block you select in align mode will be added to a list of blocks. Note after selecting the first block a confirm dialog opens, listing the selected blocks to align to the reference block. When clicking OK the align action will be performed: all selected blocks will be aligned with the reference block. The anchor inside the block will be moved if necessary. Here is the align mode in action:
Block locking. To the right in the list you see a little lock icon for each block. Clicking this will toggle "Block locking" of the associated block. When a block is locked you cannot drag it, but you can still edit it (contents and settings). A locked block shows a blue lock icon just outside the lower right corner
One last window to talk about is the "Page Window". To open the Page window
click the button in the tool bar just left of the align selector, the
icon ("Open page Window").
See figure below:
After you click the "VSE Page Window" button a new window opens, much
like the following figure:
The page window has several sub sections:
User preferences, these are preferences that are stored across styles and sites. You can set the units you like and enable button labels under the tool bar buttons.
Page settings, see below
Settings for output, see below
Block logic: this enables two extra sections: Preblocks and Postblocks, which are meant for logic. See "VSE Preblocks and Postblocks".
Here is more detail on some of the fields:
Enter the values for the page size in the units selected – inches is the default – into the W and H fields. If you are building a Style for a standard business card, the values for these fields will be: 3.5 and 2 in inches or 252 and 144 in points. If you are editing an existing Style, or a Style made by EGG, page size values should be present already.
There are four input boxes for bleed. From left to right these bleed values are for left, bottom, right and top edges of the page. Note that these values are in the current units. Also note that each value is the difference between the bounding box edge (unfinished product) and the edge of the finished product. When you need to use bleed you normally let EGG set your page size and bleed. See the chapter on bleed: "Dealing with Items Having a Bleed".
By default oversized photo blocks are clipped to the product size plus bleed in the VSE display (not in the style). Here you can change this behavior to auto scale the oversized photo, which actually sets the scale values for that photo in the style.
When this is set (check mark checked), this allows you to test the style with custom page size setting to be entered on the test page itself. This override only affects the page size temporarily, only for that particular test run
Check this if you want to embed a lo-res black and white preview in the EPS file
Check this if you need to include the used fonts in the output
Select from the list whether you need cropmakrs and if so where they should be. The cropmarks are added within the bleed area, and are 9 points away from the edge of the artwork. Bleeds less than 9 points do not get a cropmark. The auto-bleed option sets bleed to a minimum of 18 points all the way around (which is the minimum to get a decent looking bleed).
Rotate the EPS only, no other output or preview is rotated. Value in increments of 90 degree
The "Words" section only exists in SEG. In VSE this is replaced by the "Phones" tab. As most sections, the Words section is a "Code View" section. It is used to enter the Phone Words and the tab got its name from the last part of that phrase. Code view is explained in "SEG Code View"..
The SEG "Blocks" section is a "Code View" section, used to enter the block definitions. Code view is explained in "SEG Code View"..
This reference chapter is not the place to explain how to use these Code View sections. Look in the "Create Style File, Old User Interface". for more information on actual usage.
The "Other" tab in SEG is used for miscellaneous settings. This sections looks in SEG like the following screen shot:
The fields on this form have the following meaning:
This field is for the entering the page size. When creating a style by using EGG this value is already set. Note the notation: that page size must be entered as shown on the screen shot, two numbers, separated by a comma (the parenthesis are added upon save). The page size units are points. Also note that clicking one of the size links under the input box will fill the input box with the associated size, i.e. clicking "bc" link results in "(252, 144)"
Page rotate does what it says: it rotates the page. Only in increments of 90 degree
When this is set (check mark checked), this allows you to test the style with custom page size setting to be entered on the test page itself. This override only affects the page size temporarily, only for that particular test run
Sets the software version to use. Rarely needs to be changed, although on some really old styles you sometimes need to fix this in order to use newer features. Latest version as of this writing is SOS16.
As it says: it places a border around the eps. Rarely used
Check this if you want to embed a lo-res black and white preview in the EPS file
Check if you need to include the used fonts in the output
Here you fill in the bleed values, if there are any. The full bleed has four values, entered as four comma separated numbers (they can be decimal). The bleed values are in points and measure the distance from the edge of the printed artwork to the edge of the finished product in the following order: left, bottom, right, top. When left blank or zero all bleeds are set to zero (the default). When only two numbers are entered the first number is for left and right and the second number is for bottom and top
Select from the list whether you need cropmarks and if so where they should be. The cropmarks are added within the bleed area, and are 9 points away from the edge of the artwork. Bleeds less than 9 points do not get a cropmark. The auto-bleed option sets bleed to a minimum of 18 points all the way around (which is the minimum to get a decent looking bleed).
Rotate the EPS only, no other output or preview is rotated. Value in increments of 90 degree
The Preblocks and Postblocks sections (tabs) are specific for VSE. Normally they are not present, you have to enable them when needed. The Preblocks and Postblocks tabs are so called "Code View" sections. The purpose of these tabs is to allow you to add Python code for more advanced usage of logic in your style. Examples that use these tabs are in the chapter: "Typography Exceptions, New User Interface". You enable these tabs on the "Page window" on the blocks tab:
The "page window" icon is the icon just left of the align selector on the tool bar of the "Blocks" tab, just visible (under "Blocks") on the screen shot above. Note the "Block logic" section on the Page window ant the bottom. After checking the check box and clicking "Apply" you will see two new tabs: Preblocks and Postblocks.
EGG stands for "Excellent Graphics Grabber" and is a powerful way of creating a style from artwork made in a design program such as Illustrator. With simple designs EGG does the right thing out of the box. More complex designs require some additional tweaking after creating a style. This chapter tells you how to optimize the results you get from EGG.
EGG has its preferences for EPS format and really likes the Adobe Illustrator 8 format the best. See http://www.nationsprint.com/hub/docs/html/SpecificationForms/artwork-prep.html for screen shots on saving from later versions of Illustrator.
EGG takes the EPS file of your item and then 'reverse engineers' the layout to create a style file, including automatically determining variables, font settings, position and alignment of the blocks, colors settings, etc. EGG distinguishes between static art, images and outlined text and editable text. EGG puts all static art in a new EPS file (or gif if you prefer) and turns all editable text (the variable text) in a style file with font definitions, color definitions, variables (when appropriate) and strings (if no appropriate variable could be found).
EGG is a piece of software, which uses heuristics to figure out what piece of the text in your artwork should be replaced by a variable. Example: a phone number has a pattern: 650 123-4567, so EGG looks for the pattern, three digits any character, three digits, any character, and four digits and turns this into a phone variable. A name is recognized if a line starts with a common first name. If found, EGG replaces this line with the variable stanza used for first name, middle initial, last name and name suffix.
If you have text in your artwork that should be excluded from variable recognition, you select this text and convert it to paths/outlines. As explained above, EGG makes two files, one file with the static art (an EPS by default) and a style file with the layout, font and color definitions and variables.
How does EGG find out how big your item should be and where the origin of the coordinates are? Well that's where the bounding box comes in. Each EPS file has a bounding box, the box that fits snugly around all artwork. EGG uses the bounding box as the reference. But the creator of the EPS file needs to make sure that the bounding box will be set right. You do that by drawing a rectangle around the all artwork, exactly the size of your product. Make this box with no fill and no stroke. This box in your design program is often referred to as the bounding box in PageDNA speak.
When doing variable recognition EGG works on lines or chunks of lines. Normally changing a font (like font size or font face) in the middle of a line will start a new line chunk. In determining these line chunks, EGG handles mixed fonts and smallcaps. For example EGG will recognize when the digits in a street address have a different font size then the other characters. Or the @ in the email address has a different font face. Without expert fonts, EGG recognizes smallcaps by the different sizes of the capital letters of the same font. So even if the font changes inside a street address or email address, EGG will still put these in the same line chunk, and will be able to find a variable.
Understanding these concepts, and using the directions given in the following sections will help you reaching good results and not only when you make artwork from scratch. The sections will also tell you how use the "Advanced Options" to your advantage when dealing with an existing file.
EGG has rather sophisticated variable recognition for finding variables like name, street, city, phone number and so on. As already explained in a previous section, this is based on common patterns. You can make up names/streets/phones etc., but use examples following the usual pattern. See the examples below.
Example: John Smith, Ph.D Vice President 123 Main Street, Anytown, CA 98765
However, the following will NOT work, because it doesn't follow the pattern.
Example that does NOT work:
First Name Last name
Title
Address Line
City, State ZIP
In the following list are the variables EGG recognizes. Note that the official list with the literal variable names can be found at "Form Field Name Reference".
A line with a company name (card_company) if the company name
has one of the following suffixes: Inc, LLC or Ltd
Example text in EPS: Acme Sprockets Inc Variable in style: card_company Example text in EPS: Adobe Systems Incorporated String in style: 'Adobe Systems Incorporated' # no Inc, LLC or Ltd
A name as long as the first name is a common name, including a name with a name
suffix in a different font. In case of a different font for the name suffix the suffix
needs to be common, like jr, sr or a common academic title, MBA or BS. Variable names
are: name_prefix, name_first,
name_middle, name_last and
name_suffix. Since in a name line the prefix, middle initial and the
suffix are optional, a name line is a construct with IFs. See the example below for the
whole stanza:
Example text in EPS: John Smith
Variable in style: IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, IF(', ', name_suffix),
Example text in EPS: Mrs. Jane Doe
String in style: 'Mrs. Jane Doe' # name with prefix not recognized
A line with a street address. Or a street address followed by a suite, apartment or
floor. Variable names are: card_street1 and
card_street2.
Example text in EPS: 1023 Corporate Way
Variable in style: card_street1
Example text in EPS: 1023 Corporate Way, Suite 250
Variable in style: card_street1, IF(', ', card_street2) # card_street2 optional
Example text in EPS: East Main
String in style: 'East Main' # not starting with a number
# no street indicator, like Street, Avenue
A city, state zip code line. Including a zip code in a different font. If you want
the zip code recognized on a line by its own (no preceding city, state) use the bracket
notation or one of the words 'ZIP', 'Postal code' or 'Postcode' (without the quotes).
See the sample business card example at the end of the section for the bracket notation.
The variables for city, state zip code are: card_city,
card_state and card_zip
Example text in EPS: Redwood City, CA 94061
Variable in style: card_city, ', ', card_state, ' ', card_zip
Example text in EPS: Redwood City CA 94061
String in style: 'Redwood City, CA 94061' # no comma after city
A line with only a country. Variable name card_country.
Example text in EPS: Canada
Variable in style: card_country
A line with a phone number, US format or international format. A phone number is
usually translated into a PhoneWord, like Phone1Word. There are six
PhoneWords, 1 to 6 (Phone6Word). A PhoneWord is a shorthand for
multiple variables in which the different parts of a phone number are stored. See "PHONEWORD". for details. Make sure you use
different numbers, otherwise you end up with several phones with the same variable.
Example text in EPS: cell: 650 123 4567
Variable in style: IF(ph1_label, ' ', Phone1Word) # label can be optional
A line with either a web address or an email address. Variables are
card_www and card_email.
Example text in EPS: www.example.com
Variable in style: card_www
Example text in EPS: jane@example.com
Variable in style: card_email
Example text in EPS: https://www.example.com
String in style: 'https://www.example.com' # https protocol not recognized
If you already know what variable names you want you can tell EGG what these variable are by using the square bracket notation, see following example:
Instead of having a line reading: 2055 East Main Street You can do: [card_street1]
As a more complete example of the variables EGG recognizes, compare the example business card below with the output of EGG. The variables in the blocks are shown below the image. Note EGG will actually name the blocks from "Block1" to "Block4"
Below is the relevant part of the EGG output after running the card in the image above:
NameBlock
F2, IF(name_prefix, ' '), name_first, ' ', IF(name_middle, ' '),
name_last, F3, IF(', ', name_suffix), NEWLINE,
F4, card_title1, NEWLINE,
F5, 'Financing Division', NEWLINE, # Note: this is not recognized
AddressBlock
F4, card_company, NEWLINE,
card_street1, NEWLINE,
card_street2, NEWLINE,
card_city, ', ', card_state, ' ', card_zip, NEWLINE,
PhonesBlock
F4, IF(ph1_label, ' ', Phone1Word), NEWLINE,
IF(ph2_label, ' ', Phone2Word), NEWLINE,
IF(ph3_label, ' ', Phone3Word), NEWLINE,
card_email, NEWLINE,
BottomPhoneBlock
F1, IF(ph4_label, ' ', Phone4Word), NEWLINE,
Although we recognize that good use of custom kerning can make for beautiful artwork, for use with EGG the story is a bit different. Why? Well, first of all our typesetting engine has no optical kerning algorithm. Second, EGG can only determine the right tracking and accounting for kerning if the kerning table is available. Finally, since the whole point of EGG is to make variable imprint possible which means the of optical kerning in the original artwork is lost anyway.
Using optical kerning makes the tracking/kerning recognition less reliable and the results will suffer. A telling sign of EGG having trouble with the kerning and tracking is when there are a lot of fonts that have all parameters the same except the tracking/kerning. By default EGG groups similar tracking together. There is an option in the "Advanced Options" where you can change the grouping such that the tracking differences are less refined, which can help fixing the issue of to many fonts in the artwork: "Group Join Threshold". If this option is set to a higher value EGG will group more fonts with similar tracking together into one font. For use with EGG it is best just keep it at tracking with or without kerning from the kerning table. Hopefully you have that choice.
EGG usually does a pretty good job of figuring out alignment. To have that to work reliable, alignment needs to be relatively accurate. For example, if lines in a block of text are badly aligned, EGG ends up creating more then one block, each on top of each other. There are options in the "Advanced Options" to try to fix this, but having the alignment accurate to begin with avoids fixing it up later. The options in "Advanced Options" that tries to fix misalignment are: "Line Up Fudge Horz", helps when you have more then one block instead of one because the lines don't align very well. Note this can happen with left, right or center alignment that is off. "Line Up Fudge Vert", helps when you have more then one block where there should be one because the lines parts are not on the same y coordinate.
It might be not so obvious, the space between the blocks of text on your artwork is important too. If lines belonging to different blocks but on the same y position are to close together, EGG gets confused and merges these lines together, putting the merged lines as one line in the left block. Avoid this situation if you can (i.e. blocks to close). If you cannot, there is an option, the "Mis-merged Block Fix" option, in the 'Advanced Options' that will try to fix this if it is turned on. Note: we don't turn this on by default since it can cause splitting up a block in more the one block.
Table of Contents
A QR Code is a matrix code (or two-dimensional bar code) created by Japanese corporation Denso-Wave in 1994. You can add these to printed products for a variety of purposes. One usage is to put a printed code on a physical good or item. When an appropriately-configured smart phone takes a photo of this image, the user can be taken directly to a website.
Our QR code support extends to correctly encoding an incoming data string into a QR code and adding the code to your item. The data string you send would need to include any commands that are needed to make the code work. It is up to you to define how the data is encoded.
For example, an application on the iPhone needs the data to be set in a specific order and possibly in a specific way. We don't know what that is. For example, it may need to be street1 comma street2 or street1 tab street2. Does city state and zip need to be together or separate? You need to determine this before you attempt to install or manually code for a QR code.
The following Item Form example shows the user being able to upload a QR code as an image, e.g. JPG, or enter text for their QRCode... there are many free web-based services that allow users to create QR Codes... one is http://www.beqrious.com/generator
![]() | Important |
|---|---|
When working in Visual Style Editor (VSE), the QRCODE command can be used in the Blocks tab. Any logic controlling it would then need to be in the Preblocks tab. Our QR code generator can be used with an absolute size constraint, or with a scale factor, or with no constraint. If there is no constraint, the QR code will automatically size to accommodate the data and you may need to allow room for the QR code to resize. Using a size constraint can cause a problem if there is too much data because the barcode scanner may not be able to read the QR code. So, you will need to limit the amount of data the user is allowed to enter. The QRCODE command has a default size. The default size can be multiplied by a scale factor. For example: after the data is converted to a QR code, if the default size of the QR code is 50 x 50 points and the scale factor is 1.5, the QR code will be 75 x 75 points. Below are examples of applying a size constraint to a QR code and a scale factor. The code for the block itself is missing. Please see below for the QRCODE command being used inside a block. (You can replace 'text' with a variable.) Example of a size constraint:
QRCODE('text', 120)
Example of the application of a scale factor:
QRCODE('other text', scalefactor=1.5)
|
Change the Color and/or Background Color of the QR Code:
You can change the color of a barcode by defining a color in the Colors tab of Visual Style Editor and calling it following the QRCODE command. Please refer to the QR code's documentation and/or the barcode scanner's documentation to make sure the color is supported. This is the correct method because QRCODE is not a font. For example:
QRCODE('text', color=C1)
You can add a background color as follows:
QRCODE('text', backgroundcolor=C2)
Combined, they would look like this:
QRCODE('text', color=C1, backgroundcolor=C2)
The variables used in the sample code for the style below appear in green in the screenshot above.
The lower part of the form in the screenshot above allows the user to either upload a file with their QR code or type in their own URL for the QR code.
Now lets go to the style. The examples below cover both a manually entered QR code and an uploaded file.
1) Allowing the user to manually enter their QR code requires logic. So, you will need to go to the Other tab of VSE and enable Blocks Logic.
Now go to the (newly enabled) Preblocks tab and add this:
# give error if user gives neither upload nor free text code
if not (code_name or qrcode):
COND("You must either upload a QR code or use the free-text input")
# pre-emptively clear front side logo
# if free text QR code input is present
if code_name and qrcode:
qrcode = ''
Now, you need to go to the Postblocks tab and add the following, which sets a fixed size of 120 points with logic to apply a scale factor.
# set the QRCode from manual input if present
QRBlock = DWIMBLOCK([LEFT, QRCODE(code_name, 120)
], (12, 12), (LEFT, BOTTOM), layer=-1)For the x-coordinate, LEFT, CENTER and RIGHT anchor points are supported. For the y-coordinate, BOTTOM, MIDDLE and TOP anchor points are supported.
2) If you allow the user to upload their QR code, you will use the Blocks tab to place the uploaded QR code:
Examples of QR code scaling:
The following code can be used as is or altered as needed to add a meCard to an item. In this case, it is designed to center on the back of a business card. meCards are typically 90 x 90 points. meCards are generally not scaled up or down, and we do not recommend scaling them. If you need to use a scalefactor, set a fixed size or color the meCard, please see the documentation for Add a QR Code to a Business Card and be sure to test the meCard with a smartphone.
If you are adding a meCard to a style using Visual Style Editor (VSE), Block Logic needs to be enabled and this code needs to be added to either the Preblocks tab or Postblocks tab. Please see VSE Preblocks and Postblocks Tabs on enabling Block Logic. The block named QRCodeBlock below sets a size constraint (following the QRCODE command) of 90 points for all four sides.
# calculate meCard info. For this instance:
# (if using international phones, change '+ph11+ph12+ph13+' to '+ph1+')
mecard = 'MECARD:N:'+name_first+' '+name_last+';'
mecard += 'TEL:'+ph11+ph12+ph13+';'
mecard += 'EMAIL:'+card_email+';'
adr = card_street1
if card_street2:
adr += ', ' + card_street2
adr += ', '+card_city+', '+card_state+' '+card_zip
mecard += 'ADR:'+adr+';'
if card_www:
# NB not in form
mecard += 'URL:'+card_www+';'
mecard += ';'
QRCodeBlock = DWIMBLOCK([CENTER, QRCODE(mecard, 90)], (122, 67.5), (CENTER, MIDDLE))
The result should look something like the following:
The following code can be used as is or altered as needed to add a VCard to an item. If you need to alter the code, please consult the specifications for VCard at http://en.wikipedia.org/wiki/VCard.
In our experience Vcards may not work well if a great deal of information is passed because the barcode gets compressed and becomes too difficult to read. You may have better results passing less information or changing to use an meCard, which uses fewer variables and runs a lesser risk of being compressed to the point of not being readable. Documentation for meCard can be found here.
In the sample code below, the VCard is designed to center on the back of a business card. VCards are typically 90 x 90 points. VCards are generally not scaled up or down, and we do not recommend scaling them. If you need to use a scalefactor, set a fixed size or color for the VCard, please see the documentation Add a QR Code to a Business Card and be sure to test the VCard with a smartphone.
If you are adding a VCard to a style using Visual Style Editor (VSE), Block Logic needs to be enabled and this code needs to be added to either the Preblocks tab or Postblocks tab. Please see VSE Preblocks and Postblocks Tabs on enabling Block Logic.
The block named CodeBlock below uses hard coded phone labels and sets a size constraint (following the QRCODE command) of 90 points for all four sides.
The code below has been updated for Unicode support, e.g. UTF-8 encoding, and should support non-Latin-1 character sets, e.g. Slavic characters.
![]() | Important |
|---|---|
The code below is for you to copy and paste into a style. PageDNA Support has received reports that the indents are not always retained. The indents are critical. Indents have a minimum of 2 spaces and should left align. |
def vcard_line(left, right):
charset=''
if isinstance(right, unicode):
right = right.encode('UTF8')
charset=';CHARSET=utf-8'
return '%s%s:%s\n' % (left, charset, right)
vcard = 'BEGIN:VCARD\n'
vcard += 'VERSION:2.1\n'
vcard += vcard_line('N', name_first+';'+name_last)
vcard += vcard_line('FN', name_first+' '+name_last)
vcard += vcard_line('ORG', card_company)
vcard += vcard_line('TEL;WORK;Phone', ph1)
vcard += vcard_line('TEL;Cell', ph2)
vcard += vcard_line('TEL;Fax', ph3)
vcard += vcard_line('EMAIL;PREF;INTERNET', card_email)
adr = card_street1
if card_street2:
adr += '; ' + card_street2
adr += ';'+card_city+';'+card_state+';'+card_zip
vcard += vcard_line('ADR;WORK', adr)
if card_www:
# NB not in form
vcard += vcard_line('URL', card_www)
vcard += 'END:VCARD'
CodeBlock = DWIMBLOCK([CENTER, QRCODE(vcard, 90)], (126, 72), (CENTER, MIDDLE))
If you need to add a plus sign in front of all phones, add the following before the very first line of the code above:
if ph1:
ph1 = ('+' + ph1)
if ph2:
ph2 = ('+' + ph2)
if ph3:
ph3 = ('+' + ph3)
If you are collecting US or Canadian domestic style phones on the Personal Page or Item Form using three separate fields and need them displayed in the VCard as such, e.g. 333-333-3333, change the phone section to this:
vcard += vcard_line('TEL;Phone', ph11 +ph12 +ph13)
vcard += vcard_line('TEL;Direct', ph21 +ph22 +ph23)
vcard += vcard_line('TEL;Mobile', ph31 +ph32 +ph33)
The format for adding a title is as follows:
vcard += vcard_line('TITLE', card_title1)
Following is a list of error messages you may encounter when building Styles, along with an explanation that may help you get to the bottom of the issue.
If the code asserts something that is false, this happens. We don't use assert statements in the code, so this should not come up.
Attribute error means the code checks for an attribute of an object that has not been defined. For example, BLOCKS, WORDS, etc... are all objects and have attributes like "width". You get it by typing "b.width", if b is one of your blocks. "b.banana", or "b.witdh", would be AttributeErrors.
This means our code tried to read past the end of a file. Regarding Styles, it means one section did not end with a newline. Go to the end of the text area for that section and type return, so the file ends with a newline. Failing that, it may mean an embedded .eps file ended unexpectedly.
This gives the programmer a useful way to add new error handling. For example, the Style artisan could type this in a code section:
#begin example try: AddressBlock = DWIMBLOCK(...) except: raise AddressError #end example
If any problem occurred, the traceback would say 'AddressError', and quickly guide you to the problem area. We added two Exceptions to VIPER: StyleError and TypesetError. These are discussed at the end of this list of built-in Exceptions.
This is a hardware error. We don't expect to see this occur.
This means something went wrong while talking to the file system. In Styles, it would usually mean a permissions error, perhaps because the web user (http) did not have read-permission on either the Style, or a logo, or something like that. If you see "IOError: Device Full", call PageDNA and tell us the hard drive is full, ASAP.
May occur when trying to import a module that is not found. Call PageDNA.
This means you looked for the 11th goose when there were only 5 geese.
#begin example l = ['a','b','a','c'] e = l[4] #end example
The above code causes IndexError, because l has only 4 items, which are accessed by l[0], l[1], l[2], and l[3]. In Python, l[-1] gives the last item, and so on, but l[-5] would be an IndexError in this example.
This is similar to IndexError, but applied to dictionaries.
#begin example
guest_ages = {'Al':50, 'Joan':26, 'John':42, 'Frank':29, 'Lisa':36}
Only applies to command line scripts.
This would reflect a hardware problem. Call PageDNA in the unlikely event of MemoryError.
The code attempted to get the value of a variable that did not exist. All variables must be defined in the "Order" section.
Hardware error, call PageDNA if this ever occurs.
This is a compile time error. Here are examples:
#begin examples
a = [3, 4, 5) # that's not a list or a tuple... a liple?
a = # you may only use newlines inside {,[,(,""",
# and these must be closed off by a matching },],),"""
a = {1:'a' 2:'B'} # must be a comma between each two dict entries
a = . # that's just silly
#end examples
Syntax errors will become the easiest to see and fix, with Python familiarity.
This could apply to a number of issues; call PageDNA for support.
Functions raise this when arguments have the wrong type.
#begin example
b = DWIMBLOCK('hello')
#end example
Wrong number of arguments is in this category as well.
The code tried to treat a variable as a variable of another type
#begin example a = 1 + 'hello' #end example
Dividing anything by 0 causes this error.
This is a wrapper for any error that occurs while Python is constructing LINES, BLOCKS and other objects. These are displayed on the notorious red screen in S.E.G.
This is a wrapper for an error occurring as the objects render themselves in postscript. This means it was a subtle enough bug that it got though the construction of the Style objects, but somehow blew up later. Also displayed on the red screen.
name_first
First Name
name_middle
Middle Name
name_last
Last Name
name_suffix
Name Suffix
card_title1
Title 1
card_title2
Title 2
card_title3
Title 3
card_street1
Street Address, Line 1
card_street2
Street Address, Line 2
card_street3
Street Address, Line 3
card_city
Street Address, City
card_state
Street Address, State
card_zip
Street Address, Postal Code / ZIP
card_region
Street Address, Country
ph1_label
Phone 1, Label
ph11
Phone 1, Area Code
ph12
Phone 1, US Style Phone Number, Bit 1
ph13
Phone 1, US Style Phone Number, Bit 2
ph1_ext_lbl
Phone 1, US Style Extension Label (e.g., ‘Ext.’)
ph14
Phone 1, US Style Phone Number, Extension
ph2_label
Phone 2, Label (same as Phone 1, up to six phones)
card_department
Card Department
card_division
Card Division 1
card_division2
Card Division 2
corp_tag
Site Division - Internal "tag"
corp_longname
Site Division - Long Name
card_email
Users Email Address
Not every Field is included in this list.
To find a field name for a field on your form, simply "View Source" within your web browser while on that HTML page and examine the code to find the field name directly from the source.
VIPER requires true Postscript type 1 or TrueType fonts. PostScript Type 1 fonts can be self-uploaded using the instructions below. TrueType fonts require (free) uploading help from support but note that they cannot be embedded into our press-ready files at this time. See below for instructions for both types of fonts.
A list of all installed fonts (listed by formal PostScript name) available to you can be found at:
http://www.nationsprint.com/hub/font/showfonts.cgi?text=1
Please note that PageDNA requires that any customer using a particular font own a license to that font (locally) if opting for us to include fonts in typeset artwork files.
Note on Compressing Fonts: Please note that the ZIP compression format often breaks font files. If you intend to use the ZIP format to send font files to PageDNA for loading, please first uncompress the ZIP file locally and confirm that the font files are not 0 Byte files. The "Stuffit" compression tool prevents these sorts of glitches from occurring and is recommended.
About Open Type Fonts (OTF):PageDNA supports the Latin 1 set of characters for Open Type fonts. What this means is that only a portion of the font's glyphs may be available to use with our software. In general, the "lower 256" glyphs are most of the commonly used glyphs for a type face. In some cases, characters such as old style numbers may be set while roman numerals are available in a different section of the font. If your typesetting requirements are such that a specific subset of characters is required for your product, a custom font may be needed. There are companies that can make fonts or customize them for you. There are also tools, such as Fontographer, that you can use to create or customize a font. How to load Open Type Fonts is covered in Procedure C.4 below.
Procedure C.1. TrueType Font Loading - All Platforms
STEP 1:
Compress all font files and email them to to support@PageDNA.com. We will load the fonts, usually within 1 business day. We may require your help to test that the font names we assign are correct after the fonts have been loaded. You will receive instructions following our upload of these fonts on how to help us confirm fonts were named correctly.
The utility that we are currently using to convert TrueType fonts to Postscript fonts is called TrueBlue and can be found here: http://www.stone.com/TrueBlue/TrueBlue.html
TrueBlue has worked for us on Mac OS 10.4 and it may work for you as well.
Procedure C.2. Postscript Type 1 Font Loading - Macintosh OS X w/ Adobe Illustrator 10
STEP 1:
Make sure fonts needed are loaded on the Macintosh you are working on.
Beware that some font name are imitations of well known fonts (for example, "Swiss" is really "Helvetica").
If the font still cannot be found, you will need to purchase the font from a type foundry:
STEP 2:
Open Adobe Illustartor 10 and create a new file. Files must be created in Adobe Illustrator 10. Saving down from a newer version will not work. Add a single line of text for each font required, set in the font needed. You can add as many fonts at a time as you want.
Let's say we needed to get three fonts uploaded this round:
Bauhaus Light
Formata Bold
Formata Light
First we need to create three lines of text in the Illustrator document, each set in one of the fonts we would like to upload. It is not important that the text be on it’s own line, or what type you use in the document. What is important is that you make sure EVERY font you want to upload is used at least once in your document.
| a <- set this letter in Bauhaus Light | b <- set this letter in Formata Bold | c <- set this letter in Formata Light |
STEP 3:
Save the file as an Illustrator version 8.0 eps file.
Select File - Save as. In the Save As dialog box select Illustrator EPS.
In the EPS Format Options dialog box; select Compatibility - Version 8, uncheck all options except Include Document Fonts and save.
Save the file somewhere convenient (Desktop) and name it something you will remember ("bauhaus.eps" for example).
STEP 4:
Upload this file to the server.
Visit the Font Loader at:
http://www.nationsprint.com/hub/font/
Click "Browse..." and find your PostScript file on the Desktop. Then click "Submit". Uploading your PostScript file may take a while, depending on your connection speed. When the upload has completed, you will get a message asking you to move on to the Font Loader, found at:
http://www.nationsprint.com/hub/font/loadfont.cgi
Visit this link.
STEP 5:
Inside the Font Loader, you should see your PostScript file name somewhere in the leftmost column, with each font in that file listed in the next column. The last column will say "Yes" or "No", depending on whether or not the font is already in the system. If you do not see anything in the right column, there was a problem in the process – contact PageDNA support for help.
To upload all the fonts that are not in the system yet, simply click the PostScript file name (displayed in bold), and the page will refresh. You should see "Yes" listed next to each font in your file, showing that the fonts are now available. You may also click individual font names to upload them to the server.
A list of all installed fonts (listed by formal PostScript name) can be found at:
Procedure C.3. Postscript Type 1 Font Loading - PC/Windows
STEP 1:
Make sure fonts needed are loaded on the PC you are working on, and that they are Type 1 Postscript fonts, not TrueType fonts such as Verdana, Tahoma, etc. TrueType fonts require our involvement, see above.
STEP 2:
Locate the .pfb file for each font. Usually these files are best found by doing a wild-card search for '*.pfb' in Windows.
STEP 3:
Upload this file to the server.
Visit the Font Loader at:
http://www.nationsprint.com/hub/font/
Click "Browse..." and find your PostScript file on the Desktop. Then click "Submit". Uploading your PostScript file may take a while, depending on your connection speed. When the upload has completed, you will get a message asking you to move on to the Font Loader, found at:
http://www.nationsprint.com/hub/font/loadfont.cgi
Visit this link.
STEP 4:
Inside the Font Loader, you should see your PostScript file name somewhere in the leftmost column, with each font in that file listed in the next column. The last column will say "Yes" or "No", depending on whether or not the font is already in the system. If you do not see anything in the right column, there was a problem in the process – contact PageDNA support for help.
To upload all the fonts that are not in the system yet, simply click the PostScript file name (displayed in bold), and the page will refresh. You should see "Yes" listed next to each font in your file, showing that the fonts are now available. You may also click individual font names to upload them to the server.
Procedure C.4. How to Load Open Type Fonts (.OTF)
These instructions walk you through how to upload Open Type Fonts to the Page DNA system. These instructions are only for .OTF files. In the example below we've used the font Viceroy-Bold to demonstrate. As with any font you upload to, or use with, the PageDNA system you responsible for ensuring that you have obtained the proper usage rights before sending or using that font.
To begin go to the PageDNA Hub and click on the link for the Font Loader.
Use the Choose File button and locate the font you wish to upload from your computer. Once you have that selected click the Upload Font File button.
The next screen confirms that the file was loaded. If the number of bytes listed is zero (0) then please contact support@PageDNA.com for assistance in getting your font loaded. .
If you have several fonts that you need to upload you can load them all by repeating step #2 and #3 before proceeding with the next steps.
When you have uploaded all your font files, click on the link for loadfont.cgi.
The font will appear on a table like the one below and will be named in using the convention font-name.otf. In this example it is Viceroy-Bold.oft. Click on the link that is the font name to install the font in to our system.
You may receive an error message at the top of the page in red. You may disregard the error. Your font should now be displayed twice; once with a .otf extension and once with a .pfb extension. Click on the link for font-name.pfb. In this example is will be Viceroy-Bold.pfb.
Upon successful upload and conversion in to our system, your font should now appear with a green highlight and the Installed to GS column should be labeled "yes".
Now that the font has been placed in the PageDNA system you will need to use the name exactly as it is listed in the Extracted Fonts column when calling that font from your item's style.We recommend that you copy and paste the file name in to your style to avoid typos.
Kerning refers to the process of manually or automatically adjusting the space between the individual characters in typeset text, normally done so that the type looks balanced. For example the capital letters "A" and "W" can be slid together because of the way the letters are formed, where as the letters "W" and "W" would not be allowed to fit together as closely.
We do not have 'automatic' kerning in our system, whereby certain letters 'automatically' move closer together based on character geometry. InDesign offers this and calls it "Optical Kerning".
That said, we do have limited support for loading custom kerning tables... many fonts have a table of kerning pairs called an ".afm" file. If you can get the .afm file for a font you use (normally these are available in the set of font files provided by a type foundry), we may be able to load it and your kerning pairs will be honored. Just send us the file and we'll see if we can activate this for your fonts. We will need an .afm file for each font face you are using.
Alternatively, in many cases our customers have reported that simply adding a slight bit of negative tracking to a font can bring the letters closer together (although uniformly) such that intra- character distances are less noticed. Tracking is the third number in a font definition - making it something like -10 or -20 might be enough if you'd like to try this approach.
Variables are placeholders for information that is added from another process or place.
The power of the PageDNA software is variable imprint. For example the first and last name on a business card are provided by the user when placing an order and inserted in to the template (also called a style) at the time the print ready file is created; thereby producing a finished card with the user's name.
In this example there is a placeholder in the style called 'name_first'. This is a variable. When the user fills in their first name on the order form, that name will take the place of the variable 'name_first' in the style. And that is what's rendered on the finished card.
Variables can be ones that are pre-defined in the PageDNA system such as in the case of name_first and name_last, or they can be defined by the builder inside the style or item form. Variables can be named almost anything as long as they are unique to each style and are not one of the variables already defined within the system. There is a full list of the PageDNA predefined variables at the end of this article.
How Are Variables Collected?
Variable inputs are collected from the very start of the ordering process. Users may be asked to fill in a profile with their name, titles, address, and contact information. Each line or input is a variable that holds information about the user which may be different from one user to the next.
The profile information is then passed along the ordering process to the personal or item form. The personal form (shown below) is made up of a set of predefined variables (marked in green) which PageDNA has identified as being the most commonly used.
How Are Variables Used?
During the order building process all of the places in the style that have variables are replaced by the information provided from the input forms. For example, the variable name_last will now become the actual last name that the user provided in the form. This is how the EPS and PDF output files are created.
Beyond Predefined Variables
PageDNA knows that the list of predefined variables cannot begin to cover the wide array of possible needs that your job may require. To allow for maximum flexibility we've created the Form Editor tool(example pictured below). The Form Editor allows a builder to create almost any new variable input that could be required. For further information on how to use the Form Editor click here: http://www.nationsprint.com/hub/docs/html/SiteConfiguration/custom-item-forms-form-editor.html
List of PageDNA Predefined Variables
Here is a list of the standard variables that every non-static item has pre-defined inside it.
Phone1Word
Phone2Word
Phone3Word
Phone4Word
Phone5Word
Phone6Word
affil (affil)
bullet (bullet)
bullet2 (bullet2)
beeper (card_beeper)
city (card_city)
company (card_company)
country (card_country)
department (card_department)
department2 (card_department2)
department3 (card_department3)
division (card_division)
division2 (card_division2)
email (card_email)
email2 (card_email2)
email3 (card_email3)
email4 (card_email4)
ms (card_ms)
region (card_region)
st (card_st)
state (card_state)
street1 (card_street1)
street2 (card_street2)
street3 (card_street3)
street4 (card_street4)
street5 (card_street5)
suite (card_suite)
title1 (card_title1)
title2 (card_title2)
title3 (card_title3)
title4 (card_title4)
title5 (card_title5)
www (card_www)
www2 (card_www2)
zip (card_zip)
copyright (copyright)
email1tag (email1tag)
email2tag (email2tag)
email3tag (email3tag)
email4tag (email4tag)
emdash (emdash)
endash (endash)
include_beeper (include_beeper)
include_www (include_www)
include_www2 (include_www2)
intl (intl)
mail_city (mail_city)
mail_country (mail_country)
mail_st (mail_st)
mail_state (mail_state)
mail_street1 (mail_street1)
mail_street2 (mail_street2)
mail_street3 (mail_street3)
mail_street4 (mail_street4)
mail_street5 (mail_street5)
mail_zip (mail_zip)
name_first (name_first)
name_last (name_last)
name_middle (name_middle)
name_prefix (name_prefix)
name_suffix (name_suffix)
ph1 (ph1)
ph11 (ph11)
ph12 (ph12)
ph13 (ph13)
ph14 (ph14)
ph1_ext_lbl (ph1_ext_lbl)
ph1_label (ph1_label)
ph2 (ph2)
ph21 (ph21)
ph22 (ph22)
ph23 (ph23)
ph24 (ph24)
ph2_ext_lbl (ph2_ext_lbl)
ph2_label (ph2_label)
ph3 (ph3)
ph31 (ph31)
ph32 (ph32)
ph33 (ph33)
ph34 (ph34)
ph3_ext_lbl (ph3_ext_lbl)
ph3_label (ph3_label)
ph4 (ph4)
ph41 (ph41)
ph42 (ph42)
ph43 (ph43)
ph44 (ph44)
ph4_ext_lbl (ph4_ext_lbl)
ph4_label (ph4_label)
ph5 (ph5)
ph51 (ph51)
ph52 (ph52)
ph53 (ph53)
ph54 (ph54)
ph5_ext_lbl (ph5_ext_lbl)
ph5_label (ph5_label)
ph6 (ph6)
ph61 (ph61)
ph62 (ph62)
ph63 (ph63)
ph64 (ph64)
ph6_ext_lbl (ph6_ext_lbl)
ph6_label (ph6_label)
ph7 (ph7)
ph71 (ph71)
ph72 (ph72)
ph73 (ph73)
ph74 (ph74)
ph7_ext_lbl (ph7_ext_lbl)
ph7_label (ph7_label)
phtype (phtype)
registered (registered)
trademark (trademark)
www2_optional (www2_optional)
www_optional (www_optional)
F.1. | Why does Illustrator not open my file correctly? |
Our system generates PostScript and PDF files directly, not using a predefined application structure like Illustrator. We have found that Illustrator does not parse generic PostScript files in the same way that a printer would. Unfortunately we can’t change Illustrator. | |
F.2. | Can I use logic across Styles? |
No, unfortunately this is not supported. Please make a feature request. If the logic in question is generally useful we make make a new COMMAND for you! You can make several items use the same style though. | |
F.3. | Add border to photo in VSE |
1) Edit the block with the photo. 2) Click the link to Switch to edit in normal block edit window 3) Your code should look something like this: BORDER(EPSWORD(photo, resize=(59.219, 79.92), yscale=1.0, xscale=1.0, crop=1), 2, C2) This will yield a border that is 2 points in width using the color defined for C2 in the colors tab. If a black border is needed, a color named BLK or blk will need to be defined in the Colors tab of VSE. (The word "black" is a reserved word and cannot be used.) Please note that after you click OK after editing the block, the graphic representation in VSE will turn the block to a small dot. For additional information about the BORDER command, please see http://www.nationsprint.com/hub/docs/html/StyleBuilding/BORDER.html | |
F.4. | How do I convert a variable to a number? |
Because you need to catch the possibility that the user typed in a bad value, you need to do this before you can use a variable as a number: try: var = float(var) except: var = 0.0 Now you can use var in a block or anywhere else as a number. | |
F.5. | Why can't I change the font of a phone number? |
Most likely you are trying to place a font tag like this: F1, For emergency service, please call this large-font phone number at, F2, Phone1Word, F1, immediately. The F1 tags will affect the text, but font control over all of the Phone#Words is handled in the phones tab of the style. In cases where you need the same phone number set more than once in different fonts, and you aren’t using Phone2Word and Phone3Word, you can assign the contents of Phone1Word to the other two, and change the fonts used by the other words. To do this, enable "Pre and Post-blocks" in the Other tab of your style, and in the Pre-Blocks tab, enter the following: if intl: Phone1Word = WORD(ph1, F1) Phone2Word = WORD(ph1, F2) Phone3Word = WORD(ph1, F3) else: Phone1Word = PHONEWORD(F1, (ph11, ph12, ph13), '*.*.*') Phone2Word = PHONEWORD(F2, (ph11, ph12, ph13), '*.*.*') Phone3Word = PHONEWORD(F3, (ph11, ph12, ph13), '*.*.*') In this case, all three phone numbers will be assigned the contents of Phone1Word, all with different fonts. This will also allow for both international as well as domestic (US) Phone numbers, and assumes periods are the separator between the area code, prefix, and 4 digits. | |
F.6. | I'm seeing additional items in my uploaded EPS file than I see in my Illustrator file. Where are those items coming from? |
Most likely the original Illustrator file had additional elements that had been hidden. Saving to Illustrator 8 EPS reveals previously hidden items. If you open the original Illustrator file, and choose "Show All", previously hidden items will be shown and can either be deleted, or moved to a separate document or layer. | |
F.7. | Can I send fonts without stuffing them? |
You can send fonts from a Mac without stuffing them if you are using Mail.app as your email client. Otherwise, you need to use StuffIt to send the font. | |
F.8. | Can I use my TrueType fonts? |
Yes, we can use your TrueType fonts in the PageDNA system. However, because of the nature of TrueType fonts, they must be sent first to PageDNA, where we will convert the font into a format which can, if needed, be embedded in EPS files. In most cases, the font can be converted without trouble. There are occasionally caveats, such as if certain font characters are incorrectly named in the TrueType font; we have other tools which can usually correct such problems. | |
F.9. | Formatting Python code |
When you write Python code, PageDNA recommends a two-space indent. For example: if not card_www.startswith('http'):
card_www = 'http://' + card_www | |
F.10. | With a max block height, the font used to scale vertically to fit in the allotted space. How can I get that old behavior back? |
Indeed, we improved the "fit in allotted space" by scaling the font’s point size. However, you can get the old "squishing" behavior back, just follow the recipe below. First you need to remove the maximum height of the block, and don’t worry we will fix that later. Then you need to add two lines of code, one to fix the maximum height again and one to actually apply the "squishing", so the text fits in that maximum height by vertically scaling the font. If you use VSE, you need to enable the "Postblocks" tab (if you don’t see a "Postblock" tab, you enable that on the "Page window" accessible on the "Blocks" tab, check on the "Enable" check box there and click "Apply"). So suppose your block name is "MyBlock", then the needed code is: # Make sure the max height is removed from the DWIMBLOCK command (when using a code window like in SEG) # or the "MyBlock" block's settings (when using VSE) # For VSE put the following in "Postblocks"
# For SEG ("Blocks" is a code text area) put this code after the "MyBlock" DWIMBLOCK commandMyBlock.maxheight = 20 # set the maximum height MyBlock.adjust_for_maxheight() # apply the "squishing", vertical font scale | |
F.11. | How do I link/unlink a style which is shared across multiple items ? |
Linking happens at the item level. Use the Item editor to edit the item in question; edit the custom section and then scroll down until you see Template Style. To link to another style, select that style (by item tag) from the list. To unlink, set the list to the blank option and save. If you are unlinking a style, you may need to create a new style to go with the item. Click on the style link to open a page which will show the style creation tools. | |
F.12. | How do I share only the back style on a two sided item |
If you have a two sided item, the custom tab in Item Editor will have a drop down select list labeled: Template Back Style. This list is a list of existing back styles of other two sided items. Selecting a back style will share that back style. To unlink the current selected back style, just select the blank option. Note that linking the front style of a two sided item to the front style of another item will also share the back style. | |
F.13. | I used the Auto Generate Catalog Preview tools and my images aren't the same. Why? |
Check the preview section of the front and back styles - any difference in size may lead to unexpected results. Also check the page size and bleed settings as well. | |
F.14. | How do I print the quantity of the item on the 'shiplabel' for that item? |
You need to enable shipping labels, it’s the Menu entry Shipping Label Setup and check Shipping Labels for each order item. Then edit the shiplabel.sty (or whatever name you gave it, shiplabel.sty is the default) and put something like this in the blocks section of that style: w, h = __pagesize__ try:
ItemQtyBlock = DWIMBLOCK([LEFT, F1, item.longname, ', Qty: ', str(item.qty), NEWLINE],
(w/2, h/2+50), (CENTER, CENTER))
except:
ItemQtyBlock = DWIMBLOCK([LEFT, F1, 'No item available', ', Qty: ', str(0), NEWLINE],
(w/2, h/2+50), (CENTER, CENTER))The try/except is to allow for testing in SEG, because the variable item might not be present. | |
F.15. | Only the variable information for my item showed up in an order. The static artwork was missing. What happened? |
The mostly likely cause of this is that the static artwork of your item is set to a preview layer in the item’s style. To make sure that it will display in your proof and also be passed along with the rest of the item’s information, you’ll need to change the layer assignment for your background art. This section of our Help documents should help you with this process: http://www.nationsprint.com/hub/docs/html/StyleBuilding/stacking_layers.html | |
F.16. | How do I list an item in more than one tab of the catalog? |
Items can only exist in one tab of the catalog at a time. However you can easily clone an item so that that a copy of that item can appear in another tab. If the item is inventory controlled, the system can link multiple items to the same inventory pool. Search docs for "stock tag" for more on that topic. | |
F.17. | How can I have my phone labels show up after the phone number on my variable imprint items? |
You can use PhoneWords as a single variable to combine the phone label with the formatting of your phone numbers. But PhoneWords in VSE only allow for the phone labels to be placed before the phone number. To set your phone label after (to the right) of the phone number, you will need to format the PhoneWord without a phone label, and call them separately within your style block. Here is a sample of how that would look: F1, Phone1Word, ' ', ph1_label, NEWLINE As a rule, PageDNA Support recommends you enclose a PhoneWord, the separating space and phone label in an IF statement to prevent the space or phone label from printing if the phone number is missing, no matter whether the phone label precedes or follows the PhoneWord. This is how it would look: F1, IF(Phone1Word, ' ', ph1_label), NEWLINE | |
F.18. | My files seem to be too large for the PageDNA system. What should I do? |
Our recommended maximum file size is about 30 MB. You may be able to reduce the file size by: 1) Removing clipping masks and making sure that any images do not exceed the dpi you need for printing. Clipping masks can be removed in PhotoShop. You would then use this image to replace the existing image. 2) Make sure that none of the art is outside the bounding box. 3) Remove unneeded layers or colors. 4) If your file size is still too big, you can try saving as Illustrator v.10 | |
F.19. | How do I remove a shared item form from an item? |
From the Item Editor, edit an item and select the Form link. In the Shared Item Form drop-down list, select new and leave the field blank. Click the Save button. The Shared Item Form will be disassociated from the item. | |
F.20. | My items are using large image files and take a long time to proof, what can I do speed up proofing? |
The larger an image is, the longer it will take to proof. Try the following steps to speed up proofing time without reducing the quality of your production artwork:
This should speed up your proofing process, while still passing the large image files to production. | |
F.21. | How do I draw and place a colored rectangle in my item's style? |
With C2 defined as a color in the Colors tab in VSE (or the Fonts tab in SEG), place the following in either the Preblocks or Postblocks tabs of VSE: # Draw a rectangle that is 200 points wide by 18 points high filled with the color defined as C2 R1 = RECTANGLE(200, 18, color=C2) # Position the rectangle in a block in layer -5 centered on 165 points with the top starting at 192 points RecBlock = DWIMBLOCK([R1], (165, 192), (CENTER, TOP), layer=-5 ) How to draw a black or white rectangle: The names WHITE and BLACK are reserved words that can be called if you need to use them as a color for the rectangle as follows: # Draw a rectangle that is 200 points wide by 18 points high with a white fill R1 = RECTANGLE(200, 18, color=WHITE) This will work in SEG, and the PreBlocks and PostBlocks tabs of the VSE. The terms WHITE and BLACK will not be recognized in the Blocks tab of VSE. If you need to define black and white as colors in the Colors tab of VSE or in the Fonts tab of SEG, these need to be defined as CUSTOMCOLOR. You will need to use something other than "black" or "white" because these are reserved words. Use something like BLK or WHT instead. You still have to place the rectangle in a block, as above. | |
F.22. | Fonts are displaying incorrectly in my production files, what can I do? |
When editing your item’s style, click on the Page Icon in VSE or the Other tab in SEG. About two thirds of the way down is a checkbox to include fonts. Checking this box will add more size to the final production file, but may help alleviate font viewing issues. Remember, your production department/vendor will still need to have fonts required for production installed locally in their system. | |
F.23. | My user's uploaded images are not appearing in style. Is there a troubleshooting guide? |
Try these steps to correct that issue 1) Ensure that the Conversion Options for the upload input in the form is set to Color or Black & White. 2) Check that the variable name in the form matches the variable name in the style Picture Block. 3) Ensure your layers are structured such that the photo is visible (e.g. not below another image). 4) Do not set a Filename Path. This is only done for images stored on your site after having used the File Uploader. 5) Do not choose a file. This is only done for images that will appear on each and every proof. 6) Do not select a file from the drop-down list. This is only done for images that will appear on each and every proof. | |
F.24. | How do I hide the personal form sections for an item? |
Visit Item Editor, edit your item therein. Now click the "form" link. Uncheck the appropriate sections of the personal form to turn them off. Save changes. Be sure to cancel your order and start over to see the change reflected on the site. | |
F.25. | How do I display options as images next to radio buttons in an Item Form? |
Follow these steps: 1) For each option, create a small thumbnail the size you want to display, and name it, eg: option1.jpg, option2.jpg, etc. 2) Upload these images into the con directory using File Uploader in the menu. 3) Use some html next to your text for the choices(remember, each option is on its own line). For example: option1|<img src="con/option1.jpg"> option2|<img src="con/option2.jpg"> For information on setting up forms, please search our documentation using the search words: dynamic forms | |
F.26. | How do I use COL but add a space buffer? |
You can add a buffer in a couple of ways. Try this code using spaces: ph1_label, ' ', COL, Phone1Word, NEWLINE, ph2_label, ' ', COL, Phone2Word, NEWLINE, That will add three hardcoded spaces in front of the COL for the longest label, which is what sets where the COL is placed. You could also use a SPACER command for more accuracy, setting the space in a precise number of points: ph1_label, SPACER(5), COL, Phone1Word, NEWLINE, ph2_label, SPACER(5), COL, Phone2Word, NEWLINE, | |
F.27. | My multiline text field doesn't wrap when set |
When using a multiline text field, you will need to do two things to get it to wrap: 1) Use the LINEWRAP command at the beginning of the block. The LINEWRAP command will honor hard returns entered by the user. 2) You will need to set a limit the block width. Without a block width limit, the LINEWRAP command does not know when/where to wrap the text. Documentation for LINEWRAP can be found here: http://www.nationsprint.com/hub/docs/html/StyleBuilding/LINEWRAP.html Documentation to set block width when working with VSE can be found here: http://www.nationsprint.com/hub/docs/html/StyleBuilding/vse-blocks-tab.html An example of setting a block width limit of 72 points in SEG is as follows: Block0 = DWIMBLOCK([CENTER, LINEWRAP,
F2, multiline_text, NEWLINE,
], (128.0, 32.3), (CENTER, TOP_BASELINE), (72, 0))Note the 72 point width limit at the end of the block. | |
F.28. | How do I make sure a specific character is included in a field--like the @ in an email address? |
You can add code to your styles to check for a specific character in a specific variable. This code is placed in the Blocks tab in SEG, or in the Pre- or PostBlocks tabs when using VSE. For more information on enabling block logic in VSE, please search our documentation using the search words: blocks logic The following code sample shows how to check for @ in card_email, and return an error if it’s not found: if card_email.find('@') == -1:
COND("Your email is not formatted correctly. Please check your email address, and proof again.")Note: You can put in any message you want between the quotation marks for your error statement. | |
F.29. | A timestamp, address or user name shows up after the product name in my basket. Can I change this? |
Yes you can. This product long name is controlled in the custom tab of Item Editor for each item. To show just the product name itself with no additional information, simply enter this in the Longname Fmt field: %(longname)s You can also add additional code to the name to make it include hard coded text, or pull in information from other item form variables. See the note below the Longname Fmt field for formatting instructions. | |
F.30. | How do I make a field required in the style instead of the personal or item form? |
If you need to make a field required but other items use the same personal or item form, and you do not want to create another personal or item form, you can make the field required at the style level. For example: If the department (card_department) is required on the letterhead, but not on the business card, and you want to use the same form for both items, you can make the field required in the style for the letterhead. If you are using Visual Style Editor (VSE), you will need to enable Block Logic and enter the following in the style’s Preblocks tab. If you are using Style Editor Gold (SEG), you can enter the following in the style’s Blocks tab An advantage to adding the errors in the style is that you get to add the error message exactly how you would like it to appear. if not card_department:
COND('You must provide your Department Name. ')That statement reads if the value of the variable card_department is blank then display the Condition statement listed in the string to the user. | |
F.31. | How do I prevent a file from being sent based on a condition? |
When you edit a variable two-sided item and select the Custom link, you will find an option to not send files for the back style. However, if you need to prevent a file from being sent based on a condition, you can use COND_EMPTY in a style. The difference between a style that is completely blank, and one which uses COND_EMPTY is that the former will send files via email, export, and imposition, while the latter will not. In Visual Style Editor (VSE), you need to enable Block Logic and place this code in the Preblocks or Postblocks tabs. Here are two examples of the use of COND_EMPTY: 1) Do not send a file for the back style if the website is missing. if not card_www: COND(COND_EMPTY) 2) The back has the website and a user-selected logo. If both are missing, no file should be sent: if not card_www and not card_logo_variable: COND(COND_EMPTY) | |
F.32. | How do I replace or remove a character? |
To replace a character you will need to know the octal code for the replacement character. Octal codes for often used glyphs can be found in the Variables tab of a style, e.g. bullet, emdash, endash, ®, etc. You can replace a hyphen with an emdash as follows: variable_name = variable_name.replace('-', '\x81')You can remove a character, like a hyphen and not replace it, so what precedes the hyphen and what follows it are combined into one word as follows: variable_name = variable_name.replace('-', '')(There is no space between the last two single quotes.) | |
F.33. | Can PageDNA set type in a foreign language? |
We only support typesetting in Latin-1 encoded languages, such as Spanish or French. We cannot set type in Cyrillic or Asian fonts, including West Asian like Arabic or Hebrew. | |
F.34. | How can I set dingbats or wingdings? |
Dingbats and wingdings are types of fonts that fall outside the "normal" definitions. In order for the font to work you need to select NONISOFONT from the drop list of types in the fonts tab when you create the font. You can also change the font type after you have created the font. By default the Change Type drop-down list is set to FONT. Please search for NONISOFONT in our documentation to read more. | |
F.35. | Can I use the colors black or white in my style? I get an error when I use them. |
You will probably encounter an error if you use the colors black or white in a style when defining a color in the Colors tab of Visual Style Editor (VSE), in the Fonts tab of Style Editor Gold (SEG), or when using the RECTANGLE or BORDER commands because they are reserved words. In VSE’s Colors tab, you need to use an abbreviation like WHT or BLK in the Colorname field. In SEG’s Fonts tab (where you also define colors), you need to also use an abbreviation, for example: C1 = CUSTOMCOLOR(WHT, 0.00, 0.00, 0.00, 0.00) Where the CMYK values are all zero. C2 = CUSTOMCOLOR(BLK, 0.00, 0.00, 0.00, 1.00) Where CMY are all zero and K is 1.00 (indicating 100% black) Documentation for VSE can be found here: http://www.nationsprint.com/hub/docs/html/StyleBuilding/editing-styles-using-style-editor-gold.html Documentation for the CUSTOMCOLOR command used in SEG can be found here: http://www.nationsprint.com/hub/docs/html/StyleBuilding/CUSTOMCOLOR.html Documentation for RECTANGLE can be found here: http://www.nationsprint.com/hub/docs/html/StyleBuilding/RECTANGLE.html Documentation for using BORDER to add a dynamic border around a photo can be found here: http://www.nationsprint.com/hub/docs/html/StyleBuilding/faq.html#d0e8071 | |
F.36. | How do I enable a link to download a PDF for the proof? |
To allow for the download of a PDF at the proof step in the ordering process, edit the style and go to the Preview tab. First configure the "normal" view without enabling the PDF checkbox. Then, edit the "small" view. Enable the "small view and its PDF checkbox. |