Docxtemplater / Retool - Image Module

I am trying to use the docxtemplater library in retool to generate word documents. There is no issue installing and using the basic functionality in the app (i.e., install the basic library and replace regular tags with text).

However we also pay for the image module which would allow us to generate templates with custom images. I'm looking to understand whether installing this module is possible directly in retool or if I would be required to build a custom component to handle this use case.

If a custom component is required, would someone point me to the best description of how I might go about handling?

Thanks!

Hey @Gregory_Caplan, it looks like Docxtemplater works by using docx files as templates where you pass in tags to be replaced and then it generates a PDF. Pretty slick!

I went a different route myself—basically, I built the app to act as my template. I customized it so the container border is a specific color, and then a backend script captures a screenshot and crops out a clean PDF.

It’s a bit more complex, but it lets me design everything directly in Retool, keeping the look of both the app and the PDFs consistent. Just thought I’d throw that out there as a different approach!

As for installing this module in Retool, I don’t think it’s possible, but I can’t say for sure either.

1 Like

Another option is carbone.io

2 Likes

Hi @Gregory_Caplan,

I haven't tested it out to confirm compatibility, but if the module is compatible with Retool, it would definitely need to be in a custom component. Our docs have instructions here. Note that custom components must be written in React and Typescript.

1 Like