Blog Post

Specifying Filtering Criteria When Automatically Applying Watermarks in SharePoint

Clavin Fernandes
Illustration: Specifying Filtering Criteria When Automatically Applying Watermarks in SharePoint

In our previous posts we established that the new ‘ Automatic application of watermarks when a document is opened’ functionality of the Muhimbi PDF Converter for SharePoint is the coolest things since…well… this stuff. Today’s post goes into more detail and shows how automatic watermarking can be taken to the next level by specifying search filters.

This post is the third in a four part series:

  1. Applying user specific watermarks when a PDF document is opened in SharePoint.

  2. Merging dynamic data into watermarks using the PDF Converter for SharePoint.

  3. Specifying filtering criteria when automatically applying watermarks. ( This Post)

  4. Apply User Specific PDF Security when a document is opened in SharePoint.

Similar to the way SharePoint views can be filtered to only display certain list items, Muhimbi’s automatic watermarking facility allows filters to be created that determine which documents should be watermarked automatically, and which shouldn’t. The possibilities are endless, but some obvious examples are listed below to whet your appetite:

  • Apply watermarks to draft documents, but not to approved documents.

  • Always apply watermarks to a document created by a user from a particular domain or authentication provider (e.g. FBA)

  • Watermark a document, based on the current date, for embargoed documents.

  • Enable watermarks on all documents with ‘Confidential’ in the Title.

  • Apply watermarks to minor versions ( e.g. 1.3 ) of a document, but not to major versions (e.g 2.0).

  • Only apply watermarks to certain content types.

image

Fortunately this powerful new functionality is very easy to use as you can see in the screenshot above. Each watermarking section comes with a separate Filter that contains the following fields:

  • Apply Filter: A simple check box that allows filtering to be enabled or disabled. When disabled, watermarks are automatically added to all documents.

  • Field List: A list of fields that can be used to apply filters on, e.g. Title, Author, Content Type, etc.. This is a ‘sanitised’ list similar to the one displayed in SharePoint’s own View filter. Non sensible ‘for internal use only’ fields are automatically stripped out.

  • Comparison Type: Specify the kind of comparison to use, e.g. ‘ is equal to’, ‘is greater than’, ‘contains’, ‘begins with’ etc.

  • Comparison Value: The value(s) to compare the selected field with. Full details are provided below.

It is in the Comparison Value field where things become interesting as all comparisons take the underlying type of the column into account. All common data types are supported, specifically:

  • Boolean: Accepts the following for True: True, Yes, -1, 1 and False, No, 0 as False.

  • Currency: Allows currency comparisons. Please use numbers only, do not specify the currency symbol.

  • DateTime: Allows date and time fields to be compared. As of version 5.1 you can enter [Today] (including the square brackets) to compare a date field to the current date, e.g. to apply watermarks to documents modified today. Similarly [Now] can be used to compare a field with the current date and time.

  • Lookup: Compare lookup fields, including lookups that may contain multiple values.

  • User: Compares fields that contain a reference to a user account, e.g. the Modified By field. Filters of this type expect a value recognised by the underlying Authentication Provider. This will usually be in the ‘ domain\user_name’ format, but could also be ‘ fbaprovidername:username’.

    As of version 5.1 it is possible to enter [me] (including the square brackets) to evaluate the field against the current user. This allows, for example, watermarks to be added to all documents not created by the current user.

  • Single and Multiple choice fields: Allows single and multiple values to be matched, particularly useful with the ‘contains’ comparison type. Examples and details are provided below.

  • Numerical fields: Carries out numerical comparisons.

  • URL: Can compare fields of type URL.

  • Text: Any text field or custom field type that uses a text based representation.

image

Some additional notes of interest:

  • All comparisons are case insensitive.

  • The filter for the ‘Version’ field accepts the ‘[ MajorVersion]’ and ‘[ MinorVersion]’ values to distinguish between a major (1.0, 2.0) and minor (1.1, 1.2, 2.2) versions.

  • When filtering multiple choice / multi select fields you can specify multiple values. For example:

    • “Brett;Ben” Contains “Ben” = True

    • “Brett;Jeroen;Ben” Contains “Brett;Ben” = True

    • “Brett;Jeroen” Contains “Brett;Ben” = False

    • “Brett;Jeroen” is equal to “Jeroen;Brett” = True (The sequence in which values are specified do not matter)

  • If a field is deleted from a list after it has been specified in a filter then the filter will always equate to false resulting in the watermark not being applied.

  • It is not possible to specify a Filter for Insert events on a Document Library as the fields do not contain any values at this time. This is not a problem for inserting documents attached to a list.

  • When comparing fields that contain both Date and Time elements (e.g. the Modified Date) against such values as [Today] then please take into account that the value represented by [Today] does not include a time element. Therefore ‘Created Date = [Today]’ will never evaluate to true unless it is midnight. Instead use ‘Created Date >= [Today]’. For Date fields that don’t include the Time element, e.g. a birthday, this will not be a problem.

This concludes our series about automatic watermarking. If you have any questions or comments then feel free to leave a comment below or contact us directly.

Author
Clavin Fernandes Developer Relations and Support Services

Clavin is a Microsoft Business Applications MVP who supports 1,000+ high-level enterprise customers with challenges related to PDF conversion in combination with SharePoint on-premises Office 365, Azure, Nintex, K2, and Power Platform mostly no-code solutions.

Explore related topics

Share post
Free trial Ready to get started?
Free trial