From dfa1d438e786ede72ca1a1730fef1068e72d6c17 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 21 Jan 2005 17:00:28 +0000 Subject: [PATCH] only put the fair logo on the pdf if the logo file is valid --- lpdf.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lpdf.php b/lpdf.php index f039167..b6e31b0 100644 --- a/lpdf.php +++ b/lpdf.php @@ -29,8 +29,12 @@ 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); $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); + //only put the logo on the page if we actually have the logo + if($this->logoimage) + { + //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 pdf_moveto($this->pdf,$this->loc(0.5),$this->loc($this->yloc)); @@ -324,7 +328,8 @@ class lpdf $this->normalfont=pdf_findfont($this->pdf,"Times-Roman","host",0); $this->headerfont=pdf_findfont($this->pdf,"Times-Bold","host",0); - $this->logoimage=pdf_open_image_file($this->pdf,"gif",$logo,"",0); + if(file_exists($logo)) + $this->logoimage=pdf_open_image_file($this->pdf,"gif",$logo,"",0); pdf_set_info($this->pdf,"Author","SFIAB"); pdf_set_info($this->pdf,"Creator","SFIAB");