I’m using one arm of the workflow to generate a set of unique urls, and I then generate QR codes for these.
I use a merge node to merge the two together, and I can see the info about each one in the JSON, and also the binary files after the merge. So far so good.
I then need to group these URLs by category (which I can do with a code node).
I then need to generate a pdf for each category, with a table inside listing the urls and the QR code for each.
I’ve tried various things:
generating HTML, but I can’t seem to get the QR codes in the HTML. The plan was to generate the pdf from the HTML.
saving the QR codes to Google Drive and accessing the images from there. I can save them, (but this is very slow, in the end I need to process 1000 categories, ~10,000 urls in total.
pushing the content to Google Docs and generating pdfs from there, but again, I can’t seem to push the images in there, either directly or via Google Drive.
What is the error message (if any)?
There are usually no error messages.
For example, when I tried moving the images from Google Drive to Google Docs, the image doesn’t render, insead the text is just:
Utilize the n8n node-dev package to render PDFs in-line. Implement a custom node that employs a PDF library such as pdfkit to create each category’s PDF programmatically, inserting the QR code images directly from their binary data into the document tables within it. This eliminates external services and keeps all data internal.
Thakns for your reply @mohamed3nan . I don’t think I can use this options because each file I need to generate is unique and doesn’t have a template per se, and I need to process about 10,000 images, and 1000 files. I’m not sure if this will be slow.
I kept working through this. In the end what worked was:
Creating a set of Google Sheets spreadsheets using a Google Sheets node
Creating sheets within each spreadsheet using a HTTP node. The Google Sheets node didn’t handle multiple spreadsheets and created all the sheets in the first spreadsheet.
Multiple spreadsheets/sheets is not necessary, it’s just how I need to organise the data. Then:
I used a HTTP node to write the data to the sheets. The Google Sheets nodes didn’t work, they ended up writing all the data to the first spreadsheet and first sheet only. I had to watch out for rate limit exceptions here.
Instead of generating the QR codes in n8n itself, I passed the API request url to the Google Sheets inside an =IMAGE() function. I used api.qrserver.com. This created and rendered the image directly in the Google Sheet.
This bypassed the problems I was having of:
Not being able to handle/render the binary image files of the QR codes inside n8n
Sending the files to Google Drive as an intermediate step being too slow
The one unexpected thing was that the HTTP node sending data to the Google Sheet API couldn’t handle variables in the JSON, I had to separately create the required JSONs in another function node.
I realise that I’ve dropped the original requirement of creating pdfs - turns out the Google Sheets will do for now. I also realise that I’m new to n8n and some of the complications may be due to my ignorance.