Last date modified: 2025-Aug-25

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

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.

NameData typeDescriptionName in Advanced Formatting drop-down list
DocumentDocumentDropThe current document being branded.N/A
ProductionIdintThe ID of the workspace.Production Id
ProductionNamestringThe name of the production.Production Name
TotalDocumentsintThe total number of documents in the production.Total Documents
TotalImagesintThe total number of images in the production. Total Images
WorkspaceIdintThe ID of the production.

Workspace Id

Document object

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

NameData typeDescriptionName in Advanced Formatting drop-down list
ArtifactIdintThe ArtifactId of the document in the production. Artifact Id
HasRedactionsboolIf set, the current document contains redactions on at least one page.Document Has Redactions
HasPlaceholderboolIf set, the current document is a placeholder. Has Placeholder
BeginBatesstringThe first bates number in this document.Begin Bates
EndBatesstringThe last bates number in this document. End Bates
BeginBatesAttachment stringThe first attachment bates number in this document. Begin Bates Attachment
EndBatesAttachment stringThe last attachment bates number in this document. End Bates Attachment
PagePageDropThe current page being branded. N/A
["Field Name"] FieldDropReturns 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:
  • 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.

NameData typeDescriptionName in Advanced Formatting drop-down list
BatesNumberstringThe bates number of the current page. Bates Number
FileNamestringThe name of the file. File Name
HasRedactionsboolIf set, this page has redactions. Page Has Redactions
IsPlaceholderboolIf true, this page is a placeholder page. Is Placeholder
PageNumberintThe current page. Page Number

Script examples

Below are Advanced Formatting script examples:

  • Brand the free-text, Production Name, and Page Number on every page.
    Copy
    Production Name: {{context.ProductionName}}
    Page # {{context.Document.Page.PageNumber}}
  • Brand the free-text on pages that have redactions.
    Copy
    {% if context.Document.Page.HasRedactions%}
    THIS PAGE CONTAINS REDACTIONS
    {% endif %}
  • Brand the free-text on pages that have a specific page number.
    Copy
    {% 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.
    Copy
    {% if context.Document.Page.PageNumber > 1 %}
    {{context.Document.Page.BatesNumber}}
    {% endif %}
  • Brand the free-text on the pages that fall between a page range.
    Copy
    {% if context.Document.Page.PageNumber  > 1 and context.Document.Page.PageNumber  < 11%}
    Confidential 
    {% endif %}
    Copy
    {% 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.
    Copy
    {% if context.Document["Confidentiality"].Value == "Attorneys’ Eyes Only" %}
    Copy
    Confidential - Attorneys’ Eyes Only
    Copy
    {% endif %}
Return to top of the page
Feedback