Force page setting for new Google doc

Hi all,

In a scenario I am using the Google Docs ‘create a document’ module, as I need text formatting in the document. The ‘use template’ does not allow that. So I generate my content with HTML.

All works nice, variables are in the right places and my formatting works. But… the output in Google doc is always in Brief-format (21,6 x 27,9) and I need A4 (21,0 x 29,7) format. I’ve updated the standard settings in Google docs to A4, I tried multiple solutions in my HTML (css-styles) but still: no A4 output.

Is there a solution for this?


Additional to this question: I can create a HTML file and upload it to an FTP server. Is there a way that I download that ‘page’ as PDF? That would fix my problem too.

1 Like

@Brigitte

Why couldn’t you do the formatting in your template?

Regards,
Msquare Automation - Gold Partner of Make
@Msquare_Automation

Welcome to the Make community!

You can change the page size using the documents.batchUpdate endpoint.

However, I think you should be able to change the default, by creating a new document, then go to File > Page Settings

Screenshot_2024-08-29_220812

Change to A4, and click “Set as default”.

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

Hi @Msquare_Automation ,
The create Google doc from template does not support any HTML formatting. And that is what I really need to be flexible in the output.

1 Like

Hi @samliew,
Thanks for your response.
That is what I’ve already tried, to change the default in my Google account to A4 format. When I open a new document, it indeed is A4 format. But as soon as I create the document via the Make.com module and use HTML, the Google default overrules that (I can even see it happening when I open the file).

The other option you provide is a bit out of my league…

Do you know if there is a work around to export an HTML file (that is online via an FTP server) to PDF? That would solve my problem as well.

Looks like someone else has asked this before too with no result: Create Google doc - defaults to Letter size rather than A4?

To use the “Make an API Call” module to set the document page size,

Hint: you can convert CM to PT by Googling “cm to pt”

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":6,"module":"google-docs:makeApiCall","version":1,"parameters":{"__IMTCONN__":95013},"mapper":{"url":"/v1/documents/{{4.id}}:batchUpdate","method":"POST","headers":[{"key":"Content-Type","value":"application/json"}],"body":"{\"requests\":[{\"updateDocumentStyle\":{\"documentStyle\":{\"pageSize\":{\"height\":{\"magnitude\":595.276,\"unit\":\"PT\"},\"width\":{\"magnitude\":841.8898,\"unit\":\"PT\"}}},\"fields\":\"pageSize\"}}]}"},"metadata":{"designer":{"x":824,"y":-33,"name":"Update pageSize"},"parameters":[{"name":"__IMTCONN__","type":"account:google","label":"Connection","required":true}]}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

1 Like

Hi @samliew,

It worked!
Thank you so much for providing the solution and the detailled instructions!

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!