Download pdf of gsheet

Is there any node that can download gsheet as pdf?

Hi @fortytwo , and welcome to the Knime Community.

If by gsheet you mean Google Sheet, you can open a Google Sheet via the Google Sheets Reader node:

As you know, anything that has a data port output will basically be a Knime table, so you will get a table after reading your Google Sheet.

You can then use the Table to PDF node that will allow you to save the table as a PDF:

So, probably something like this:
image

2 Likes

Hi @bruno29a,

Thanks for the suggesting this approach. We can read and write the data into the google sheet without any issues.

But I was looking for downloading the pdf directly from google sheet. The pdf version for the sheet can be downloaded with the following url format: http://docs.google.com/spreadsheets/d/<doc_id>/export?format=pdf.
We have lots of formatting in the sheet that we want to preserve in the pdf. Currently we use google app script to create the pdf, but wanted to do the same in Knime. I guess we can use “GET request” node to call the url, but I am not sure how can I pass the google credentials to it.

thanks

Hi @fortytwo , I see, so you’re not trying to convert Google Sheets to PDF, but rather trying to download the generated pdf version of the sheets by Google.

I think if you use a GET Request, it will not download the pdf file, but rather try to open whatever response it gets, and there is also the issue of authentication in this case. Unless you are using an api, you can’t really do login into your google account via GET Request.

I wonder if you could connect via the HTTP(S) Connector, and it just so happens that the Transfer Files node accept the kind of connection that the HTTPS(S) Connector produces - Transfer Files node is the only node I know to download files. There are legacy nodes that can download files, but they’re legacy nodes.
image

Can I ask what do you intend to do once the pdf is downloaded? Do you intend to process these pdf files via Knime after? If so, what kind of processing are you doing, and how are you going to proceed? Won’t you lose the formatting you want to keep when you parse the pdf?

Hi @bruno29a,

I will try the https connector soon.
Our aim is to download the pdf and email it, along with some other reports, to a group of people on a regular basis. This pdf from the google sheet is a tabular report with custom formatting maintained and updated in google sheet.

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