Skip to content

Instantly share code, notes, and snippets.

@jakejackson1 jakejackson1/example-positioning.php Secret
Last active Sep 21, 2018

Embed
What would you like to do?
A sample PDF template showing off the positioning support
<?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
You can’t perform that action at this time.