bigger PDF logos

This commit is contained in:
Roland Gruber 2010-11-06 09:40:46 +00:00
parent 5c7e917ebb
commit edc93c4f98
4 changed files with 23 additions and 17 deletions

View File

@ -1,3 +1,8 @@
December 2010 3.3.0
- additional usability enhancements
- PDF export: higher resolution for logos
28.10.2010 3.2.0
- large usability enhancements
- Shadow: allow to force password change when maximum password age is set

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -644,6 +644,20 @@ Have fun!
<section id="a_versUpgrade">
<title>Version specific upgrade instructions</title>
<section>
<title>3.2.0 -&gt; 3.3.0</title>
<para>If you use custom images for the PDF export then these images
need to be 5 times bigger than before (e.g. 250x250px instead of
50x50px). This allows to use images with higher resolution.</para>
</section>
<section>
<title>3.1.0 -&gt; 3.2.0</title>
<para>No changes.</para>
</section>
<section>
<title>3.0.0 -&gt; 3.1.0</title>

View File

@ -88,29 +88,16 @@ class lamPDF extends UFPDF {
function header() {
if($this->page_definitions['filename'] != 'none') {
$imageFile = substr(__FILE__,0,strlen(__FILE__)- 14) . "config/pdf/logos/" . $this->page_definitions['filename'];
$width = $this->page_definitions['logo-width'];
$height = $this->page_definitions['logo-height'];
if($this->page_definitions['logo-max'] == true) {
if(($width / $height) <= 2.5) {
$factor = 20 / $height;
$width = $factor * $width;
$height = 20;
$imgProperties = getimagesize($imageFile);
$this->Image($imageFile,10,15,($imgProperties[0] / $this->k) / 5, ($imgProperties[1] / $this->k) / 5,0,"JPG");
}
else {
$factor = 50 / $width;
$height = $factor * $height;
$width = 50;
}
}
$this->Image($imageFile,10,10,$width,$height,"JPG");
}
$this->SetY(18);
$this->SetY(23);
$this->SetFont($this->fontName,"B",18);
$this->Cell(170,5,$this->page_definitions['headline'],0,1,"R",0);
$this->Ln(3);
$this->SetLineWidth(0.4);
$this->Line(10,38,200,38);
$this->Line(10,40,200,40);
$this->Line(10,42,200,42);
$this->SetY(50);
}