Supported tag types
Box Doc Gen supports the following tag types in a PPTX template:- Text tags
- Image tags
Support by generation method
Support for each tag type depends on how you generate the document.Text tags
A text tag is any data field of type string, number, or date. In the following example, fields such ascompanyName, subscriptionPlan, renewalDate, and expiryDate are used as text tags.
{{companyName}}, with your data. This works with the API, Automate, and Box web app methods.
Image tags
Box Doc Gen can embed any image file stored in Box into the generated presentation. To use an image tag, follow these steps.Step 1: Upload the image file to Box
Upload the image file you want to use to Box.If you use a service account to generate the document through the API, make sure the service account has access to the image file.
Step 2: Author the Doc Gen template
Box Doc Gen uses a placeholder image in the template. To set up a placeholder image:- Insert a reference or sample image into the PPTX template. You can adjust the dimensions and alignment of the placeholder image using the native tools in Microsoft PowerPoint.
- Select the image, right-click it, and select View Alt Text. Add the following code, and then save the presentation:
image-pathis the key you want to use in your JSON schema.alt-textis the alt text you want the image to have after generation.
Step 3: Create the JSON payload
To generate a document with an image file in Box, use the following schema:- The key, such as
brandLogo, matches the key used in the placeholder image. idis the file ID of the image file in Box.typesignifies that this is an image file to embed in the document. The value must always beimage.
The image file ID must refer to your image file ID in Box.
Step 4: Make a document generation request
You can include images in your generated documents using one of the following methods:- Box Doc Gen API — generate documents with images programmatically. For details, see the Box Doc Gen API documentation.
- Box Doc Gen web app — create documents with embedded images through the web interface.