Unitfly Toolkit for M-Files logo color

Document Processing

Document Processing module offers a way to configure advanced state actions, often used in document approval process, such as PDF conversion and adding watermark or signatures to documents. These actions are set and configured using a set of rules in application configuration and added to selected states automatically.

Configuration #

  • Open M-Files Admin
  • In the left-side tree view, expand the desired connection to M-Files Server.
  • In the left-side tree view, expand the Document Vaults node.
  • Still, in the left-side tree view, expand the vault where you installed the connector and select Configurations.
  • Expand Other Applications
  • Expand Extension Kit
  • Click on Document Processing

Field Description #

FieldValueDescription
NameTextSpecifies the rule group name.
Rule groups[n] > Group [n] > Rule [n]
NameTextSpecifies rule name.
DescriptionTextOptional rule description.
EnabledYes/NoSpecifies whether the module is in use.
WorkflowWorkflowWorkflow filter for states.
Configuration ModeSimple/AdvancedDisplay simple or advanced configuration options for rule.
Workflow stateStateWorkflow state in which selected action will be executed.
Business criticalYes/NoIf set to Yes, rule will be logged in SEQ.
Rules > Rule [n] > Filter conditions [n]
Search ConditionsSearch ConditionsOptional additional conditions that the parent object needs to satisfy.
Conditions inside a single filter are combined with AND, while multiple filters are combined with OR operator.
Rule groups[n]>Group[n]>Rules[n]>Rule> State actions [n]
NameTextSpecifies action name.
DescriptionTextOptional action description
EnabledYes/NoSpecifies whether the action is in use.
ActionOne of the following:
• ConvertToPdf
• RestoreOriginal
• AddWatremark
• AddSignature
• RemoveWatermark
• RemoveSignature
• MergeDocuments
• UndoPdfConversion
• UndoMergeDocuments
Type of action that will be executed when object enters workflow state.
Rule groups[n]>Group[n]>Rules[n]>Rule> State actions [n]>Act as user
placeholderText[n]TextFilename wildcards used to select files from objects on which action will be executed.
Remove any
existing watermark
or signature
Yes/NoSpecifies whether any existing watermark or signature previously added to the document will be removed before adding a watermark specified in this state.
Rule groups[n]>Group[n]>Rules[n]>Actions > Add watermark > Configuration > Watermarks > Watermarks [n]
TextTextText that will be added as a watermark.
On pagesOne of the following:
• All
• Even
• Odd
• First
• Last
Pages the watermark will be added to.
ColourColour pickerColour of watermark.
Colour opacityInteger between 0 and 100Opacity of watermark.
SizeIntegerFont size of watermark text.
Rule groups[n]>Group[n]>Rules[n]>Actions > Add signature> Configuration>Actions > Add signature
Signature typeOne of the following:
• Text
• Image
Type of signature to add to document.
Text. When this option is selected, text is used as a signature. This text can be static, but it can also contain property values from the source object.
Image. When this option is selected, image is used as a signature. This image can be static, located on a server, or it can be a file on the source object, or on some object that can be referenced from the source.
TextText configurationThis is shown only if Signature type is Text.
ImageImage configurationThis is shown only if Signature type is Image.
Add to pagesOne of the following:
• All
• Even
• Odd
• First
• Last
Pages the signature will be added to.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n]> Add Signatures> Configuration > Signatures > Signatures [n] > Location on page
AnchorOne of the following:
TopLeft;
• TopCenter;
• TopRight;
• BottomLeft;
• BottomCenter;
• BottomRight;
Anchor to use when positioning signature.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n]> Add Signatures> Configuration > Signatures > Signatures [n] > Location on page > Offset
XIntegerOffset from anchor along the X-axis.
YIntegerOffset from anchor along the Y-axis.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n]> Add signature > State [n] > Signatures > Signatures [n] > Text
TextTextText that will be added to the document.
ColourColour pickerColour of the watermark.
Colour opacityInteger between 0 and 100Opacity of watermark.
SizeIntegerFont size of watermark text.
Draw borderYes/NoEnabling drawing border around the text signature.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n]> Add signature > State [n] > Signatures > Signatures [n] > Text > Draw border > Border config
Border opacityNumberOpacity of the border
Border colourColour pickerColour of the border.
Border offsetNumberPixels from the edge of the text to the edge to the border.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n] > Add signature > State [n] > Signatures > Signatures [n] > Image
Image typeOne of the following:
• FromPath
• FromObject
FromPath. Specifies that the image to use is a file located on the server.
FromObject. Specifies that the image to use is a file on the source object, or on some object that can be referenced from the source.
PathText(Displayed only if Image type is FromPath)
Full image file path.
PropertyPlaceholder editor(Displayed only if Image type is FromObject)
Property expression from the source object to the object that contains an image. Leave empty if file is located directly on the source object.
Filename wildcardText(Displayed only if Image type is FromObject)
Filename wildcard used to fetch the appropriate file from object.
Max width (in points)IntegerResize image so that its width is not greater than the selected width, expressed in points. Image will keep its original proportions when resized. Recommended width for Signature images is 110 points.
Max height (in points)IntegerResize image so that its height is not greater than selected width, expressed in points. Image will keep its original proportions when resized.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n] >Merge Documents>Configuration>Filename wildacrds [n]
placeholderTextTextFilename wildcards are used to select files from the object on which action will be executed.
It will be used as a source object and if you choose to add another file it will be merged into this pdf.
Rule Groups[n]>Group[n]>Rules[n]>State Actions [n] >Merge Documents>Configuration-Merge files
Insert locationOne of the following:
• Start
• End
• AfterPage
Location in the document where the file(s) will be inserted.
Start – file(s) will be added at the start of the ‘source’ document
End – file(s) will be added at the end of the ‘source’ document
Afterpage – file(s) will be added after the selected page
Delete file on mergeYes/NoWhether to file should be deleted on object after merging or not.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n] >Merge Documents>Configuration-Merge files> Insert location> AfterPage
PageNumberPage of original object after which file(s) will be inserted.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n] >Merge Documents>Configuration-Merge files>File
ModeOne of the following:
• SourceObject
• CustomObject
• Reference
Object selection mode.
CustomObject – select any custom object from the vault.
Source – select current source object.
Reference – select any reference of the source object.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n] >Merge Documents>Configuration-Merge files>File>CustomObject
Search conditionsSearchConditionsConditions for finding custom object.
Filename wildcardPlaceholder editorFilename wildcard used to select a file from the object.
For example, if the system found a multi-file document as a source, you can specify which file will be used for merging. Also, universal wild card pattern * is supported.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n] >Merge Documents>Configuration-Merge files>File>SourceObject
Filename wildcardPlaceholder editorFilename wildcard used to select a file from the object. Also, the universal wild card pattern * is supported.
Rule groups[n]>Group[n]>Rules[n]>State Actions [n] >Merge Documents>Configuration-Merge files>File>ReferenceExpression
Reference expressionProperty reference expressionUse if the file for merging is on related objects.
Filename wildcardPlaceholder editorFilename wildcard used to select a file from the object. Also, the universal wild card pattern * is supported.
Advanced settings
Retry interval (milliseconds)IntegerRetry time interval for failed actions.
Number of retriesIntegerMaximum numbers of times COM errors are retried.
Time to wait (milliseconds)IntegerNumber of milliseconds to wait before executing any rule in the background.

