Hello Bubblers,
Now you can generate unlimited PDF files from Google Docs templates.
It is possible to create static templates or let the users of your app create their own templates, very useful for SaaS.
The plugin allows you to fill templates with texts, multiline texts, lists with bullets, tables and images.
IMPORTANT: the plugin requires a Google Workspace account and a Google Cloud account.
We provide a demo app and a documentation (Dev guide) covering everything you need to get started, from authentication with Google to saving the PDF file in your app database.
The plugin is great. But during the study, some questions arose, because. The documentation, in my opinion, is not complete.
Also got the following error:
If the placeholder in the template is made bold, then its replacement is performed incorrectly (for example, when replacing the placeholder from the {{txt-title}} documentation when it is highlighted in bold, it is replaced in the PDF with {THIS IS A TITLE${txt-title}} instead of THIS IS A TITLE.
During the study, the following question arose:
How is it possible to populate a table with a list of things so that each thing is on a separate line?
I would be grateful for an answer.
Hi @svadkovski, thanks for reaching out.
Please let me know what you think is missing in the documentation.
About the error, I couldnât reproduce the same behavior and the placeholder â{{txt-title}}â in the demo template doc is already bold and works properly.
Maybe, you changed only the placeholder text like this {{txt-title}}, in this case the plugin will not find the placeholder because the Google Docâs application will break this word in separate paragraph elements in order to apply different formatting on the same word. In short, you should always format the entire placeholder in bold.
Responding to your last question, it is still not possible to have multiline text inside a table cell, but you can achieve that out of tables by using this symbol â$nlâ which will be converted into a new line character.
Thank you for your reply.
I reproduced the situation again and realized that the reason was not formatting.
This situation arose for me, including in the demo version, if the template contains text and the placeholder is used several times, then not all placeholders are replaced or are replaced incorrectly.
Hi again, you should be able to use the same placeholder many times in the document for texts and images, but table placeholders need to be unique, as documented.
Could you create a test template similar to the one that caused the errors, share it publicly and send me the link? It will be easier form me to find the problem and a possible solution.
Thanks!
Thanks @svadkovski, there really was a bug and with the template you shared I could find the problem and fix it. Please test again the demo app and reach out to me in case you still have any issues with the plugin.
Thanks, the replacement works great now. Only now the formatting in relation to the placeholder does not work stably. For example, if you only make the placeholder bold, the replacement does not apply it to the replaced text. If you select the placeholder and next to the adjacent text, then everything works.
Unfortunately it doesnât work if the placeholder is in the text.
Also, when creating a PDF, an error occurs if the document is static and there are no placeholders in the text, and at least one placeholder is specified in the workflow.
Just removed the limitation for templates with no placeholders and the bold placeholders inside the text still work for me.
This is the template you shared with me.
Please tell me about the Get token action.
I canât get my Google Access token. What does this error message mean?
Workflow error - Plugin action Get token error: Error: error:0909006C:PEM routines:get_name:no start line at Sign.sign (internal/crypto/sig.js:103:29) at signit2 (eval at build_function (/var/task/index.js:86:21), <anonymous>:50:78) at eval (eval at build_function (/var/task/index.js:86:21), <anonymous>:55:22) at /var/task/index.js:349:23 at run_fn (/var/task/u.js:594:18)
Hi @gx1994, Iâm glad that the plugin interests you.
This error usually occurs when we donât format the JSON key correctly, so copy the key from the json file and paste it in this site https://jsonformatter.curiousconcept.com to remove \n (newline) characters. You can also remove the newline characters manually using any document editor to replace them.
Hi, @jizreel_alencar ,thanks for the quick reply!
I had removed the newline characters, but the problem was that I was saving the key to the DB without a newline after ââEND PRIVATE KEY----â.
Thanks!
Hello, again.
I have implemented according to your Developer guide. Basically it works well. Thanks for the great plugin.
And now, Iâd like to know how to avoid saving the converted PDF to Google Drive!
The destination folder is supposed to be specified by Folder ID in [Create PDF] action, and if I leave this blank, an error message is returned and the PDF cannot be created (but the Dev guide says Folder ID is optional!).
As in the demo app, I can delete the PDF by the [Delete file] action at the end of Workflow, but I sometimes donât want to save the PDF to Google Drive, even temporarily. Security issuesâŚ
Hi @gx1994 , thanks for using the plugin!
The folder id is optional, I just removed an unnecessary limitation that was left, please upgrade the plugin. When you donât inform the id when generating a PDF, the copied file will be saved to the templateâs folder. If youâre creating a template and donât inform the id, the template file will be saved to âMy driveâ folder.
The PDF file wonât be saved to your drive because the conversion happens when your app saves it to S3, but the doc file that was filled by the API will. It turns out that the plugin should not edit the template file, but a copy of it, so the plugin first creates a copy of the template and then fills the copied file, leaving the template file untouched. Also, the plugin should not delete the copied file immediately after filling it because your app wouldnât be able to save it to S3, I tried to perform a scheduled server action to delete the copied file automatically after some seconds, but I couldnât achieve that yet on bubbleâs plugin environment, Iâm working on it, thatâs why you need to delete the file after saving it to S3, via workflow action.
Finally, it is not possible to avoid having the copied file saved to a drive folder, it must be there to be edited by the API. However, you can delete it immediately after saving to S3.