Trouble with landscape pdf attachment

Hi

I try to make a PDF attachment in landscape. I make my template in google document in landscape but the PDF is landscape with portrait template.

1 Like

Hello @Simon_Langelier_Cont, have you configured your workflow to use the landscape as well?

4 Likes

Do I miss Something?

Could you please share a screenshot of your table in your google doc template?

I’m having this same issue. Trying to use a landscape template, but the result keeps cutting off the text as if it’s portrait.

My template:

My Output:

My Settings:

I have tried A4 size as well, same result. I thought that custom setting the size of the page might change that … nope. The google doc template is set to landscape.

1 Like

I got the same problem.

1 Like

Same problem only landscape orientation

1 Like

Try to use Word instead of Google Docs. Its a solve my problem

3 Likes

@Simon_Langelier_Cont I’m hoping for people who are already setup with google docs (like myself) and have others also counting on templates being created in google docs, is there another solution? I have tried other apparent solutions that seems to solve other peoples problems but I still cannot get the pdf file to be in landscape. The page is clearly in landscape but the content is pushed off to the side to fit portrait width. I am not sending the pdf as an attachment it is just a file creation task. Is there anyone out there that has a solution to this seemingly weird oversight of appsheet development.

5 Likes

Mismo problema

1 Like

Experiencing the same issue.

1 Like

@Shawn_Crocker @Cando_Mayorga @Justin_Thurston
You could open a new topic asking for help.
One of the oldest replies seems like the config wasn’t right.
Make sure to use the right margins on both, the doc and appsheet, the right page size on both, the right orientation on both and finally I advice anyone to always wrap on a table, it doesn’t matter if it’s one cell. You can control that table’s width and height, fix it to a certain value, etc

2 Likes

I have this issue with a table in Google Docs as well. Whats weird is it’s fine in portrait. You change it to landscape and now it slices off about 30% off the right hand side. Here’s a simple example, created from scratch as A4 Landscape in google docs with a simple table:

Ran it as a template from a bot (Bot set to A4 Portrait):

Margins are slightly off, but its covering the full width.

Change Bot to A4 Landscape and we have:

So because the issue occurs when we change the settings of the Bot, I’d have to point the Appsheet Devs there first. Changing the margins in the bot does nothing. Also what is “pt” in terms of the margin settings? Likewise changing the column widths in the Google Docs table seems to do nothing either :confused: Finally even tried Landscape/Letter in the bot settings - Same

If I was to hazard a guess I’d say that it looks like the Bot is constraining the width as though the paper was still portait.

1 Like

Another quick test i’ve done. I went in an manually doubled the size of the last column in the Google Docs table. When I ran the Bot, the table in the PDF attachment was an identical width to before. Except now the last column was double the size and other others had all been shrunk.

I know that this may not be the solution for the majority of people but since all the templates are converted to HTML before the data is saved on them, I’m using HTML/CSS exclusively.

“Pt” is one of the common measurements we use on HTML/CSS, while I know that inches and centimeters are more common on WYSIWYG editors.

If you need help to make this while the AppSheet team manages to fix the problem with those editors you can send me a DM and I can happily make a .html file for you that will do the job as template.

Also you could check my post about this here Part 1 - Almost pixel perfect pdf reports from aut… - Google Cloud Community

2 Likes

Also, on the table’s config, change the width to 100% of the window

Thanks for the info. I will look into html templating. At least I feel more certain the landscape issue it cause not entirely due to my idiocy.

Escalated.

2 Likes

I took a look at this today to try and understand what was going on. As @SkrOYC alluded to in one of the other threads here, the way AppSheet creates PDFs is by rendering HTML. Specifically we use a variant of the Chromium browser to render it.

The way this works with a template like Google Docs is we are able to export the Doc as HTML, replace the values, and then render it. What’s going on here is that when we export the Doc from HTML it does not contain any information about the page orientation.

I kept my test simple, just a single table on the page in portrait and exported it as HTML (you can do this yourself as well in Docs by going to File → Download → Web Page). I then changed the page to landscape and exported it again. There was no real difference in the HTML when I did this. Some CSS classes were re-named, but ultimately both contained a with a class constraining the max-width to the same value.

So since Docs doesn’t export the portrait and landscape pages any differently that information is lost, resulting in the smaller width content that’s seen when exporting a landscape page.

In general, as some other community members have mentioned, DocX templates tend to include more information, and so result in a better final product. Ultimately though there will always be some loss of fidelity doing this. So for any power users out there looking to achieve much better PDF output I’d suggest reading through @SkrOYC 's excellent post on using HTML templates to create your PDF .

As a final note, a good way to “preview” what AppSheets PDF output will look like is to just “print” the HTML (ctrl+p by default in most browsers). So if using an HTML template directly, open it in the Chrome browser and press (Ctrl+P) to print. This should be very close to the final PDF render. If using a Google Doc template then you can download it as html (File → Download → Web Page), and again open the HTML in the Chrome Browser and press (Ctrl+P) to open the print view.

3 Likes