Skip to content

Instantly share code, notes, and snippets.

@jakejackson1
Last active December 6, 2022 18:21
Show Gist options
  • Save jakejackson1/997b5dedf0a5e665e8ef to your computer and use it in GitHub Desktop.
Save jakejackson1/997b5dedf0a5e665e8ef to your computer and use it in GitHub Desktop.
Basic Three Column Table for Gravity PDF Header
<table autosize="1">
<tr>
<td align="left" width="33%">
<img src="http://example.com/wp-content/uploads/2015/08/logo.png" alt="Logo" />
</td>
<td align="center" width="33%">
{form_title}
</td>
<td align="right">
{date_dmy}
</td>
</tr>
</table>
@jakejackson1
Copy link
Author

Select the "Text" tab in the HTML editor and copy and paste the above. You can then switch back to the "Visual" tab.

@josephrorr
Copy link

Nice! Thanks for this. Any way to make the logo a bit bigger? No matter what I do, I'm still getting a micro-sized logo in the header. I've even set the left and right columns to 10% and middle to 80%, and added img width/height tags, but it's still small. Any ideas?

@jakejackson1
Copy link
Author

@josephrorr Gravity PDF automatically restricts the height of images in headers/footers to prevent them taking up a large portion of a page. You can override this behaviour by including the style attribute in your IMG's HTML markup. To do this, select the "Text" tab in the Rich Text Editor, then add style="max-height: 400px" to the code. This might look like this in your editor:

<img src="http://pdf-test-site.local/wp-content/uploads/2018/03/Hydrangeas.jpg" alt="" width="1024" height="768" style="max-height: 400px" />

Adjust 400px to the size you need.

@josephrorr
Copy link

josephrorr commented Jul 16, 2020 via email

@jakejackson1
Copy link
Author

Feel free to open a support ticket with details about how the PDF looks now and how you'd like it to look, as well as what variations on the max height you've tried and one of our team will be happy to assist. https://gravitypdf.com/support/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment