/example-positioning.php Secret
Last active
September 21, 2018 07:10
Star
You must be signed in to star a gist
A sample PDF template showing off the positioning support
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
<?php | |
/** | |
* Template Name: Example Positioning | |
* Version: 0.1 | |
* Description: A sample PDF template showing off the positioning support | |
* Author: Gravity PDF | |
* Group: Example | |
* License: GPLv2 | |
* Required PDF Version: 4.0 | |
*/ | |
/* Prevent direct access to the template (always good to include this) */ | |
if ( ! class_exists( 'GFForms' ) ) { | |
return; | |
} | |
?> | |
<style> | |
#autosize { | |
position: absolute; | |
top: 50mm; | |
left: 100mm; | |
font-size: 20pt; | |
width: 30mm; | |
height: 5mm; | |
overflow: visible; | |
} | |
#rotated { | |
position: absolute; | |
top: 50mm; | |
left: 100mm; | |
width: 30mm; | |
height: 40mm; | |
background: grey; | |
rotate: -90; | |
} | |
</style> | |
<div style="position: absolute; top: 0; left: 0">I'm outside the page margins</div> | |
<div style="position: absolute; top: 0; right: 0">I'm outside the page margins</div> | |
<div style="position: absolute; bottom: 0; left: 0">I'm outside the page margins</div> | |
<div style="position: absolute; bottom: 0; right: 0">I'm outside the page margins</div> | |
<pagebreak/> | |
<div style="position: fixed; top: 0; left: 0">I'm inside the page margins</div> | |
<div style="position: fixed; top: 0; right: 0">I'm inside the page margins</div> | |
<div style="position: fixed; bottom: 0; left: 0">I'm inside the page margins</div> | |
<div style="position: fixed; bottom: 0; right: 0">I'm inside the page margins</div> | |
<pagebreak/> | |
<div id="rotated">Rotated</div> | |
<pagebreak/> | |
<div id="autosize">My Very Long Text Too Big For Container</div> | |
<pagebreak/> | |
<div id="autosize" style="overflow: auto">My Very Long Text Too Big For Container</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment