diff --git a/lpdf.php b/lpdf.php index a657ff7..5011f17 100644 --- a/lpdf.php +++ b/lpdf.php @@ -35,9 +35,8 @@ class lpdf //these are defaults, they get overwritten with the first call to newPage(width,height) var $page_width=8.5; var $page_height=11; - var $content_width=$page_width-(2*$page_margin); - +// var $content_width=$page_width-($page_margin*2); function loc($inch) { @@ -100,7 +99,7 @@ class lpdf $this->pagenumber++; //Letter size (8.5 x 11) is 612,792 - pdf_begin_page($this->pdf,$this->loc($this->page_width),$this->loc($this->page_height); + pdf_begin_page($this->pdf,$this->loc($this->page_width),$this->loc($this->page_height)); pdf_setlinewidth($this->pdf,0.3); $this->addHeaderAndFooterToPage(); } @@ -377,6 +376,9 @@ class lpdf $this->pdf=pdf_new(); pdf_open_file($this->pdf,null); + //calculate this now, becauasae aparently we cant calculated up top in the class definition + $this->content_width=$this->page_width-($this->page_margin*2); + //open up the first page //Letter size (8.5 x 11) is 612,792 // pdf_begin_page($this->pdf,612,792);