PDF generated file shows part of the form only due to scroll bar

Hi,

I used anvil pdf generator function (https://anvil.works/docs/media/creating_pdfs.html) and when the file created it was showing a part of the form only as you can see in the picture below

I tried https://anvil.works/learn/examples/pdf-invoices to see what I am missing, and I noticed that this example the internal scrolling is not there.

I am assuming if I removed the internal scrolling feature from the form that will resolve the issue.

Here is the app example https://anvil.works/build#clone:XQMR7LWACHTSLJFU=BE6SAFLAOBD6NA2LJ7ODO2KD

Please help.

Thank you!

I found the solution! Whenever you are planning to create a pdf from a Form make sure you use “Blank Panel” not “Standard Page”.

Thanks.

2 Likes

For anyone specifically wanting to PDF a ‘Standard Page’, you can get around the scroll bar issue by using @stucork’s solution for being able to use ‘Standard Pages’ as alert forms which can be found at the following links. You can simply set the form you want to PDF role by self.role = 'alert-form' and away you go, no more scroll bars! Thanks @stucork

Code below.

theme.css

.anvil-role-alert-form .structure {
  height: 100%;
  min-height: auto;
}

roles:
Screen Shot 2020-02-17 at 13.03.39