User Manual

3.113 Replace Text

Updated on

In this article, you will learn

  • which prerequisites are required for this Fixup, and
  • how to apply this Fixup.

1. Introduction

The Fixup Replace Text is available in the Workflow. The purpose of this Fixup is to search for text within the file and replace it with new text.

2. General

The Fixup Replace Text can be used to correct text or to personalize Templates. During execution, the system searches for the specified text and then replaces it with the text to be replaced.

You can find this Fixup on the tab Data Preparation of an Article, Order or Production Job by:

  • entering the name of the Fixup in the area Filter,
  • activating the option Text in the area Category,
  • activating the option Change in the area Action,
  • activating the option Text in the area Property.

3. Description

Use this Fixup to quickly and easily correct specific text parts within the file. To do this, enter the text to be edited and replace it with the desired content. Characters that are not embedded in the PDF can only be used if the corresponding font is available in the font directory.

Use this Fixup for the following purposes:

  • Correct spelling mistakes.
  • Replace placeholder text in a source file based on the content of a User-defined Field, and thus implement a mini PDF solution.

3.1. Prerequisites and Functionality

For the Fixup to perform as intended, the following requirements must be met:

  • There are text objects in the file.
  • Fonts do not have to be embedded; however, in this case, only characters that are already used in the file can be replaced.
  • The font should be available in the font directory.

Figure 1: The dialog of the Fixup Replace Text

The following options can be selected to replace text:

  • Templates [1] – settings selected in the dialog can be saved as a template and applied to other Articles/Print Items, as well as used within Fixup Chains and in the Operations Apply Fixups and Check Print Item and Apply Fixups.
  • Operators [2] – use the dropdown menu to define how the text in the input field Search for (text) should be matched. The following options are available:
    • Equal to – the text entered in the option Search for (text) must exactly match the text in the file that is to be edited.
    • Matches with RegEx – the text entered in the option Search for (text) corresponds to a RegEx expression.
    • Variable Content [9] – for Variable Content [9], select the desired placeholder – Database Field or User-defined Field – from which the value for the operator should be retrieved. The following values must be present in the selected field for the selection to be created:
      • equal_to
      • regex
  • Search for (text) [3] – enter the text to be edited or the RegEx expression in this field, depending on the selected operator. For Variable Content [10], select the desired placeholder – Database Field or User-defined Field – from which the value for the text you are searching for should be retrieved.
  • Replace with [4] – enter the corrected replacement text here. For Variable Content [11], select the desired placeholder – Database Field or User-defined Field –  from which the value for the new, corrected text should be retrieved.
  • Truncate Replaced Text [5] – select how the replacement text should be truncated. The following options are available:
    • Do not truncate – the full replacement text is inserted without cropping.
    • Truncate text – only a defined part of the replacement text is used, starting from the beginning, middle, or end. Enter the required number of characters in Options [6]. Guidance on valid values is provided in the info box [12].
    • Substring of Text – only a selected substring of the replacement text is used. Enter the desired number of characters in Options [6]. The values required to achieve the desired result are shown in the info box [12].
  • Text Alignment [7] – use the dropdown menu to select how the replacement text should be aligned. The following options are available:
    • Left-justified – the replacement text is aligned to the left.
    • Right-justified – the replacement text is aligned to the right.
    • Align centered – the replacement text is aligned in the middle (centered).
    • Justified – the replacement text is inserted as justified text.
    • Variable Content [13] – for Variable Content [13], select the desired placeholder – Database Field or User-defined Field – from which the value for the text alignment should be retrieved. The following values must be present in the selected field for the selection to be created:
      • left_aligned
      • right_aligned
      • center_aligned
      • block_aligned
  • Font Directory [8] – enter the path to the directory containing the fonts to be used.

Figure 2: Left: Values in the selected field for the option Operators; Right: Values in the selected field for the option Text Alignment

3.2. Before/After

To experiment with this function, refer to the sample file "Sample_Replace Text.pdf". The file contains several text elements. The word "Fixup" appears at the top of the file and should be replaced with "Fixup Replace Text". The font for this line is Arial, and the text is embedded.

After applying the Fixup, the file "Sample_Replace Text_End.pdf" is created. The specified text passage has been successfully replaced with the new text. The values from Figure 1 were used.

Figure 3: Left: Original file; Right: Edited file in which the text line has been corrected

Article update: Workflow 1.20.1 – 04/2025

Previous Article 3.112 Replace Dieline for Regular Shape
Next Article 3.114 Resize TrimBox