-
-
Save jakejackson1/997b5dedf0a5e665e8ef to your computer and use it in GitHub Desktop.
Basic Three Column Table for Gravity PDF Header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
@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.
Hey there! Unfortunately, this still doesn’t work ☹
I’ve attached a PDF to show you how it turned out using the code example you provided:
<img style="max-height: 74px;" src="https://imgur.com/zYiwosb.png" alt="Logo" width="400" height="74" />
Also, FYI, when I go back to visual editor, it puts the style attribute at the beginning of the syntax.
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
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?