Update an entity print template
You can use the print templates functionality to create a PDF based on entity properties and relations, such as the PDF report of annotations made on an asset.
This walkthrough describes how to:
Pull an entity print template
To pull an entity print template:
-
Run the following command:
ch-cli print pull -n <YOUR_ENTITY_PRINT_TEMPLATE-NAME> -f <YOUR_FOLDER_PATH>
If the working directory was not initialized, the pull command runs the initialize command.
Validate an entity print template
The validate command validates the formatting of the JSON file and the properties and relations described in the JSON file against the entity definition and the variables used in the razor files.
To validate an entity print template:
-
Run the following command:
ch-cli print validate -d <ENTITY_DEFINITION_NAME> -f <YOUR_FOLDER_PATH>
Alternatively, do the following:
-
In the Terminal menu, click Run Build Task.
-
Select the Validate Entity Print Template task.
-
Enter the name of the entity definition.
Validation errors are shown in the Problems and Terminal views:
Push an entity print template
To push the entity print template to your Content Hub instance:
-
Run the following command:
ch-cli print push -n <ENTITY_PRINT_TEMPLATE_NAME> -d <ENTITY_DEFINITION_NAME> -f <YOUR_FOLDER_PATH>
Alternatively, do the following:
-
In the Terminal menu, click Run Task.
-
Select the Push Entity Print Template task.
-
Enter the name of the entity definition.
-
Enter the name of the entity print template.
The push command runs the validate command before uploading the entity print template to the connected Content Hub instance.
Generate an entity print template
To generate an entity print template and review the final PDF file:
-
Run the following command:
ch-cli print generate -n <ENTITY_PRINT_TEMPLATE_NAME> -i <ENTITY_ID> -c <CULTURE>
Alternatively, do the following:
-
In the Terminal menu, click Run Task.
-
Select the Push Entity Print Template task.
-
Enter the name of the entity print template.
-
Enter the ID of the entity.
-
Enter the culture.
In your browser, you can now open the downloaded PDF file.