uImage Functions
uImage functions enable you to create personalized images and illustrations dynamically during composition. These functions leverage Adobe Photoshop and Illustrator templates to generate customized graphics based on recipient data, allowing for sophisticated image personalization such as personalized product mockups, custom certificates, dynamic maps, and individualized promotional graphics.
Additional Resources: For comprehensive details on defining and generating personalized images, including template setup and configuration in uPlan, refer to the uImage online help. Video tutorials are also available at campus.xmpie.com.
uImage.uImage function
The uImage.uImage function creates personalized images from a Photoshop document package (.dpkg). This function processes the specially prepared Photoshop document contained in the package, generating a unique image for each recipient based on their data.
This function returns a Graphic asset that can be used in graphic ADORs.
Syntax
uImage.uImage(packageName, outputFolder, outputFilename, outputType, tagName, tagValue [, ...])
| Parameter | Description |
|---|---|
| packageName | Required. The name of the Photoshop document package (.dpkg) to use as the template. |
| outputFolder | Required. Output folder. Leave empty ("") for default output folder. |
| outputFilename | Required. Output filename. Leave empty ("") to name automatically. Prepend with "OPT:" for optimization that avoids creating images that have already been created. (For example, when image with the same tagValues has already been processed.) |
| outputType | Required. Output format. (One of: "JPG", "EPS", "PSD", or "PNG".) Additional format dependent settings are also available. |
| tagName | Required. Name of a tag or placeholder inside the Photoshop file. |
| tagValue | Required. Value to place into the Photoshop tag. In most cases, this will be the content object or variable containing the recipient firstname, company name or other data that is to be used in Photoshop. |
| Further tagName and tagValue pairs | Optional. Additional name/value pairs can be appended if the Photoshop template contains multiple tags. |
Examples
-
Create personalized certificates with recipient name:
uImage.uImage("Certificate.dpkg", "", "", "JPG", "FullName", |->[FullName])
Result: Generates personalized certificate images using the recipient's full name in the designated text layer. Saved into the default output folder and named automatically.
-
Create product mockup images:
uImage.uImage("ProductMockup.dpkg", "", "OPT:" & |->[Product Name], "JPG", "product_code", |->[Product Code])
Result: Personalized product mockup images. Saved by the product name into the default output folder, and skipping duplicate product names.
-
Create personalized images with multiple data points:
uImage.uImage("IDCard.dpkg", "", "", "PNG", "Name", |->[EmployeeName], "Department", |->[Department], "Photo", |->[PhotoFile])
Result: Generates an ID card images with name, department, and employee photo.
Note: The Photoshop document package must be properly configured in uPlan with defined variable layers before it can be used with this function. See the uImage online help for template preparation guidelines.
uImage.CreateImage2 function
The uImage.CreateImage2 function creates personalized images from a Photoshop template. This is an legacy function provided for backward compatibility to allow personalized image generation directly from Photoshop (.psd) file.
This function returns a Graphic asset that can be used in graphic ADORs.
Note: It is recommended to use a Photoshop document package and the uImage.Image function instead of using a Photoshop file directly. The Photoshop document package includes the Photoshop file together with any fonts, actions, and other information to ensure smooth production and avoid errors from missing components.
Syntax
uImage.CreateImage2(templateName, outputFolder, outputName, outputType, openingAction, closingAction, copyFittingMode, copyFittingMethod, tagName, tagValue [, ...])
| Parameter | Description |
|---|---|
| templateName | Required. The name of the Photoshop file to use for image generation. |
| outputFolder | Required. Output folder. Leave empty ("") for default output folder. |
| outputFilename | Required. Output filename. Leave empty ("") to name automatically. Prepend with "OPT:" for optimization that avoids creating images that have already been created. (For example, when image with the same tagValues has already been processed.) |
| outputType | Required. Output format. (One of: "JPG", "EPS", "PSD", or "PNG".) Additional format dependent settings are also available. |
| openingAction | Required. Name of an action or script to use when the Photoshop file is first opened and before adding tag values. (Use "NO" for no action, "ACN=folder\\action" for an action, or "SCR=C:\\folder\\script.js" for a script.) |
| closingAction | Required. Name of an action or script to use after tag values are added and before the Photoshop file is closed. (Use "NO" for no action, "ACN=folder\\action" for an action, or "SCR=C:\\folder\\script.js" for a script.) |
| copyFittingMode | Required. Copyfitting mode. "OFF" = none, "OF" = overflow, "UF" = underflow, "B" = both underflow and overflow. |
| copyFittingMethod | Required. Copyfitting method. "HS" = horizontal scale, "FS" = font scale. |
| tagName | Required. Name of a tag or placeholder inside the Photoshop file. |
| tagValue | Required. Value to place into the Photoshop tag. In most cases, this will be the content object or variable containing the recipient firstname, company name or other data that is to be used in Photoshop. |
| Further tagName and tagValue pairs | Optional. Additional name/value pairs can be appended if the Photoshop template contains multiple tags. |
Examples
-
Create a personalized promotional image:
uImage.CreateImage2("PromoTemplate.psd", "", "", "JPG", "NO", "NO", "OF", "HS", "firstname", |->[FirstName])
Result: A personalized promotional graphic using the recipients firstname, with no opening or closing scripts, and horizontal scaling applied only if the name overflows the tag in Photoshop.
-
Create a personalized product image with customer name:
uImage.CreateImage2("C:\\Templates\\ProductLabel.psd", "C:\\Output", "OPT:Lable_for_" & |->[CustomerName], "EPS", "NO", "NO", "OFF", "HS", "firstname", , |->[CustomerName])
Result: Generates a product label EPS graphic with the customer's name, no copyfitting and saving the output into a specific folder including the customer name in the filename and optimized to avoid duplicate work.
-
Create a personalized banner with multiple elements:
uImage.CreateImage2("WebBanner.psd", "", "", "PNG", "NO", "NO", "OF", "FS", "firstname", |->[FirstName], "code", |->[OfferCode], "expiry", |->[ExpiryDate])
Result: Generates a web banner personalized with name, offer code, and expiration date.
uImage.CreateIllustration2 function
The uImage.CreateIllustration2 function creates personalized illustrations from an Adobe Illustrator template. This function enables vector-based personalization, which is ideal for graphics that need to scale without quality loss, such as logos, diagrams, and technical illustrations.
This function returns a Graphic asset that can be used in graphic ADORs.
Syntax
uImage.CreateIllustration2(templateName, outputFolder, outputName, outputType, openingAction, closingAction, copyFittingMode, copyFittingMethod, tagName, tagValue [, ...])
| Parameter | Description |
|---|---|
| templateName | Required. The name of the Illustrator template to use for illustration generation. |
| outputFolder | Required. Output folder. Leave empty ("") for default output folder. |
| outputFilename | Required. Output filename. Leave empty ("") to name automatically. Prepend with "OPT:" for optimization that avoids creating images that have already been created. (For example, when image with the same tagValues has already been processed.) |
| outputType | Required. Output format. (One of: "JPG", "EPS", "GIF", "PNG", "SWF", or "AI".) Additional format dependent settings are also available. |
| openingAction | Required. Name of an action or script to use when the Illustrator file is first opened and before adding tag values. (Use "NO" for no action, "ACN=folder\\action" for an action, or "SCR=C:\\folder\\script.js" for a script.) |
| closingAction | Required. Name of an action or script to use after tag values are added and before the Illustrator file is closed. (Use "NO" for no action, "ACN=folder\\action" for an action, or "SCR=C:\\folder\\script.js" for a script.) |
| copyFittingMode | Required. Copyfitting mode. "OFF" = none, "OF" = overflow, "UF" = underflow, "B" = both underflow and overflow. |
| copyFittingMethod | Required. Copyfitting method. "HS" = horizontal scale, "FS" = font scale. |
| tagName | Required. Name of a tag or placeholder inside the Illustrator file. |
| tagValue | Required. Value to place into the Illustrator tag. In most cases, this will be the content object or variable containing the recipient firstname, company name or other data that is to be used in Illustrator. |
| Further tagName and tagValue pairs | Optional. Additional name/value pairs can be appended if the Illustrator template contains multiple tags. |
Examples
-
Create a personalized illustration:
uImage.CreateIllustration2("DiagramTemplate.ai", "", "", "EPS", "NO", "NO", "OF", "HS", "firstname", |->[FirstName])
Result: A personalized vector illustration
Template Preparation
Before using uImage functions, templates (or document packages) must be prepared in Adobe Photoshop or Illustrator. Refer to the uImage online help or the following tutorials and training for more information.
Tutorials and training
How create font-based uImage effects
How to use a Photoshop document package with uCreate Print
Using multiple text layers in uImage
Creating Image or picture font effects with uImage
Using Photoshop actions with uImage
More topics
Asset Functions - Functions for working with static assets
Conversion Functions - Functions for converting between data types
String Functions - Functions for text manipulation
GetEnv Functions - Functions for accessing environment information