- Use pdf_fit_image instead of pdf_place_image.

- The docs say pdf_place_image is deprecated (and so is
	  pdf_open_image_file.. apparently)
	- By using pdf_fit_image we can define a box where we would like the
	  image to fit, then use the highest quality image (logo.gif) and tell
	  pdflib to scale and center the image within that box.
This commit is contained in:
dave 2007-12-22 03:31:02 +00:00
parent 2cfbcc2b41
commit 7b7c6c0db2
2 changed files with 17 additions and 7 deletions

View File

@ -501,7 +501,7 @@ foreach($report_stock as $n=>$v) {
$label_stock = $report_stock[$report['option']['stock']];
$rep=new lpdf( i18n($config['fairname']),
i18n($report['name']),
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif");
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo.gif");
$rep->setPageStyle("labels");
$rep->newPage($label_stock['page_width'], $label_stock['page_height']);
$rep->setFontSize(11);
@ -513,7 +513,7 @@ foreach($report_stock as $n=>$v) {
/* FIXME: handle landscape pages in here */
$rep=new lpdf( i18n($config['fairname']),
i18n($report['name']),
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif");
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo.gif");
$rep->newPage();
$rep->setFontSize(11);
$gen_mode = 'table';

View File

@ -83,8 +83,14 @@ class lpdf
//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($this->page_margin),$this->loc($this->yloc+.02),.20);
/* now place the logo image in the top-left-ish
* within a box width=height=0.70, fit to the box, and
* center in the box */
$w = $this->loc(0.70);
pdf_fit_image($this->pdf, $this->logoimage,
$this->loc($this->page_margin),
$this->loc($this->yloc+.02),
"boxsize { $w $w} position {50 50} fitmethod meet" ) ;
}
//header line
@ -451,10 +457,14 @@ class lpdf
if($show_logo == true && $this->logoimage)
{
//now place the logo image in the top-left-ish
pdf_place_image($this->pdf,$this->logoimage,
/* now place the logo image in the top-left-ish
* within a box width=height=0.70, fit to the box, and
* center in the box */
$w = $this->loc(0.70);
pdf_fit_image($this->pdf, $this->logoimage,
$this->loc($this->label_current_xpos+0.05),
$this->loc($this->label_current_ypos-0.75),0.2);
$this->loc($this->label_current_ypos-0.75),
"boxsize { $w $w} position {50 50} fitmethod meet" ) ;
}
$this->label_effective_height = $this->label_height;