diff --git a/lpdf.php b/lpdf.php index b6e31b0..5c8745c 100644 --- a/lpdf.php +++ b/lpdf.php @@ -306,7 +306,11 @@ class lpdf function output() { pdf_end_page($this->pdf); - pdf_close_image($this->pdf,$this->logoimage); + + //only close the image if it was opened to begin with + if($this->logoimage) + pdf_close_image($this->pdf,$this->logoimage); + pdf_close($this->pdf); $pdfdata=pdf_get_buffer($this->pdf); header("Content-type: application/pdf");