Use cases #

Customer is using watermark for all not approved contracts #

Customer is using M-Files as an enterprise content system for the almost entire business. They are managing opportunities, proposals, commercial contracts, business contracts, employee contracts and other different documentation and information. They are creating documents in M-Files, and all documents are created from templates and go through the Document Approval workflow (Picture 1). They wanted to avoid that contracts are sent to a customer before being reviewed, approved and active.

Picture 1. Document Approval Workflow

With Document Processing they solved their case by converting document to PDF when document is created from Word template. Document have “Draft” watermark on all pages.

Configuration of Document Processing #

In “Draft” state, customer added watermark with “DRAFT” text on all document pages (Picture 2).

document processing configuration - adding watermark in M-Files document
Picture 2. Configuration – Add watermark

When documents are approved and active, we don’t need “DRAFT” text as now we have an official document. In state Active, the customer configured that watermark is removed (Picture 3).

document processing configuration - removing watermark in M-Files document
Picture 3. Configuration – Remove watermark

In very simple ways, customer made all contracts “safe” from the business perspective and less liable for human error or edgy manipulation.

Stamping documents when they are approved #

Customer wanted to add a stamp on the last page of a document and convert it to PDF so that they can guarantee that document and their approval process. That process customer easily solved with Extended document processing, and signature option like it’s shown on Picture 4.

document processing configuration - adding stamp in M-Files document
Picture 4. Configuration – Add stamp on the last page

Specifies whether any existing watermark or signature previously added to the document will be removed before adding the watermark specified in this state.

Your one-stop hub for Unitfly Toolkit for M-Files!

Unitfly Toolkit Community is live!

News and updates on our products • Frequently asked questions • Support page