Create a new file via BOT (PDF based on google doc template)

Hello,

I am facing margin issues when generating a PDF from a Google Docs template.

My Google doc template looks like that:

My template is formatted correctly in Google Docs. When the content generated by my application results in a single-page document, everything looks fine (although for some reason the page number is not printed, but this is not critical):

However, when the document extends to 2 or more pages, the formatting no longer respects the defined margins and the footer is pushed onto the next page:

I have already tried several approaches with the support of Gemini, but nothing has resolved the issue so far.

I also tested generating a very simple Google Docs template without header or footer, but the same behavior occurs.

Has anyone experienced a similar issue or has any idea what could be causing this?

Thank you in advance for your help,

Thibault

1 Like

AppSheet’s PDF generation only supports the header on the FIRST page and a footer on the LAST page. Sadly, It will not provide a header and footer on each page.

If such formatting is important on your generated documents, there is one other approach to generating PDF’s that has been detailed by one of our other contributors @SkrOYC (Oscar). In the post below, I have provided links to the 3 articles he has written. There is a learning curve which I personally have not yet needed to pursue but my understading is that it is a MUCH MAUCH better way to create excellent PDF’s

I hope this helps!!

2 Likes

Alternatively, if you are willing to use Google Apps Script, please take a look at the following tip.

4 Likes

Thank you for your answers.
AppSheet’s PDF generation only supports the header on the FIRST page and a footer on the LAST page. Sadly, It will not provide a header and footer on each page.”

This is exactly what I needed to understand.

And I found a way to correct the margin issue thanks to this article: Margin not honored in creating PDF from AppSheet

Since the Header/Footer are not that important to me, the solution found is satisfying.

Thanks again for the support.

2 Likes