Home Search

DriveWorks Pro 22
PDF: Replace Keyword

Send Feedback

PDF: Replace Keyword

This Specification Flow Task will find and replace instances of a Keyword, in selected PDF document pages.

Properties

Property NameDescription
TitleChanges the Title (not the name) of the task.
PDF File The full file path to the PDF document to be edited.

Relative paths are resolved to the Specification directory if no prefix is defined.

Accepted prefixes: <Project>, <Specification>, <SpecificationMetadata>, <GroupContent>

Page RangeUse '*' or leave empty to select all pages.

Also accepts pipebar delimited list of page numbers, e.g. '1|2|3', or a range using a hyphen, e.g. '1-3'.

KeywordThe Keyword to be replaced.

Keyword replacement is case sensitive.

The Keyword can include spaces.

If the Keyword is matched within a longer word it will still replace the declared string.

New KeywordThe replacement for the original Keyword.

If replacing text in a paragraph, the New Keyword should be of the same length or shorter than the Keyword. This will stop text overlapping on the next line.

Keyword IndexThe instance of the keyword to replace on the target pages.

Zero (the default value) can be used to replace all instances of the keyword.

This is the index of the Keyword on each page declared in the page range.

This field only accepts a single Keyword Index value. If you would like to replace a different index of the Keyword on each page, you will have to combine multiple instances of this Task.

Example

When this Task is added the properties are static. To be able to build rules on a static property see How To: Change A Static Property To A Dynamic Property.

Property NameExample RuleMeaning
PDF File"D:\DriveWorks\ProductGuide.pdf"Will remove pages from the ProductGuide.pdf document.
Page Range"*"Will replace the found Keyword on all pages..
Keyword"Black"Will find the word Black.
New Keyword"Blue"Will replace the keyword with the value Blue.
Keyword Index0Will replace all instances of the keyword on each page.

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:

Success

  • Successfully replaced all keywords.

Success with Warnings

  • N/A - Should never be fulfilled.

Failed

  • The PDF file could not be found or accessed.
  • The file given does not have a valid .pdf extension.
  • The page range is invalid or refers to pages which do not exist.