Advanced Formatting for Branding

Advanced Formatting is a type of branding available on the Production Set form. See Branding.

With Advanced Formatting, you can brand headers and footers with a combination of fields from the Advanced Formatting drop-down list, free-form text, and carriage returns. The Advanced Formatting option also supports a scripting language that you can use to create conditional branding based on production, document, and page fields.

Advanced Formmatting

For conditional statements, the root context objects are

Note: If you add a field to a conditional statement incorrectly, you can still save and run the production set, but the branding will not generate an error and will produce incorrect results.

Production object

The production object stores information about the production. It is the same for every item branded in the production.

Name Data type Description Name in Advanced Formatting drop-down list
Document DocumentDrop The current document being branded. N/A
ProductionId int The ID of the workspace. Production Id
ProductionName string The name of the production. Production Name
TotalDocuments int The total number of documents in the production. Total Documents
TotalImages int The total number of images in the production. Total Images
WorkspaceId int The ID of the production.

Workspace Id

Document object

This object stores information about the document and will change for each document.

Name Data type Description Name in Advanced Formatting drop-down list
ArtifactId int The ArtifactId of the document in the production. Artifact Id
HasRedactions bool If set, the current document contains redactions on at least one page. Document Has Redactions
HasPlaceholder bool If set, the current document is a placeholder. Has Placeholder
BeginBates string The first bates number in this document. Begin Bates
EndBates string The last bates number in this document. End Bates
BeginBatesAttachment string The first attachment bates number in this document. Begin Bates Attachment
EndBatesAttachment string The last attachment bates number in this document. End Bates Attachment
Page PageDrop The current page being branded. N/A
["Field Name"] FieldDrop

Returns the field value of the specified document field. This will return null if the field does not exist or is not supported.

e.g. context.Document["Control Number"].Value

Only the following field types are supported:

    Notes:
  • These values are in string format as done in object manager.
  • Custom Placeholders also supports these field types.
  • Reflected fields are not supported.
  • case FieldType.Date

  • case FieldType.Decimal
  • case FieldType.FixedLengthText
  • case FieldType.WholeNumber
  • case FieldType.YesNo

  • case FieldType.SingleChoice

  • case FieldType.MultipleChoice

N/A

Page object

The page object stores information about the page and will change for each page.

Name Data type Description Name in Advanced Formatting drop-down list
BatesNumber string The bates number of the current page. Bates Number
FileName string The name of the file. File Name
HasRedactions bool If set, this page has redactions. Page Has Redactions
IsPlaceholder bool If true, this page is a placeholder page. Is Placeholder
PageNumber int The current page. Page Number

Script examples

Below are Advanced Formatting script examples:

  • Brand the free-text, Production Name, and Page Number on every page.
    Production Name: {{context.ProductionName}}
    Page # {{context.Document.Page.PageNumber}}
  • Brand the free-text on pages that have redactions.
    {% if context.Document.Page.HasRedactions%}
    THIS PAGE CONTAINS REDACTIONS
    {% endif %}
  • Brand the free-text on pages that have a specific page number.
    {% if context.Document.Page.PageNumber == 1 %}
    This text will be branded only on page 1
    {% endif %}
  • Brand the Bates Number on every page after page number 1.
    {% if context.Document.Page.PageNumber > 1 %}
    {{context.Document.Page.BatesNumber}}
    {% endif %}
  • Brand the free-text on the pages that fall between a page range.
    {% if context.Document.Page.PageNumber  > 1 and context.Document.Page.PageNumber  < 11%}
    Confidential 
    {% endif %}
    {% if context.Document.Page.PageNumber  > 11 and context.Document.Page.PageNumber  < 21%}
    Attorneys’ Eyes Only
    {% endif %}
  • Brand the document that has a document field with specific value.

    {% if context.Document["Confidentiality"].Value == "Attorneys’ Eyes Only" %}
    Confidential - Attorneys’ Eyes Only
    {% endif %}