Convert HTML to PDF and send Email

Good afternoon community! How are you doing?

Again here with my queries haha, at this point I come to ask if there is a way to convert an HTML file to PDF and then send it by mail, I was trying to import some javascript libraries but n8n does not recognize them (I have enabled the variables to import any type of libraries) is there any node that can do it? I was investigating the convert and the extract but I can’t figure it out.

Thanks as always for your help!
Regards

Information on your n8n setup

  • **n8n version:1.27.3
  • **Database (default: SQLite):postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):Kubernetes
  • Operating system:

Hey @Internalit_Automatio,

We don’t have a built in option so you would need to either get an npm package working or use a service like API Template or ILovePDF (with an http request node) depending on what option you would rather take.

You can also try this https://www.youtube.com/watch?v=bo15xdjXf1Y

1 Like

Hello @Jon
Its that possible to import module ‘Ilovepdf’ or ‘htmlpdf’ ?
Regards!

Hello @Maciej_Mogilany
I did it and it worked… but I am having 2 problems, one is that I don’t know why I get the word ‘html’ at the beginning of the pdf. and the other one is that at the end of the pdf I get the styles

Captura de pantalla 2024-02-23 a la(s) 16.36.50

Captura de pantalla 2024-02-23 a la(s) 16.37.00

Thanks!

Hey @Internalit_Automatio,

It should be, You would need to add it to your docker image then update the env options to allow it and you should be good to go.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.