add logo to pdf's

This commit is contained in:
james 2005-01-14 20:42:03 +00:00
parent 2c0fb0f90d
commit c03aaf07a3
2 changed files with 9 additions and 1 deletions

View File

@ -8,6 +8,7 @@
echo "<a href=\"categories.php\">Project Age Categories</a> <br />"; echo "<a href=\"categories.php\">Project Age Categories</a> <br />";
echo "<a href=\"divisions.php\">Project Divisons</a> <br />"; echo "<a href=\"divisions.php\">Project Divisons</a> <br />";
echo "<a href=\"subdivisions.php\">Project Sub-Divisons</a> <br />"; echo "<a href=\"subdivisions.php\">Project Sub-Divisons</a> <br />";
echo "<a href=\"images.php\">Images (Fair Logo)</a> <br />";
send_footer(); send_footer();
?> ?>

View File

@ -6,6 +6,7 @@ class lpdf
var $page_header; var $page_header;
var $page_subheader; var $page_subheader;
var $pagenumber; var $pagenumber;
var $logoimage;
function loc($inch) function loc($inch)
{ {
@ -28,6 +29,9 @@ class lpdf
pdf_show_boxed($this->pdf,$this->page_subheader,$this->loc(0.75),$this->loc($this->yloc),$this->loc(7),$this->loc($height['subtitle']),"center",null); pdf_show_boxed($this->pdf,$this->page_subheader,$this->loc(0.75),$this->loc($this->yloc),$this->loc(7),$this->loc($height['subtitle']),"center",null);
$this->yloc-=$height['subtitle']; $this->yloc-=$height['subtitle'];
//now place the logo image in the top-left-ish
pdf_place_image($this->pdf,$this->logoimage,$this->loc(0.75),$this->loc($this->yloc+.02),.20);
//header line //header line
pdf_moveto($this->pdf,$this->loc(0.5),$this->loc($this->yloc)); pdf_moveto($this->pdf,$this->loc(0.5),$this->loc($this->yloc));
pdf_lineto($this->pdf,$this->loc(8),$this->loc($this->yloc)); pdf_lineto($this->pdf,$this->loc(8),$this->loc($this->yloc));
@ -198,6 +202,7 @@ class lpdf
function output() function output()
{ {
pdf_end_page($this->pdf); pdf_end_page($this->pdf);
pdf_close_image($this->pdf,$this->logoimage);
pdf_close($this->pdf); pdf_close($this->pdf);
$pdfdata=pdf_get_buffer($this->pdf); $pdfdata=pdf_get_buffer($this->pdf);
header("Content-type: application/pdf"); header("Content-type: application/pdf");
@ -206,7 +211,7 @@ class lpdf
echo $pdfdata; echo $pdfdata;
} }
function lpdf($header,$subheader) function lpdf($header,$subheader,$logo)
{ {
$this->pdf=pdf_new(); $this->pdf=pdf_new();
pdf_open_file($this->pdf,null); pdf_open_file($this->pdf,null);
@ -219,6 +224,8 @@ class lpdf
$this->normalfont=pdf_findfont($this->pdf,"Times-Roman","host",0); $this->normalfont=pdf_findfont($this->pdf,"Times-Roman","host",0);
$this->headerfont=pdf_findfont($this->pdf,"Times-Bold","host",0); $this->headerfont=pdf_findfont($this->pdf,"Times-Bold","host",0);
$this->logoimage=pdf_open_image_file($this->pdf,"gif",$logo,"",0);
pdf_set_info($this->pdf,"Author","SFIAB"); pdf_set_info($this->pdf,"Author","SFIAB");
pdf_set_info($this->pdf,"Creator","SFIAB"); pdf_set_info($this->pdf,"Creator","SFIAB");
pdf_set_info($this->pdf,"Title","SFIAB - $subheader"); pdf_set_info($this->pdf,"Title","SFIAB - $subheader");