Print PDF with jsPDF

Hi @hexx,

Thank you for sharing this. Helps clear up a lot of questions on my end.

From scouring the documents, asking engineers internally and looking through the forums, unfortunately there is no way to print PDFs out of Retool. The reason for this is because for security purposes, all Retool code is executed in a sandboxed environment, which does not have access to your computer's operating system to trigger printing events.

I can make a feature request but at the moment it is likely not possible and there are better tools for a use case that needs to be printing table data :sweat:

The next best thing that can do done with Retool is to generate PDFs which can be downloaded to the local computer which is running a retool app. Then from there, a user can manually open the PDF and select the print options.

For your code, the error message seems to be coming from the document.getElementById() method. You may need to double check that you have the HTML elements ID. Just as a warning, using DOM methods in Retool is not fully supported as when we make updates and patches to frontend components there is a chance that these IDs can change which would be app breaking and need to be updated.

I wish printing from Retool was easier and will let you know if the ticket to add in this functionality has any updates.