How can I generate a PDF file with n8n?

I have a JSON Object getting as HTTP Response.

{  
    "employee": {  
        "name":       "Rocky",   
        "salary":     "5000",   
        "active":     "true"
    }  
} 

I want to generate a PDF file with this JSON.

Is it possible?

Hi @mcnaveen,

Quick answer is yes you can create a PDF using the APITemplate.io Node

4 Likes

Hello @mcnaveen ,
with carboneio/carbone: Fast and simple report generator, from JSON to pdf, xslx, docx, odt… (github.com)
it could be a good option no ?

1 Like

Wow, This looks super cool. I’ll try and let you know.

1 Like

Hi @mcnaveen

I’m using Google Docs to generate a document from a template and get the pdf of that document

In my use case I start with Google Sheet, but it could be with HTTP Request

Here’s code for this workflow that you can adapt to your use case

14 Likes

Hey @Claudio_Balbino

This is Perfect. :slight_smile: 100% No Code Solution

Thank you for sharing.

3 Likes

Looks like google has updated their format. I use this https://www.googleapis.com/drive/v2/files/[FILE ID]/export?mimeType=application%2Fpdf&key=[API KEY] and it works great.

3 Likes

Hey ,
Can we make repetitive section to generate table for an invoice with Google docs ?

Thanks

It worked for me like a charm! Thank you!

1 Like

I am facing this issue with this workflow while updating the google docs. It says requested entity not found but it is already there in google drive.

image

Hi @Jeyakumarrathnaselvi, welcome to the community!

I am sorry to hear you’re having trouble. Is there a chance a whitespace has sneaked into your document ID field? Or that the Google Docs user you have authenticated in n8n isn’t the owner of your document?

If that’s not it you might want to open a separate topic here on the forum for a closer look.

Hi @Claudio_Balbino do I understand correctly that with this flow you can have only one product/price pair? In your case SERVICO/VALOR. Is there a chance to have X amount of product/quantity/price lines? I didn’t come up with a good solution for that.

@tiger360 did you manage to create a multiline invoice?

Hi @kaspar ,

See APITemplate.io it meets your need and has an n8n node

1 Like

@kaspar

Another service that can assist you is eledo.online

Both offer free plan

Thank you a lot. Works great!