PDF - Insert Table of Contents

** AVAILABLE NOVEMBER / DECEMBER 2024 **

Overview

The 'PDF - Insert Table of Contents' generates and inserts a 'Table of Contents' either from the bookmarks present in the PDF document (Default) provided or from JSON data representing the hierarchical items to add to the 'Table of Contents'.

Credit Count

This action consumes 1 credit per operation.

Note, different Encodian actions can consume different number credits. Please always check the action specific documentation and read What is an Encodian Action for a full description of how credits are consumed.

Default Options

The default 'PDF - Insert Table of Contents' flow action parameters are detailed below:

  • File Content: A Base64 encoded representation of the PDF file to be processed.
  • Title: The title of the 'Table of Contents'
  • Destination Page: The page number to insert the 'Table of Contents' from

Please refer to the Obtaining the 'File Contents' Parameter article for guidance on how to obtain the 'File Content' parameter ready to provide to an Encodian flow action.

Advanced Parameters

The advanced 'PDF - Insert Table of Contents' flow action parameters are detailed below:

  • JSON Entries: JSON data containing the hierarchical entries for the 'Table of Contents', see below for further details.
  • Show Page Numbers: Set whether page numbers should be visible for each of item of the 'Table of Contents'
  • Title - Font: Set the font applied to the 'Title'
  • Title - Font Color: Set the font color applied to the 'Title'
  • Title - Background Color: Set the background color applied to the 'Title'
  • Title - Font Size: Set the size of the font applied to the 'Title'
  • Title - Font Style: Set the font style applied to the 'Title'
  • Item - Font: Set the font applied to each 'Table of Contents' item
  • Item - Font Color: Set the font color applied to each 'Table of Contents' item
  • Item - Background Color: Set the background color applied to each 'Table of Contents' item
  • Item - Font Size: Set the size of the font applied to each 'Table of Contents' item
  • Item - Font Style: Set the font style applied to each 'Table of Contents' item
  • Item - Padding: Set the padding applied to the top of each item within the 'Table of Contents'
  • Item - Level Padding: Set the left padding iteratively apply to each level of the 'Table of Contents' hierarchy. For example, a value of '5'; Level 1: 5, Level 2: 10, Level 3: 15, etc.
  • Culture Name: This setting is used to set the culture for processing the request. Please refer to the Culture Names article for a list of supported cultures

Providing 'JSON Entries'

By default the action will read bookmark entries contained within the PDF document and use these to compile the entries to be inserted within the 'Table of Contents'. For PDF documents which do not contain bookmark entries you can pass a JSON value to the 'JSON Entries' property which will be parsed and entries added to the 'Table of Contents', refer to the following explanation / example:

  • Title: The text value of the 'Table of Contents' entry
  • Destination: The page number to go to when clicking on the 'Table of Contents' entry
  • Level: The hierarchical level of the 'Table of Contents' entry
  • Children: An array of sub entries
[
{
"Title": "Level 1 - Node 1",
"Destination": "1",
"Level": 1,
"Children": []
},
{
"Title": "Level 1 - Node 2",
"Destination": "2",
"Level": 1,
"Children": [
{
"Title": "Level 1 > 2 - Node 1",
"Destination": "2",
"Level": 2,
"Children": []
},
{
"Title": "Level 1 > 2 - Node 2",
"Destination": "3",
"Level": 2,
"Children": []
}]
}
]

Return Parameters

The 'PDF - Insert Table of Contents' flow action returns the following data. 

Action Specific Return Values

  • File Content - The processed PDF file (Base64)

Standard Return Values

  • OperationId - The unique ID assigned to this operation.
  • HttpStatusCode - The HTTP Status code for the response.
  • HttpStatusMessage - The HTTP Status message for the response.
  • Errors - An array of error messages should an error occur.
  • Operation Status - Indicates whether the operation has been completed, has been queued or has failed.
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk