PDA

View Full Version : PDF printouts



jeffremiller
12-22-2003, 11:54 AM
A client recently asked for pdf datasheet printouts of the homes in an open-realty database.

Here's what we came up with using FPDF... hope it helps someone:
I removed dbnames, users and passwords.

<?php

require($DOCUMENT_ROOT . '/fpdf151/fpdf.php');


//Connect to your database
//include("conectmysql.php");
$connection = mysql_connect('localhost','xxxx','xxxx')
or die ("Couldn't connect to database.");

$db = mysql_select_db('xxxx')
or die ("Couldn't select database.");

$sql1 = "select * from default_listingsDB where ID = '$listingID'";
$sql2 = "select * from default_listingsImages where listing_id = '$listingID' ORDER BY rank";

//Select the results you want to show in your PDF file
$result=mysql_query($sql1, $connection);
$result2=mysql_query($sql2, $connection);

//Create new pdf file
$pdf=new FPDF();

//Disable automatic page break
$pdf->SetAutoPageBreak(false);

//Add first page
$pdf->AddPage();

//set initial y axis position per page
$y_axis = 25;
$x_axis = 18;
//var $y0;

//Set Row Height
$row_height = 4;

$y_axis = $y_axis + $row_height;

$pdf->SetFont('Arial','B',14);
//initialize counter
$i = 0;
while($row = mysql_fetch_array($result)) {

$ID = $row['ID'];
$Title = $row['Title'];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->Write(6,$Title);
//Go to next row
$y_axis = $y_axis + $row_height;
$i = $i + 1;
}

$i = 0;

$y_axis = $pdf->GetY() + 15;

while($row = mysql_fetch_array($result2)) {

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$listing_id = $row['listing_id'];
$file_name = $row['file_name'];
$thumb_file_name = $row['thumb_file_name'];
if ($i == 0) {
$pdf->Image("images/listing_photos/$file_name",75,$y_axis,100);
}

$pdf->Image("images/listing_photos/$thumb_file_name",20,$y_axis+$i,25);
//$pdf->Image('images/listing_photos/thumb_1_white-house.jpg',10,50,25);

//Go to next row
$y_axis = $pdf->GetY();
$y_axis = $y_axis + $row_height;
$i = $i + 22;
}

$y_axis = $pdf->GetY() + 65;
$x_axis = 68;

$pdf->SetFillColor(255,255,255);

$myArray = array('address', 'Tag', 'city', 'filler', 'state', 'section', 'zip', 'type', 'short_desc', 'sq_feet',
'price', 'lot_size', 'prop_tax', 'beds', 'garage_size', 'baths', 'status', 'floors', 'mls', 'year_built');

while ($stuff = array_shift($myArray)) {
$y_axis = $y_axis + 4;
$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$sql = "select field_caption from default_listingsFormElements where field_name = '$stuff' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$pdf->Cell(20,4,"$row[0]: ",'','',R,'');
$pdf->SetFont('Arial','',9);
}

$sql = "select field_value from default_listingsDBElements where field_name = '$stuff' and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if ($stuff == 'price') {
$row[0] = "$" . number_format($row[0], 2, '.', ',');
}
$pdf->Cell(40,4,"$row[0]");
}
$stuff = array_shift($myArray);
$pdf->SetFont('Arial','B',9);
$sql = "select field_caption from default_listingsFormElements where field_name = '$stuff' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if (!$row[0]) {
$pdf->Cell(30,4," ",'','',R,'');
}
else {
$pdf->Cell(30,4,"$row[0]: ",'','',R,'');
}
}
$pdf->SetFont('Arial','',9);

$sql = "select field_value from default_listingsDBElements where field_name = '$stuff' and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if ($stuff == 'price') {
$row[0] = number_format($row[0], 2, '.', ',');
}
$pdf->Cell(40,4,"$row[0]");
}
$y_axis = $pdf->GetY();
}

$y_axis = $pdf->GetY() + 8;

$sql = "select a1.field_caption, a2.field_value from default_listingsFormElements as a1,
default_listingsDBElements as a2 where a1.field_name = 'full_desc' and a2.field_name = 'full_desc'
and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$FullDescCap = $row[0];
$FullDescVal = $row[1];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(20,4,"$FullDescCap: ",'','',R,'');
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(100,4,"$FullDescVal",'',L,'');
$y_axis = $pdf->GetY() + 4;
}

$sql = "select a1.field_caption, a2.field_value from default_listingsFormElements as a1,
default_listingsDBElements as a2 where a1.field_name = 'cemail' and a2.field_name = 'cemail'
and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$EmailCap = $row[0];
$EmailVal = $row[1];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(20,4,"$EmailCap: ",'','',R,'');
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(100,4,"$EmailVal",'',L,'');
}

$y_axis = $pdf->GetY() + 4;

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->Line(10,$y_axis,200,$y_axis);

$y_axis = $pdf->GetY() + 10;

$pdf->Image("images/flier.jpg",60,$y_axis,80);

mysql_close($connection);
//Create file
$pdf->Output();
?>

the_sandking
12-22-2003, 11:58 AM
Nice!

Can't wait to try it out!

:D

awddesign
12-22-2003, 04:23 PM
Hi

Me too been testing the old PDF of and on for a while now.

It must be Xmas :D :D

get it from

http://www.fpdf.org/

//////

After getting rid of

//$y_axis = $pdf->GetY() + 10;

//$pdf->Image("images/flier.jpg",60,$y_axis,80);

this part it now works :D :D :D :D :D :D

you can just comment that part out like this //

guy
12-23-2003, 03:18 AM
where is stored the pdt file.
I try to use the script it seem to be working but after the generation of the file acrobat is opening and said to me "le fichier ne commence pas par $pdf-".

awddesign
12-23-2003, 01:16 PM
Hi All

this PDF is ok but it will need an else stament for the images.

As fpdf still will not print out gif images

jpg ok

Ie..

////////////////////////

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$listing_id = $row['listing_id'];
$file_name = $row['file_name'];
$thumb_file_name = $row['thumb_file_name'];
if ($i == 0) {
$pdf->Image("../images/listing_photos/$file_name",75,$y_axis,100);

}else{

//////////

Need to work around this code to make it work::

////////////

if($type=='jpg' or $type=='jpeg' or $type=='png'){
$this->Image($path,($this->GetX()-$width)+1, $this->GetY(), $width, $height);
}else{
$this->SetDrawColor(230,230,230);
$this->x = $this->GetX()-$width;
$this->SetTextColor(230,230,230);
$this->Cell($width,$height,'No image',1,0,C);
}
}


//////////////////

Any code designers to finish this part ????


Albert

awddesign
12-23-2003, 01:49 PM
hi all

see it in ACTION

http://www.awddesign.co.uk/awd_cars2/listingview.php?listingID=6

Look for Car PDF Catalog and click on link..

Albert

Mick
12-23-2003, 03:42 PM
Albert,

There's actually a sort of support for gif images on the fpdf forums... kinda....

They're using a free gif to png converter to be able to include gif images.

but I think better than just not including any gif images in the pdf...

And btw.. jeffremiller... great addon for Open-Realty! And Albert you've done a very nice job with this on your site

awddesign
12-23-2003, 04:08 PM
Albert,

There's actually a sort of support for gif images on the fpdf forums... kinda....

They're using a free gif to png converter to be able to include gif images.

but I think better than just not including any gif images in the pdf...

And btw.. jeffremiller... great addon for Open-Realty! And Albert you've done a very nice job with this on your site

Hi Mick
Yes a big thank you to jeffremiller for the covertion.


regarding gif images I want it to work like the no image pic in jgp.

so if the image was uloaded in gif fpdf will see that or read it and
show the on-image. jpg

Would make it just about done , other wise the fpdf just gets hung..

So any one out thier no how to do an eles stament for fpdf???



Again big thank you to jeffremiller

guy
12-25-2003, 05:42 AM
whats the correct link to put in the listingview.php ?

guy
12-25-2003, 05:43 AM
whats the correct link to put in the listingview.php ?

awddesign
12-25-2003, 07:53 AM
Hi

while eating my turkye i found a code for you all


<a target="_blank" href="pdf/index.php?listingID=<? echo $listingID; ?> "><b>Car PDF Catalog</b></a>


Albert

Merry xmass

Vindex
12-25-2003, 11:21 AM
hi

i make a test here:

http://www.ariege-pyrenees.info/demo/pdf/index.php?listingID=1

and y have this......


Warning: getimagesize(images/listing_photos/1_white-house.jpg): failed to open stream: No such file or directory in /home/ariegepy/www/demo/pdf/fpdf.php on line 1418
FPDF error: Missing or incorrect image file: images/listing_photos/1_white-house.jpg

any idea welcome :oops:

thanks / merci

awddesign
12-26-2003, 03:46 PM
hi

your file

http://www.ariege-pyrenees.info/demo/pdf/index.php?listingID=1

images

images/listing_photos/1_white-house.jpg

////////////////////////////////////////////////////////////////////////////////

Images should be set
in fpdf

if ($i == 0) {
$pdf->Image("../images/listing_photos/$file_name",75,$y_axis,100);
}

$pdf->Image("../images/listing_photos/$thumb_file_name",20,$y_axis+$i,25);

//$pdf->Image('images/listing_photos/thumb_1_white-house.jpg',10,50,25); ///



have a go at that see if works

Albert
awddesign

Vindex
12-26-2003, 04:33 PM
hi

tanx for your answer , Albert

now, i have this message from Acrobat:


"le fichier ne commence pas par $pdf-".
ENG: "the files dont start by $pdf-"

look here:
http://www.ariege-pyrenees.info/demo/pdf/index.php?listingID=1

below my index.php:

<?php

require($DOCUMENT_ROOT . '/demo/pdf/fpdf.php');


//Connect to your database
//include("conectmysql.php");
$connection = mysql_connect('sql server','name','password')
or die ("Couldn't connect to database.");

$db = mysql_select_db('name')
or die ("Couldn't select database.");

$sql1 = "select * from default_listingsDB where ID = '$listingID'";
$sql2 = "select * from default_listingsImages where listing_id = '$listingID' ORDER BY rank";

//Select the results you want to show in your PDF file
$result=mysql_query($sql1, $connection);
$result2=mysql_query($sql2, $connection);

//Create new pdf file
$pdf=new FPDF();

//Disable automatic page break
$pdf->SetAutoPageBreak(false);

//Add first page
$pdf->AddPage();

//set initial y axis position per page
$y_axis = 25;
$x_axis = 18;
//var $y0;

//Set Row Height
$row_height = 4;

$y_axis = $y_axis + $row_height;

$pdf->SetFont('Arial','B',14);
//initialize counter
$i = 0;
while($row = mysql_fetch_array($result)) {

$ID = $row['ID'];
$Title = $row['Title'];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->Write(6,$Title);
//Go to next row
$y_axis = $y_axis + $row_height;
$i = $i + 1;
}

$i = 0;

$y_axis = $pdf->GetY() + 15;

while($row = mysql_fetch_array($result2)) {

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$listing_id = $row['listing_id'];
$file_name = $row['file_name'];
$thumb_file_name = $row['thumb_file_name'];
if ($i == 0) {
$pdf->Image("../images/listing_photos/$file_name",75,$y_axis,100);
}

$pdf->Image("../images/listing_photos/$thumb_file_name",20,$y_axis+$i,25);
//$pdf->Image('images/listing_photos/thumb_1_white-house.jpg',10,50,25);

//Go to next row
$y_axis = $pdf->GetY();
$y_axis = $y_axis + $row_height;
$i = $i + 22;
}

$y_axis = $pdf->GetY() + 65;
$x_axis = 68;

$pdf->SetFillColor(255,255,255);

$myArray = array('address', 'Tag', 'city', 'filler', 'state', 'section', 'zip', 'type', 'short_desc', 'sq_feet',
'price', 'lot_size', 'prop_tax', 'beds', 'garage_size', 'baths', 'status', 'floors', 'mls', 'year_built');

while ($stuff = array_shift($myArray)) {
$y_axis = $y_axis + 4;
$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$sql = "select field_caption from default_listingsFormElements where field_name = '$stuff' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$pdf->Cell(20,4,"$row[0]: ",'','',R,'');
$pdf->SetFont('Arial','',9);
}

$sql = "select field_value from default_listingsDBElements where field_name = '$stuff' and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if ($stuff == 'price') {
$row[0] = "$" . number_format($row[0], 2, '.', ',');
}
$pdf->Cell(40,4,"$row[0]");
}
$stuff = array_shift($myArray);
$pdf->SetFont('Arial','B',9);
$sql = "select field_caption from default_listingsFormElements where field_name = '$stuff' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if (!$row[0]) {
$pdf->Cell(30,4," ",'','',R,'');
}
else {
$pdf->Cell(30,4,"$row[0]: ",'','',R,'');
}
}
$pdf->SetFont('Arial','',9);

$sql = "select field_value from default_listingsDBElements where field_name = '$stuff' and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if ($stuff == 'price') {
$row[0] = number_format($row[0], 2, '.', ',');
}
$pdf->Cell(40,4,"$row[0]");
}
$y_axis = $pdf->GetY();
}

$y_axis = $pdf->GetY() + 8;

$sql = "select a1.field_caption, a2.field_value from default_listingsFormElements as a1,
default_listingsDBElements as a2 where a1.field_name = 'full_desc' and a2.field_name = 'full_desc'
and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$FullDescCap = $row[0];
$FullDescVal = $row[1];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(20,4,"$FullDescCap: ",'','',R,'');
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(100,4,"$FullDescVal",'',L,'');
$y_axis = $pdf->GetY() + 4;
}

$sql = "select a1.field_caption, a2.field_value from default_listingsFormElements as a1,
default_listingsDBElements as a2 where a1.field_name = 'cemail' and a2.field_name = 'cemail'
and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$EmailCap = $row[0];
$EmailVal = $row[1];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(20,4,"$EmailCap: ",'','',R,'');
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(100,4,"$EmailVal",'',L,'');
}

$y_axis = $pdf->GetY() + 4;

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->Line(10,$y_axis,200,$y_axis);

//$y_axis = $pdf->GetY() + 10;

//$pdf->Image("images/flier.jpg",60,$y_axis,80);

mysql_close($connection);
//Create file
$pdf->Output();
?>

what wrong ? :oops:

bobbywise
01-18-2004, 02:23 PM
Hi Albert (and all),

For GIF support use the following for fpdf.php


<?php
/************************************************** *****************************
* Software&#58; FPDF *
* Version&#58; 1.52 *
* Date&#58; 2003-12-30 *
* Author&#58; Olivier PLATHEY *
* License&#58; Freeware *
* *
* You may use and modify this software as you wish. *
************************************************** *****************************/

if&#40;!class_exists&#40;'FPDF'&#41;&#41;
&#123;
define&#40;'FPDF_VERSION','1.52'&#41;;

class FPDF
&#123;
//Private properties
var $page; //current page number
var $n; //current object number
var $offsets; //array of object offsets
var $buffer; //buffer holding in-memory PDF
var $pages; //array containing pages
var $state; //current document state
var $compress; //compression flag
var $DefOrientation; //default orientation
var $CurOrientation; //current orientation
var $OrientationChanges; //array indicating orientation changes
var $k; //scale factor &#40;number of points in user unit&#41;
var $fwPt,$fhPt; //dimensions of page format in points
var $fw,$fh; //dimensions of page format in user unit
var $wPt,$hPt; //current dimensions of page in points
var $w,$h; //current dimensions of page in user unit
var $lMargin; //left margin
var $tMargin; //top margin
var $rMargin; //right margin
var $bMargin; //page break margin
var $cMargin; //cell margin
var $x,$y; //current position in user unit for cell positioning
var $lasth; //height of last cell printed
var $LineWidth; //line width in user unit
var $CoreFonts; //array of standard font names
var $fonts; //array of used fonts
var $FontFiles; //array of font files
var $diffs; //array of encoding differences
var $images; //array of used images
var $PageLinks; //array of links in pages
var $links; //array of internal links
var $FontFamily; //current font family
var $FontStyle; //current font style
var $underline; //underlining flag
var $CurrentFont; //current font info
var $FontSizePt; //current font size in points
var $FontSize; //current font size in user unit
var $DrawColor; //commands for drawing color
var $FillColor; //commands for filling color
var $TextColor; //commands for text color
var $ColorFlag; //indicates whether fill and text colors are different
var $ws; //word spacing
var $AutoPageBreak; //automatic page breaking
var $PageBreakTrigger; //threshold used to trigger page breaks
var $InFooter; //flag set when processing footer
var $ZoomMode; //zoom display mode
var $LayoutMode; //layout display mode
var $title; //title
var $subject; //subject
var $author; //author
var $keywords; //keywords
var $creator; //creator
var $AliasNbPages; //alias for total number of pages

/************************************************** *****************************
* *
* Public methods *
* *
************************************************** *****************************/
function FPDF&#40;$orientation='P',$unit='mm',$format='A4'&#41;
&#123;
//Some checks
$this->_dochecks&#40;&#41;;
//Initialization of properties
$this->page=0;
$this->n=2;
$this->buffer='';
$this->pages=array&#40;&#41;;
$this->OrientationChanges=array&#40;&#41;;
$this->state=0;
$this->fonts=array&#40;&#41;;
$this->FontFiles=array&#40;&#41;;
$this->diffs=array&#40;&#41;;
$this->images=array&#40;&#41;;
$this->links=array&#40;&#41;;
$this->InFooter=false;
$this->lasth=0;
$this->FontFamily='';
$this->FontStyle='';
$this->FontSizePt=12;
$this->underline=false;
$this->DrawColor='0 G';
$this->FillColor='0 g';
$this->TextColor='0 g';
$this->ColorFlag=false;
$this->ws=0;
//Standard fonts
$this->CoreFonts=array&#40;'courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-

Oblique','courierBI'=>'Courier-BoldOblique',
'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-

Oblique','helveticaBI'=>'Helvetica-BoldOblique',
'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats'&#41;;
//Scale factor
if&#40;$unit=='pt'&#41;
$this->k=1;
elseif&#40;$unit=='mm'&#41;
$this->k=72/25.4;
elseif&#40;$unit=='cm'&#41;
$this->k=72/2.54;
elseif&#40;$unit=='in'&#41;
$this->k=72;
else
$this->Error&#40;'Incorrect unit&#58; '.$unit&#41;;
//Page format
if&#40;is_string&#40;$format&#41;&#41;
&#123;
$format=strtolower&#40;$format&#41;;
if&#40;$format=='a3'&#41;
$format=array&#40;841.89,1190.55&#41;;
elseif&#40;$format=='a4'&#41;
$format=array&#40;595.28,841.89&#41;;
elseif&#40;$format=='a5'&#41;
$format=array&#40;420.94,595.28&#41;;
elseif&#40;$format=='letter'&#41;
$format=array&#40;612,792&#41;;
elseif&#40;$format=='legal'&#41;
$format=array&#40;612,1008&#41;;
else
$this->Error&#40;'Unknown page format&#58; '.$format&#41;;
$this->fwPt=$format&#91;0&#93;;
$this->fhPt=$format&#91;1&#93;;
&#125;
else
&#123;
$this->fwPt=$format&#91;0&#93;*$this->k;
$this->fhPt=$format&#91;1&#93;*$this->k;
&#125;
$this->fw=$this->fwPt/$this->k;
$this->fh=$this->fhPt/$this->k;
//Page orientation
$orientation=strtolower&#40;$orientation&#41;;
if&#40;$orientation=='p' or $orientation=='portrait'&#41;
&#123;
$this->DefOrientation='P';
$this->wPt=$this->fwPt;
$this->hPt=$this->fhPt;
&#125;
elseif&#40;$orientation=='l' or $orientation=='landscape'&#41;
&#123;
$this->DefOrientation='L';
$this->wPt=$this->fhPt;
$this->hPt=$this->fwPt;
&#125;
else
$this->Error&#40;'Incorrect orientation&#58; '.$orientation&#41;;
$this->CurOrientation=$this->DefOrientation;
$this->w=$this->wPt/$this->k;
$this->h=$this->hPt/$this->k;
//Page margins &#40;1 cm&#41;
$margin=28.35/$this->k;
$this->SetMargins&#40;$margin,$margin&#41;;
//Interior cell margin &#40;1 mm&#41;
$this->cMargin=$margin/10;
//Line width &#40;0.2 mm&#41;
$this->LineWidth=.567/$this->k;
//Automatic page break
$this->SetAutoPageBreak&#40;true,2*$margin&#41;;
//Full width display mode
$this->SetDisplayMode&#40;'fullwidth'&#41;;
//Compression
$this->SetCompression&#40;true&#41;;
&#125;

function SetMargins&#40;$left,$top,$right=-1&#41;
&#123;
//Set left, top and right margins
$this->lMargin=$left;
$this->tMargin=$top;
if&#40;$right==-1&#41;
$right=$left;
$this->rMargin=$right;
&#125;

function SetLeftMargin&#40;$margin&#41;
&#123;
//Set left margin
$this->lMargin=$margin;
if&#40;$this->page>0 and $this->x<$margin&#41;
$this->x=$margin;
&#125;

function SetTopMargin&#40;$margin&#41;
&#123;
//Set top margin
$this->tMargin=$margin;
&#125;

function SetRightMargin&#40;$margin&#41;
&#123;
//Set right margin
$this->rMargin=$margin;
&#125;

function SetAutoPageBreak&#40;$auto,$margin=0&#41;
&#123;
//Set auto page break mode and triggering margin
$this->AutoPageBreak=$auto;
$this->bMargin=$margin;
$this->PageBreakTrigger=$this->h-$margin;
&#125;

function SetDisplayMode&#40;$zoom,$layout='continuous'&#41;
&#123;
//Set display mode in viewer
if&#40;$zoom=='fullpage' or $zoom=='fullwidth' or $zoom=='real' or $zoom=='default' or !is_string&#40;$zoom&#41;&#41;
$this->ZoomMode=$zoom;
else
$this->Error&#40;'Incorrect zoom display mode&#58; '.$zoom&#41;;
if&#40;$layout=='single' or $layout=='continuous' or $layout=='two' or $layout=='default'&#41;
$this->LayoutMode=$layout;
else
$this->Error&#40;'Incorrect layout display mode&#58; '.$layout&#41;;
&#125;

function SetCompression&#40;$compress&#41;
&#123;
//Set page compression
if&#40;function_exists&#40;'gzcompress'&#41;&#41;
$this->compress=$compress;
else
$this->compress=false;
&#125;

function SetTitle&#40;$title&#41;
&#123;
//Title of document
$this->title=$title;
&#125;

function SetSubject&#40;$subject&#41;
&#123;
//Subject of document
$this->subject=$subject;
&#125;

function SetAuthor&#40;$author&#41;
&#123;
//Author of document
$this->author=$author;
&#125;

function SetKeywords&#40;$keywords&#41;
&#123;
//Keywords of document
$this->keywords=$keywords;
&#125;

function SetCreator&#40;$creator&#41;
&#123;
//Creator of document
$this->creator=$creator;
&#125;

function AliasNbPages&#40;$alias='&#123;nb&#125;'&#41;
&#123;
//Define an alias for total number of pages
$this->AliasNbPages=$alias;
&#125;

function Error&#40;$msg&#41;
&#123;
//Fatal error
die&#40;'<B>FPDF error&#58; </B>'.$msg&#41;;
&#125;

function Open&#40;&#41;
&#123;
//Begin document
if&#40;$this->state==0&#41;
$this->_begindoc&#40;&#41;;
&#125;

function Close&#40;&#41;
&#123;
//Terminate document
if&#40;$this->state==3&#41;
return;
if&#40;$this->page==0&#41;
$this->AddPage&#40;&#41;;
//Page footer
$this->InFooter=true;
$this->Footer&#40;&#41;;
$this->InFooter=false;
//Close page
$this->_endpage&#40;&#41;;
//Close document
$this->_enddoc&#40;&#41;;
&#125;

function AddPage&#40;$orientation=''&#41;
&#123;
//Start a new page
if&#40;$this->state==0&#41;
$this->Open&#40;&#41;;
$family=$this->FontFamily;
$style=$this->FontStyle.&#40;$this->underline ? 'U' &#58; ''&#41;;
$size=$this->FontSizePt;
$lw=$this->LineWidth;
$dc=$this->DrawColor;
$fc=$this->FillColor;
$tc=$this->TextColor;
$cf=$this->ColorFlag;
if&#40;$this->page>0&#41;
&#123;
//Page footer
$this->InFooter=true;
$this->Footer&#40;&#41;;
$this->InFooter=false;
//Close page
$this->_endpage&#40;&#41;;
&#125;
//Start new page
$this->_beginpage&#40;$orientation&#41;;
//Set line cap style to square
$this->_out&#40;'2 J'&#41;;
//Set line width
$this->LineWidth=$lw;
$this->_out&#40;sprintf&#40;'%.2f w',$lw*$this->k&#41;&#41;;
//Set font
if&#40;$family&#41;
$this->SetFont&#40;$family,$style,$size&#41;;
//Set colors
$this->DrawColor=$dc;
if&#40;$dc!='0 G'&#41;
$this->_out&#40;$dc&#41;;
$this->FillColor=$fc;
if&#40;$fc!='0 g'&#41;
$this->_out&#40;$fc&#41;;
$this->TextColor=$tc;
$this->ColorFlag=$cf;
//Page header
$this->Header&#40;&#41;;
//Restore line width
if&#40;$this->LineWidth!=$lw&#41;
&#123;
$this->LineWidth=$lw;
$this->_out&#40;sprintf&#40;'%.2f w',$lw*$this->k&#41;&#41;;
&#125;
//Restore font
if&#40;$family&#41;
$this->SetFont&#40;$family,$style,$size&#41;;
//Restore colors
if&#40;$this->DrawColor!=$dc&#41;
&#123;
$this->DrawColor=$dc;
$this->_out&#40;$dc&#41;;
&#125;
if&#40;$this->FillColor!=$fc&#41;
&#123;
$this->FillColor=$fc;
$this->_out&#40;$fc&#41;;
&#125;
$this->TextColor=$tc;
$this->ColorFlag=$cf;
&#125;

function Header&#40;&#41;
&#123;
//To be implemented in your own inherited class
&#125;

function Footer&#40;&#41;
&#123;
//To be implemented in your own inherited class
&#125;

function PageNo&#40;&#41;
&#123;
//Get current page number
return $this->page;
&#125;

function SetDrawColor&#40;$r,$g=-1,$b=-1&#41;
&#123;
//Set color for all stroking operations
if&#40;&#40;$r==0 and $g==0 and $b==0&#41; or $g==-1&#41;
$this->DrawColor=sprintf&#40;'%.3f G',$r/255&#41;;
else
$this->DrawColor=sprintf&#40;'%.3f %.3f %.3f RG',$r/255,$g/255,$b/255&#41;;
if&#40;$this->page>0&#41;
$this->_out&#40;$this->DrawColor&#41;;
&#125;

function SetFillColor&#40;$r,$g=-1,$b=-1&#41;
&#123;
//Set color for all filling operations
if&#40;&#40;$r==0 and $g==0 and $b==0&#41; or $g==-1&#41;
$this->FillColor=sprintf&#40;'%.3f g',$r/255&#41;;
else
$this->FillColor=sprintf&#40;'%.3f %.3f %.3f rg',$r/255,$g/255,$b/255&#41;;
$this->ColorFlag=&#40;$this->FillColor!=$this->TextColor&#41;;
if&#40;$this->page>0&#41;
$this->_out&#40;$this->FillColor&#41;;
&#125;

function SetTextColor&#40;$r,$g=-1,$b=-1&#41;
&#123;
//Set color for text
if&#40;&#40;$r==0 and $g==0 and $b==0&#41; or $g==-1&#41;
$this->TextColor=sprintf&#40;'%.3f g',$r/255&#41;;
else
$this->TextColor=sprintf&#40;'%.3f %.3f %.3f rg',$r/255,$g/255,$b/255&#41;;
$this->ColorFlag=&#40;$this->FillColor!=$this->TextColor&#41;;
&#125;

function GetStringWidth&#40;$s&#41;
&#123;
//Get width of a string in the current font
$s=&#40;string&#41;$s;
$cw=&amp;$this->CurrentFont&#91;'cw'&#93;;
$w=0;
$l=strlen&#40;$s&#41;;
for&#40;$i=0;$i<$l;$i++&#41;
$w+=$cw&#91;$s&#123;$i&#125;&#93;;
return $w*$this->FontSize/1000;
&#125;

function SetLineWidth&#40;$width&#41;
&#123;
//Set line width
$this->LineWidth=$width;
if&#40;$this->page>0&#41;
$this->_out&#40;sprintf&#40;'%.2f w',$width*$this->k&#41;&#41;;
&#125;

function Line&#40;$x1,$y1,$x2,$y2&#41;
&#123;
//Draw a line
$this->_out&#40;sprintf&#40;'%.2f %.2f m %.2f %.2f l S',$x1*$this->k,&#40;$this->h-$y1&#41;*$this->k,$x2*$this->k,&#40;$this->h-

$y2&#41;*$this->k&#41;&#41;;
&#125;

function Rect&#40;$x,$y,$w,$h,$style=''&#41;
&#123;
//Draw a rectangle
if&#40;$style=='F'&#41;
$op='f';
elseif&#40;$style=='FD' or $style=='DF'&#41;
$op='B';
else
$op='S';
$this->_out&#40;sprintf&#40;'%.2f %.2f %.2f %.2f re %s',$x*$this->k,&#40;$this->h-$y&#41;*$this->k,$w*$this->k,-$h*$this-

>k,$op&#41;&#41;;
&#125;

function AddFont&#40;$family,$style='',$file=''&#41;
&#123;
//Add a TrueType or Type1 font
$family=strtolower&#40;$family&#41;;
if&#40;$family=='arial'&#41;
$family='helvetica';
$style=strtoupper&#40;$style&#41;;
if&#40;$style=='IB'&#41;
$style='BI';
if&#40;isset&#40;$this->fonts&#91;$family.$style&#93;&#41;&#41;
$this->Error&#40;'Font already added&#58; '.$family.' '.$style&#41;;
if&#40;$file==''&#41;
$file=str_replace&#40;' ','',$family&#41;.strtolower&#40;$style&#41;.'.php';
if&#40;defined&#40;'FPDF_FONTPATH'&#41;&#41;
$file=FPDF_FONTPATH.$file;
include&#40;$file&#41;;
if&#40;!isset&#40;$name&#41;&#41;
$this->Error&#40;'Could not include font definition file'&#41;;
$i=count&#40;$this->fonts&#41;+1;
$this->fonts&#91;$family.$style&#93;=array&#40;'i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=

>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file&#41;;
if&#40;$diff&#41;
&#123;
//Search existing encodings
$d=0;
$nb=count&#40;$this->diffs&#41;;
for&#40;$i=1;$i<=$nb;$i++&#41;
if&#40;$this->diffs&#91;$i&#93;==$diff&#41;
&#123;
$d=$i;
break;
&#125;
if&#40;$d==0&#41;
&#123;
$d=$nb+1;
$this->diffs&#91;$d&#93;=$diff;
&#125;
$this->fonts&#91;$family.$style&#93;&#91;'diff'&#93;=$d;
&#125;
if&#40;$file&#41;
&#123;
if&#40;$type=='TrueType'&#41;
$this->FontFiles&#91;$file&#93;=array&#40;'length1'=>$originalsize&#41;;
else
$this->FontFiles&#91;$file&#93;=array&#40;'length1'=>$size1,'length2'=>$size2&#41;;
&#125;
&#125;

function SetFont&#40;$family,$style='',$size=0&#41;
&#123;
//Select a font; size given in points
global $fpdf_charwidths;

$family=strtolower&#40;$family&#41;;
if&#40;$family==''&#41;
$family=$this->FontFamily;
if&#40;$family=='arial'&#41;
$family='helvetica';
elseif&#40;$family=='symbol' or $family=='zapfdingbats'&#41;
$style='';
$style=strtoupper&#40;$style&#41;;
if&#40;is_int&#40;strpos&#40;$style,'U'&#41;&#41;&#41;
&#123;
$this->underline=true;
$style=str_replace&#40;'U','',$style&#41;;
&#125;
else
$this->underline=false;
if&#40;$style=='IB'&#41;
$style='BI';
if&#40;$size==0&#41;
$size=$this->FontSizePt;
//Test if font is already selected
if&#40;$this->FontFamily==$family and $this->FontStyle==$style and $this->FontSizePt==$size&#41;
return;
//Test if used for the first time
$fontkey=$family.$style;
if&#40;!isset&#40;$this->fonts&#91;$fontkey&#93;&#41;&#41;
&#123;
//Check if one of the standard fonts
if&#40;isset&#40;$this->CoreFonts&#91;$fontkey&#93;&#41;&#41;
&#123;
if&#40;!isset&#40;$fpdf_charwidths&#91;$fontkey&#93;&#41;&#41;
&#123;
//Load metric file
$file=$family;
if&#40;$family=='times' or $family=='helvetica'&#41;
$file.=strtolower&#40;$style&#41;;
$file.='.php';
if&#40;defined&#40;'FPDF_FONTPATH'&#41;&#41;
$file=FPDF_FONTPATH.$file;
include&#40;$file&#41;;
if&#40;!isset&#40;$fpdf_charwidths&#91;$fontkey&#93;&#41;&#41;
$this->Error&#40;'Could not include font metric file'&#41;;
&#125;
$i=count&#40;$this->fonts&#41;+1;
$this->fonts&#91;$fontkey&#93;=array&#40;'i'=>$i,'type'=>'core','name'=>$this->CoreFonts&#91;$fontkey&#93;,'up'=

>-100,'ut'=>50,'cw'=>$fpdf_charwidths&#91;$fontkey&#93;&#41;;
&#125;
else
$this->Error&#40;'Undefined font&#58; '.$family.' '.$style&#41;;
&#125;
//Select it
$this->FontFamily=$family;
$this->FontStyle=$style;
$this->FontSizePt=$size;
$this->FontSize=$size/$this->k;
$this->CurrentFont=&amp;$this->fonts&#91;$fontkey&#93;;
if&#40;$this->page>0&#41;
$this->_out&#40;sprintf&#40;'BT /F%d %.2f Tf ET',$this->CurrentFont&#91;'i'&#93;,$this->FontSizePt&#41;&#41;;
&#125;

function SetFontSize&#40;$size&#41;
&#123;
//Set font size in points
if&#40;$this->FontSizePt==$size&#41;
return;
$this->FontSizePt=$size;
$this->FontSize=$size/$this->k;
if&#40;$this->page>0&#41;
$this->_out&#40;sprintf&#40;'BT /F%d %.2f Tf ET',$this->CurrentFont&#91;'i'&#93;,$this->FontSizePt&#41;&#41;;
&#125;

function AddLink&#40;&#41;
&#123;
//Create a new internal link
$n=count&#40;$this->links&#41;+1;
$this->links&#91;$n&#93;=array&#40;0,0&#41;;
return $n;
&#125;

function SetLink&#40;$link,$y=0,$page=-1&#41;
&#123;
//Set destination of internal link
if&#40;$y==-1&#41;
$y=$this->y;
if&#40;$page==-1&#41;
$page=$this->page;
$this->links&#91;$link&#93;=array&#40;$page,$y&#41;;
&#125;

function Link&#40;$x,$y,$w,$h,$link&#41;
&#123;
//Put a link on the page
$this->PageLinks&#91;$this->page&#93;&#91;&#93;=array&#40;$x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link&#41;;
&#125;

function Text&#40;$x,$y,$txt&#41;
&#123;
//Output a string
$s=sprintf&#40;'BT %.2f %.2f Td &#40;%s&#41; Tj ET',$x*$this->k,&#40;$this->h-$y&#41;*$this->k,$this->_escape&#40;$txt&#41;&#41;;
if&#40;$this->underline and $txt!=''&#41;
$s.=' '.$this->_dounderline&#40;$x,$y,$txt&#41;;
if&#40;$this->ColorFlag&#41;
$s='q '.$this->TextColor.' '.$s.' Q';
$this->_out&#40;$s&#41;;
&#125;

function AcceptPageBreak&#40;&#41;
&#123;
//Accept automatic page break or not
return $this->AutoPageBreak;
&#125;

function Cell&#40;$w,$h=0,$txt='',$border=0,$ln=0,$align='',$fi ll=0,$link=''&#41;
&#123;
//Output a cell
$k=$this->k;
if&#40;$this->y+$h>$this->PageBreakTrigger and !$this->InFooter and $this->AcceptPageBreak&#40;&#41;&#41;
&#123;
//Automatic page break
$x=$this->x;
$ws=$this->ws;
if&#40;$ws>0&#41;
&#123;
$this->ws=0;
$this->_out&#40;'0 Tw'&#41;;
&#125;
$this->AddPage&#40;$this->CurOrientation&#41;;
$this->x=$x;
if&#40;$ws>0&#41;
&#123;
$this->ws=$ws;
$this->_out&#40;sprintf&#40;'%.3f Tw',$ws*$k&#41;&#41;;
&#125;
&#125;
if&#40;$w==0&#41;
$w=$this->w-$this->rMargin-$this->x;
$s='';
if&#40;$fill==1 or $border==1&#41;
&#123;
if&#40;$fill==1&#41;
$op=&#40;$border==1&#41; ? 'B' &#58; 'f';
else
$op='S';
$s=sprintf&#40;'%.2f %.2f %.2f %.2f re %s ',$this->x*$k,&#40;$this->h-$this->y&#41;*$k,$w*$k,-$h*$k,$op&#41;;
&#125;
if&#40;is_string&#40;$border&#41;&#41;
&#123;
$x=$this->x;
$y=$this->y;
if&#40;is_int&#40;strpos&#40;$border,'L'&#41;&#41;&#41;
$s.=sprintf&#40;'%.2f %.2f m %.2f %.2f l S ',$x*$k,&#40;$this->h-$y&#41;*$k,$x*$k,&#40;$this->h-&#40;$y+$h&#41;&#41;*$k&#41;;
if&#40;is_int&#40;strpos&#40;$border,'T'&#41;&#41;&#41;
$s.=sprintf&#40;'%.2f %.2f m %.2f %.2f l S ',$x*$k,&#40;$this->h-$y&#41;*$k,&#40;$x+$w&#41;*$k,&#40;$this->h-$y&#41;*$k&#41;;
if&#40;is_int&#40;strpos&#40;$border,'R'&#41;&#41;&#41;
$s.=sprintf&#40;'%.2f %.2f m %.2f %.2f l S ',&#40;$x+$w&#41;*$k,&#40;$this->h-$y&#41;*$k,&#40;$x+$w&#41;*$k,&#40;$this->h-&#40;

$y+$h&#41;&#41;*$k&#41;;
if&#40;is_int&#40;strpos&#40;$border,'B'&#41;&#41;&#41;
$s.=sprintf&#40;'%.2f %.2f m %.2f %.2f l S ',$x*$k,&#40;$this->h-&#40;$y+$h&#41;&#41;*$k,&#40;$x+$w&#41;*$k,&#40;$this->h-&#40;

$y+$h&#41;&#41;*$k&#41;;
&#125;
if&#40;$txt!=''&#41;
&#123;
if&#40;$align=='R'&#41;
$dx=$w-$this->cMargin-$this->GetStringWidth&#40;$txt&#41;;
elseif&#40;$align=='C'&#41;
$dx=&#40;$w-$this->GetStringWidth&#40;$txt&#41;&#41;/2;
else
$dx=$this->cMargin;
if&#40;$this->ColorFlag&#41;
$s.='q '.$this->TextColor.' ';
$txt2=str_replace&#40;'&#41;','\\&#41;',str_replace&#40;'&#40;','\\&#40;', str_replace&#40;'\\','\\\\',$txt&#41;&#41;&#41;;
$s.=sprintf&#40;'BT %.2f %.2f Td &#40;%s&#41; Tj ET',&#40;$this->x+$dx&#41;*$k,&#40;$this->h-&#40;$this->y+.5*$h+.3*$this-

>FontSize&#41;&#41;*$k,$txt2&#41;;
if&#40;$this->underline&#41;
$s.=' '.$this->_dounderline&#40;$this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt&#41;;
if&#40;$this->ColorFlag&#41;
$s.=' Q';
if&#40;$link&#41;
$this->Link&#40;$this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth&#40;$txt&#41;,$this

->FontSize,$link&#41;;
&#125;
if&#40;$s&#41;
$this->_out&#40;$s&#41;;
$this->lasth=$h;
if&#40;$ln>0&#41;
&#123;
//Go to next line
$this->y+=$h;
if&#40;$ln==1&#41;
$this->x=$this->lMargin;
&#125;
else
$this->x+=$w;
&#125;

function MultiCell&#40;$w,$h,$txt,$border=0,$align='J',$fill=0&#41;
&#123;
//Output text with automatic or explicit line breaks
$cw=&amp;$this->CurrentFont&#91;'cw'&#93;;
if&#40;$w==0&#41;
$w=$this->w-$this->rMargin-$this->x;
$wmax=&#40;$w-2*$this->cMargin&#41;*1000/$this->FontSize;
$s=str_replace&#40;"\r",'',$txt&#41;;
$nb=strlen&#40;$s&#41;;
if&#40;$nb>0 and $s&#91;$nb-1&#93;=="\n"&#41;
$nb--;
$b=0;
if&#40;$border&#41;
&#123;
if&#40;$border==1&#41;
&#123;
$border='LTRB';
$b='LRT';
$b2='LR';
&#125;
else
&#123;
$b2='';
if&#40;is_int&#40;strpos&#40;$border,'L'&#41;&#41;&#41;
$b2.='L';
if&#40;is_int&#40;strpos&#40;$border,'R'&#41;&#41;&#41;
$b2.='R';
$b=is_int&#40;strpos&#40;$border,'T'&#41;&#41; ? $b2.'T' &#58; $b2;
&#125;
&#125;
$sep=-1;
$i=0;
$j=0;
$l=0;
$ns=0;
$nl=1;
while&#40;$i<$nb&#41;
&#123;
//Get next character
$c=$s&#123;$i&#125;;
if&#40;$c=="\n"&#41;
&#123;
//Explicit line break
if&#40;$this->ws>0&#41;
&#123;
$this->ws=0;
$this->_out&#40;'0 Tw'&#41;;
&#125;
$this->Cell&#40;$w,$h,substr&#40;$s,$j,$i-$j&#41;,$b,2,$align,$fill&#41;;
$i++;
$sep=-1;
$j=$i;
$l=0;
$ns=0;
$nl++;
if&#40;$border and $nl==2&#41;
$b=$b2;
continue;
&#125;
if&#40;$c==' '&#41;
&#123;
$sep=$i;
$ls=$l;
$ns++;
&#125;
$l+=$cw&#91;$c&#93;;
if&#40;$l>$wmax&#41;
&#123;
//Automatic line break
if&#40;$sep==-1&#41;
&#123;
if&#40;$i==$j&#41;
$i++;
if&#40;$this->ws>0&#41;
&#123;
$this->ws=0;
$this->_out&#40;'0 Tw'&#41;;
&#125;
$this->Cell&#40;$w,$h,substr&#40;$s,$j,$i-$j&#41;,$b,2,$align,$fill&#41;;
&#125;
else
&#123;
if&#40;$align=='J'&#41;
&#123;
$this->ws=&#40;$ns>1&#41; ? &#40;$wmax-$ls&#41;/1000*$this->FontSize/&#40;$ns-1&#41; &#58; 0;
$this->_out&#40;sprintf&#40;'%.3f Tw',$this->ws*$this->k&#41;&#41;;
&#125;
$this->Cell&#40;$w,$h,substr&#40;$s,$j,$sep-$j&#41;,$b,2,$align,$fill&#41;;
$i=$sep+1;
&#125;
$sep=-1;
$j=$i;
$l=0;
$ns=0;
$nl++;
if&#40;$border and $nl==2&#41;
$b=$b2;
&#125;
else
$i++;
&#125;
//Last chunk
if&#40;$this->ws>0&#41;
&#123;
$this->ws=0;
$this->_out&#40;'0 Tw'&#41;;
&#125;
if&#40;$border and is_int&#40;strpos&#40;$border,'B'&#41;&#41;&#41;
$b.='B';
$this->Cell&#40;$w,$h,substr&#40;$s,$j,$i-$j&#41;,$b,2,$align,$fill&#41;;
$this->x=$this->lMargin;
&#125;

function Write&#40;$h,$txt,$link=''&#41;
&#123;
//Output text in flowing mode
$cw=&amp;$this->CurrentFont&#91;'cw'&#93;;
$w=$this->w-$this->rMargin-$this->x;
$wmax=&#40;$w-2*$this->cMargin&#41;*1000/$this->FontSize;
$s=str_replace&#40;"\r",'',$txt&#41;;
$nb=strlen&#40;$s&#41;;
$sep=-1;
$i=0;
$j=0;
$l=0;
$nl=1;
while&#40;$i<$nb&#41;
&#123;
//Get next character
$c=$s&#123;$i&#125;;
if&#40;$c=="\n"&#41;
&#123;
//Explicit line break
$this->Cell&#40;$w,$h,substr&#40;$s,$j,$i-$j&#41;,0,2,'',0,$link&#41;;
$i++;
$sep=-1;
$j=$i;
$l=0;
if&#40;$nl==1&#41;
&#123;
$this->x=$this->lMargin;
$w=$this->w-$this->rMargin-$this->x;
$wmax=&#40;$w-2*$this->cMargin&#41;*1000/$this->FontSize;
&#125;
$nl++;
continue;
&#125;
if&#40;$c==' '&#41;
$sep=$i;
$l+=$cw&#91;$c&#93;;
if&#40;$l>$wmax&#41;
&#123;
//Automatic line break
if&#40;$sep==-1&#41;
&#123;
if&#40;$this->x>$this->lMargin&#41;
&#123;
//Move to next line
$this->x=$this->lMargin;
$this->y+=$h;
$w=$this->w-$this->rMargin-$this->x;
$wmax=&#40;$w-2*$this->cMargin&#41;*1000/$this->FontSize;
$i++;
$nl++;
continue;
&#125;
if&#40;$i==$j&#41;
$i++;
$this->Cell&#40;$w,$h,substr&#40;$s,$j,$i-$j&#41;,0,2,'',0,$link&#41;;
&#125;
else
&#123;
$this->Cell&#40;$w,$h,substr&#40;$s,$j,$sep-$j&#41;,0,2,'',0,$link&#41;;
$i=$sep+1;
&#125;
$sep=-1;
$j=$i;
$l=0;
if&#40;$nl==1&#41;
&#123;
$this->x=$this->lMargin;
$w=$this->w-$this->rMargin-$this->x;
$wmax=&#40;$w-2*$this->cMargin&#41;*1000/$this->FontSize;
&#125;
$nl++;
&#125;
else
$i++;
&#125;
//Last chunk
if&#40;$i!=$j&#41;
$this->Cell&#40;$l/1000*$this->FontSize,$h,substr&#40;$s,$j&#41;,0,0,'',0,$link&#41;;
&#125;

function Image&#40;$file,$x,$y,$w=0,$h=0,$type='',$link=''&#41;
&#123;
//Put an image on the page
if&#40;!isset&#40;$this->images&#91;$file&#93;&#41;&#41;
&#123;
//First use of image, get info
if&#40;$type==''&#41;
&#123;
$pos=strrpos&#40;$file,'.'&#41;;
if&#40;!$pos&#41;
$this->Error&#40;'Image file has no extension and no type was specified&#58; '.$file&#41;;
$type=substr&#40;$file,$pos+1&#41;;
&#125;
$type=strtolower&#40;$type&#41;;
$mqr=get_magic_quotes_runtime&#40;&#41;;
set_magic_quotes_runtime&#40;0&#41;;
if&#40;$type=='jpg' or $type=='jpeg'&#41;
$info=$this->_parsejpg&#40;$file&#41;;
elseif&#40;$type=='gif'&#41;
$info=$this->_parsegif&#40;$file&#41;;
elseif&#40;$type=='png'&#41;
$info=$this->_parsepng&#40;$file&#41;;
else
&#123;
//Allow for additional formats
$mtd='_parse'.$type;
if&#40;!method_exists&#40;$this,$mtd&#41;&#41;
$this->Error&#40;'Unsupported image type&#58; '.$type&#41;;
$info=$this->$mtd&#40;$file&#41;;
&#125;
set_magic_quotes_runtime&#40;$mqr&#41;;
$info&#91;'i'&#93;=count&#40;$this->images&#41;+1;
$this->images&#91;$file&#93;=$info;
&#125;
else
$info=$this->images&#91;$file&#93;;
//Automatic width and height calculation if needed
if&#40;$w==0 and $h==0&#41;
&#123;
//Put image at 72 dpi
$w=$info&#91;'w'&#93;/$this->k;
$h=$info&#91;'h'&#93;/$this->k;
&#125;
if&#40;$w==0&#41;
$w=$h*$info&#91;'w'&#93;/$info&#91;'h'&#93;;
if&#40;$h==0&#41;
$h=$w*$info&#91;'h'&#93;/$info&#91;'w'&#93;;
$this->_out&#40;sprintf&#40;'q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,&#40;$this->h-&#40;

$y+$h&#41;&#41;*$this->k,$info&#91;'i'&#93;&#41;&#41;;
if&#40;$link&#41;
$this->Link&#40;$x,$y,$w,$h,$link&#41;;
&#125;

function Ln&#40;$h=''&#41;
&#123;
//Line feed; default value is last cell height
$this->x=$this->lMargin;
if&#40;is_string&#40;$h&#41;&#41;
$this->y+=$this->lasth;
else
$this->y+=$h;
&#125;

function GetX&#40;&#41;
&#123;
//Get x position
return $this->x;
&#125;

function SetX&#40;$x&#41;
&#123;
//Set x position
if&#40;$x>=0&#41;
$this->x=$x;
else
$this->x=$this->w+$x;
&#125;

function GetY&#40;&#41;
&#123;
//Get y position
return $this->y;
&#125;

function SetY&#40;$y&#41;
&#123;
//Set y position and reset x
$this->x=$this->lMargin;
if&#40;$y>=0&#41;
$this->y=$y;
else
$this->y=$this->h+$y;
&#125;

function SetXY&#40;$x,$y&#41;
&#123;
//Set x and y positions
$this->SetY&#40;$y&#41;;
$this->SetX&#40;$x&#41;;
&#125;

function Output&#40;$name='',$dest=''&#41;
&#123;
//Output PDF to some destination
global $HTTP_SERVER_VARS;

//Finish document if necessary
if&#40;$this->state<3&#41;
$this->Close&#40;&#41;;
//Normalize parameters
if&#40;is_bool&#40;$dest&#41;&#41;
$dest=$dest ? 'D' &#58; 'F';
$dest=strtoupper&#40;$dest&#41;;
if&#40;$dest==''&#41;
&#123;
if&#40;$name==''&#41;
&#123;
$name='doc.pdf';
$dest='I';
&#125;
else
$dest='F';
&#125;
switch&#40;$dest&#41;
&#123;
case 'I'&#58;
//Send to standard output
if&#40;isset&#40;$HTTP_SERVER_VARS&#91;'SERVER_NAME'&#93;&#41;&#41;
&#123;
//We send to a browser
Header&#40;'Content-Type&#58; application/pdf'&#41;;
if&#40;headers_sent&#40;&#41;&#41;
$this->Error&#40;'Some data has already been output to browser, can\'t send PDF

file'&#41;;
Header&#40;'Content-Length&#58; '.strlen&#40;$this->buffer&#41;&#41;;
Header&#40;'Content-disposition&#58; inline; filename='.$name&#41;;
&#125;
echo $this->buffer;
break;
case 'D'&#58;
//Download file
if&#40;isset&#40;$HTTP_SERVER_VARS&#91;'HTTP_USER_AGENT'&#93;&#41; and strpos&#40;$HTTP_SERVER_VARS&#91;

'HTTP_USER_AGENT'&#93;,'MSIE'&#41;&#41;
Header&#40;'Content-Type&#58; application/force-download'&#41;;
else
Header&#40;'Content-Type&#58; application/octet-stream'&#41;;
if&#40;headers_sent&#40;&#41;&#41;
$this->Error&#40;'Some data has already been output to browser, can\'t send PDF file'&#41;;
Header&#40;'Content-Length&#58; '.strlen&#40;$this->buffer&#41;&#41;;
Header&#40;'Content-disposition&#58; attachment; filename='.$name&#41;;
echo $this->buffer;
break;
case 'F'&#58;
//Save to local file
$f=fopen&#40;$name,'wb'&#41;;
if&#40;!$f&#41;
$this->Error&#40;'Unable to create output file&#58; '.$name&#41;;
fwrite&#40;$f,$this->buffer,strlen&#40;$this->buffer&#41;&#41;;
fclose&#40;$f&#41;;
break;
case 'S'&#58;
//Return as a string
return $this->buffer;
default&#58;
$this->Error&#40;'Incorrect output destination&#58; '.$dest&#41;;
&#125;
return '';
&#125;

/************************************************** *****************************
* *
* Protected methods *
* *
************************************************** *****************************/
function _dochecks&#40;&#41;
&#123;
//Check for locale-related bug
if&#40;1.1==1&#41;
$this->Error&#40;'Don\'t alter the locale before including class file'&#41;;
//Check for decimal separator
if&#40;sprintf&#40;'%.1f',1.0&#41;!='1.0'&#41;
setlocale&#40;LC_NUMERIC,'C'&#41;;
&#125;

function _begindoc&#40;&#41;
&#123;
//Start document
$this->state=1;
$this->_out&#40;'%PDF-1.3'&#41;;
&#125;

function _putpages&#40;&#41;
&#123;
$nb=$this->page;
if&#40;!empty&#40;$this->AliasNbPages&#41;&#41;
&#123;
//Replace number of pages
for&#40;$n=1;$n<=$nb;$n++&#41;
$this->pages&#91;$n&#93;=str_replace&#40;$this->AliasNbPages,$nb,$this->pages&#91;$n&#93;&#41;;
&#125;
if&#40;$this->DefOrientation=='P'&#41;
&#123;
$wPt=$this->fwPt;
$hPt=$this->fhPt;
&#125;
else
&#123;
$wPt=$this->fhPt;
$hPt=$this->fwPt;
&#125;
$filter=&#40;$this->compress&#41; ? '/Filter /FlateDecode ' &#58; '';
for&#40;$n=1;$n<=$nb;$n++&#41;
&#123;
//Page
$this->_newobj&#40;&#41;;
$this->_out&#40;'<</Type /Page'&#41;;
$this->_out&#40;'/Parent 1 0 R'&#41;;
if&#40;isset&#40;$this->OrientationChanges&#91;$n&#93;&#41;&#41;
$this->_out&#40;sprintf&#40;'/MediaBox &#91;0 0 %.2f %.2f&#93;',$hPt,$wPt&#41;&#41;;
$this->_out&#40;'/Resources 2 0 R'&#41;;
if&#40;isset&#40;$this->PageLinks&#91;$n&#93;&#41;&#41;
&#123;
//Links
$annots='/Annots &#91;';
foreach&#40;$this->PageLinks&#91;$n&#93; as $pl&#41;
&#123;
$rect=sprintf&#40;'%.2f %.2f %.2f %.2f',$pl&#91;0&#93;,$pl&#91;1&#93;,$pl&#91;0&#93;+$pl&#91;2&#93;,$pl&#91;1&#93;-$pl&#91;3&#93;&#41;;
$annots.='<</Type /Annot /Subtype /Link /Rect &#91;'.$rect.'&#93; /Border &#91;0 0 0&#93; ';
if&#40;is_string&#40;$pl&#91;4&#93;&#41;&#41;
$annots.='/A <</S /URI /URI '.$this->_textstring&#40;$pl&#91;4&#93;&#41;.'>>>>';
else
&#123;
$l=$this->links&#91;$pl&#91;4&#93;&#93;;
$h=isset&#40;$this->OrientationChanges&#91;$l&#91;0&#93;&#93;&#41; ? $wPt &#58; $hPt;
$annots.=sprintf&#40;'/Dest &#91;%d 0 R /XYZ 0 %.2f null&#93;>>',1+2*$l&#91;0&#93;,$h-$l&#91;1&#93;*

$this->k&#41;;
&#125;
&#125;
$this->_out&#40;$annots.'&#93;'&#41;;
&#125;
$this->_out&#40;'/Contents '.&#40;$this->n+1&#41;.' 0 R>>'&#41;;
$this->_out&#40;'endobj'&#41;;
//Page content
$p=&#40;$this->compress&#41; ? gzcompress&#40;$this->pages&#91;$n&#93;&#41; &#58; $this->pages&#91;$n&#93;;
$this->_newobj&#40;&#41;;
$this->_out&#40;'<<'.$filter.'/Length '.strlen&#40;$p&#41;.'>>'&#41;;
$this->_putstream&#40;$p&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;
//Pages root
$this->offsets&#91;1&#93;=strlen&#40;$this->buffer&#41;;
$this->_out&#40;'1 0 obj'&#41;;
$this->_out&#40;'<</Type /Pages'&#41;;
$kids='/Kids &#91;';
for&#40;$i=0;$i<$nb;$i++&#41;
$kids.=&#40;3+2*$i&#41;.' 0 R ';
$this->_out&#40;$kids.'&#93;'&#41;;
$this->_out&#40;'/Count '.$nb&#41;;
$this->_out&#40;sprintf&#40;'/MediaBox &#91;0 0 %.2f %.2f&#93;',$wPt,$hPt&#41;&#41;;
$this->_out&#40;'>>'&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;

function _putfonts&#40;&#41;
&#123;
$nf=$this->n;
foreach&#40;$this->diffs as $diff&#41;
&#123;
//Encodings
$this->_newobj&#40;&#41;;
$this->_out&#40;'<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences &#91;'.$diff.'&#93;>>'&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;
$mqr=get_magic_quotes_runtime&#40;&#41;;
set_magic_quotes_runtime&#40;0&#41;;
foreach&#40;$this->FontFiles as $file=>$info&#41;
&#123;
//Font file embedding
$this->_newobj&#40;&#41;;
$this->FontFiles&#91;$file&#93;&#91;'n'&#93;=$this->n;
if&#40;defined&#40;'FPDF_FONTPATH'&#41;&#41;
$file=FPDF_FONTPATH.$file;
$size=filesize&#40;$file&#41;;
if&#40;!$size&#41;
$this->Error&#40;'Font file not found'&#41;;
$this->_out&#40;'<</Length '.$size&#41;;
if&#40;substr&#40;$file,-2&#41;=='.z'&#41;
$this->_out&#40;'/Filter /FlateDecode'&#41;;
$this->_out&#40;'/Length1 '.$info&#91;'length1'&#93;&#41;;
if&#40;isset&#40;$info&#91;'length2'&#93;&#41;&#41;
$this->_out&#40;'/Length2 '.$info&#91;'length2'&#93;.' /Length3 0'&#41;;
$this->_out&#40;'>>'&#41;;
$f=fopen&#40;$file,'rb'&#41;;
$this->_putstream&#40;fread&#40;$f,$size&#41;&#41;;
fclose&#40;$f&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;
set_magic_quotes_runtime&#40;$mqr&#41;;
foreach&#40;$this->fonts as $k=>$font&#41;
&#123;
//Font objects
$this->fonts&#91;$k&#93;&#91;'n'&#93;=$this->n+1;
$type=$font&#91;'type'&#93;;
$name=$font&#91;'name'&#93;;
if&#40;$type=='core'&#41;
&#123;
//Standard font
$this->_newobj&#40;&#41;;
$this->_out&#40;'<</Type /Font'&#41;;
$this->_out&#40;'/BaseFont /'.$name&#41;;
$this->_out&#40;'/Subtype /Type1'&#41;;
if&#40;$name!='Symbol' and $name!='ZapfDingbats'&#41;
$this->_out&#40;'/Encoding /WinAnsiEncoding'&#41;;
$this->_out&#40;'>>'&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;
elseif&#40;$type=='Type1' or $type=='TrueType'&#41;
&#123;
//Additional Type1 or TrueType font
$this->_newobj&#40;&#41;;
$this->_out&#40;'<</Type /Font'&#41;;
$this->_out&#40;'/BaseFont /'.$name&#41;;
$this->_out&#40;'/Subtype /'.$type&#41;;
$this->_out&#40;'/FirstChar 32 /LastChar 255'&#41;;
$this->_out&#40;'/Widths '.&#40;$this->n+1&#41;.' 0 R'&#41;;
$this->_out&#40;'/FontDescriptor '.&#40;$this->n+2&#41;.' 0 R'&#41;;
if&#40;$font&#91;'enc'&#93;&#41;
&#123;
if&#40;isset&#40;$font&#91;'diff'&#93;&#41;&#41;
$this->_out&#40;'/Encoding '.&#40;$nf+$font&#91;'diff'&#93;&#41;.' 0 R'&#41;;
else
$this->_out&#40;'/Encoding /WinAnsiEncoding'&#41;;
&#125;
$this->_out&#40;'>>'&#41;;
$this->_out&#40;'endobj'&#41;;
//Widths
$this->_newobj&#40;&#41;;
$cw=&amp;$font&#91;'cw'&#93;;
$s='&#91;';
for&#40;$i=32;$i<=255;$i++&#41;
$s.=$cw&#91;chr&#40;$i&#41;&#93;.' ';
$this->_out&#40;$s.'&#93;'&#41;;
$this->_out&#40;'endobj'&#41;;
//Descriptor
$this->_newobj&#40;&#41;;
$s='<</Type /FontDescriptor /FontName /'.$name;
foreach&#40;$font&#91;'desc'&#93; as $k=>$v&#41;
$s.=' /'.$k.' '.$v;
$file=$font&#91;'file'&#93;;
if&#40;$file&#41;
$s.=' /FontFile'.&#40;$type=='Type1' ? '' &#58; '2'&#41;.' '.$this->FontFiles&#91;$file&#93;&#91;'n'&#93;.' 0 R';
$this->_out&#40;$s.'>>'&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;
else
&#123;
//Allow for additional types
$mtd='_put'.strtolower&#40;$type&#41;;
if&#40;!method_exists&#40;$this,$mtd&#41;&#41;
$this->Error&#40;'Unsupported font type&#58; '.$type&#41;;
$this->$mtd&#40;$font&#41;;
&#125;
&#125;
&#125;

function _putimages&#40;&#41;
&#123;
$filter=&#40;$this->compress&#41; ? '/Filter /FlateDecode ' &#58; '';
reset&#40;$this->images&#41;;
while&#40;list&#40;$file,$info&#41;=each&#40;$this->images&#41;&#41;
&#123;
$this->_newobj&#40;&#41;;
$this->images&#91;$file&#93;&#91;'n'&#93;=$this->n;
$this->_out&#40;'<</Type /XObject'&#41;;
$this->_out&#40;'/Subtype /Image'&#41;;
$this->_out&#40;'/Width '.$info&#91;'w'&#93;&#41;;
$this->_out&#40;'/Height '.$info&#91;'h'&#93;&#41;;
if&#40;$info&#91;'cs'&#93;=='Indexed'&#41;
$this->_out&#40;'/ColorSpace &#91;/Indexed /DeviceRGB '.&#40;strlen&#40;$info&#91;'pal'&#93;&#41;/3-1&#41;.' '.&#40;$this->n+1&#41;.'

0 R&#93;'&#41;;
else
&#123;
$this->_out&#40;'/ColorSpace /'.$info&#91;'cs'&#93;&#41;;
if&#40;$info&#91;'cs'&#93;=='DeviceCMYK'&#41;
$this->_out&#40;'/Decode &#91;1 0 1 0 1 0 1 0&#93;'&#41;;
&#125;
$this->_out&#40;'/BitsPerComponent '.$info&#91;'bpc'&#93;&#41;;
$this->_out&#40;'/Filter /'.$info&#91;'f'&#93;&#41;;
if&#40;isset&#40;$info&#91;'parms'&#93;&#41;&#41;
$this->_out&#40;$info&#91;'parms'&#93;&#41;;
if&#40;isset&#40;$info&#91;'trns'&#93;&#41; and is_array&#40;$info&#91;'trns'&#93;&#41;&#41;
&#123;
$trns='';
for&#40;$i=0;$i<count&#40;$info&#91;'trns'&#93;&#41;;$i++&#41;
$trns.=$info&#91;'trns'&#93;&#91;$i&#93;.' '.$info&#91;'trns'&#93;&#91;$i&#93;.' ';
$this->_out&#40;'/Mask &#91;'.$trns.'&#93;'&#41;;
&#125;
$this->_out&#40;'/Length '.strlen&#40;$info&#91;'data'&#93;&#41;.'>>'&#41;;
$this->_putstream&#40;$info&#91;'data'&#93;&#41;;
unset&#40;$this->images&#91;$file&#93;&#91;'data'&#93;&#41;;
$this->_out&#40;'endobj'&#41;;
//Palette
if&#40;$info&#91;'cs'&#93;=='Indexed'&#41;
&#123;
$this->_newobj&#40;&#41;;
$pal=&#40;$this->compress&#41; ? gzcompress&#40;$info&#91;'pal'&#93;&#41; &#58; $info&#91;'pal'&#93;;
$this->_out&#40;'<<'.$filter.'/Length '.strlen&#40;$pal&#41;.'>>'&#41;;
$this->_putstream&#40;$pal&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;
&#125;
&#125;

function _putresources&#40;&#41;
&#123;
$this->_putfonts&#40;&#41;;
$this->_putimages&#40;&#41;;
//Resource dictionary
$this->offsets&#91;2&#93;=strlen&#40;$this->buffer&#41;;
$this->_out&#40;'2 0 obj'&#41;;
$this->_out&#40;'<</ProcSet &#91;/PDF /Text /ImageB /ImageC /ImageI&#93;'&#41;;
$this->_out&#40;'/Font <<'&#41;;
foreach&#40;$this->fonts as $font&#41;
$this->_out&#40;'/F'.$font&#91;'i'&#93;.' '.$font&#91;'n'&#93;.' 0 R'&#41;;
$this->_out&#40;'>>'&#41;;
if&#40;count&#40;$this->images&#41;&#41;
&#123;
$this->_out&#40;'/XObject <<'&#41;;
foreach&#40;$this->images as $image&#41;
$this->_out&#40;'/I'.$image&#91;'i'&#93;.' '.$image&#91;'n'&#93;.' 0 R'&#41;;
$this->_out&#40;'>>'&#41;;
&#125;
$this->_out&#40;'>>'&#41;;
$this->_out&#40;'endobj'&#41;;
&#125;

function _putinfo&#40;&#41;
&#123;
$this->_out&#40;'/Producer '.$this->_textstring&#40;'FPDF '.FPDF_VERSION&#41;&#41;;
if&#40;!empty&#40;$this->title&#41;&#41;
$this->_out&#40;'/Title '.$this->_textstring&#40;$this->title&#41;&#41;;
if&#40;!empty&#40;$this->subject&#41;&#41;
$this->_out&#40;'/Subject '.$this->_textstring&#40;$this->subject&#41;&#41;;
if&#40;!empty&#40;$this->author&#41;&#41;
$this->_out&#40;'/Author '.$this->_textstring&#40;$this->author&#41;&#41;;
if&#40;!empty&#40;$this->keywords&#41;&#41;
$this->_out&#40;'/Keywords '.$this->_textstring&#40;$this->keywords&#41;&#41;;
if&#40;!empty&#40;$this->creator&#41;&#41;
$this->_out&#40;'/Creator '.$this->_textstring&#40;$this->creator&#41;&#41;;
$this->_out&#40;'/CreationDate '.$this->_textstring&#40;'D&#58;'.date&#40;'YmdHis'&#41;&#41;&#41;;
&#125;

function _putcatalog&#40;&#41;
&#123;
$this->_out&#40;'/Type /Catalog'&#41;;
$this->_out&#40;'/Pages 1 0 R'&#41;;
if&#40;$this->ZoomMode=='fullpage'&#41;
$this->_out&#40;'/OpenAction &#91;3 0 R /Fit&#93;'&#41;;
elseif&#40;$this->ZoomMode=='fullwidth'&#41;
$this->_out&#40;'/OpenAction &#91;3 0 R /FitH null&#93;'&#41;;
elseif&#40;$this->ZoomMode=='real'&#41;
$this->_out&#40;'/OpenAction &#91;3 0 R /XYZ null null 1&#93;'&#41;;
elseif&#40;!is_string&#40;$this->ZoomMode&#41;&#41;
$this->_out&#40;'/OpenAction &#91;3 0 R /XYZ null null '.&#40;$this->ZoomMode/100&#41;.'&#93;'&#41;;
if&#40;$this->LayoutMode=='single'&#41;
$this->_out&#40;'/PageLayout /SinglePage'&#41;;
elseif&#40;$this->LayoutMode=='continuous'&#41;
$this->_out&#40;'/PageLayout /OneColumn'&#41;;
elseif&#40;$this->LayoutMode=='two'&#41;
$this->_out&#40;'/PageLayout /TwoColumnLeft'&#41;;
&#125;

function _puttrailer&#40;&#41;
&#123;
$this->_out&#40;'/Size '.&#40;$this->n+1&#41;&#41;;
$this->_out&#40;'/Root '.$this->n.' 0 R'&#41;;
$this->_out&#40;'/Info '.&#40;$this->n-1&#41;.' 0 R'&#41;;
&#125;

function _enddoc&#40;&#41;
&#123;
$this->_putpages&#40;&#41;;
$this->_putresources&#40;&#41;;
//Info
$this->_newobj&#40;&#41;;
$this->_out&#40;'<<'&#41;;
$this->_putinfo&#40;&#41;;
$this->_out&#40;'>>'&#41;;
$this->_out&#40;'endobj'&#41;;
//Catalog
$this->_newobj&#40;&#41;;
$this->_out&#40;'<<'&#41;;
$this->_putcatalog&#40;&#41;;
$this->_out&#40;'>>'&#41;;
$this->_out&#40;'endobj'&#41;;
//Cross-ref
$o=strlen&#40;$this->buffer&#41;;
$this->_out&#40;'xref'&#41;;
$this->_out&#40;'0 '.&#40;$this->n+1&#41;&#41;;
$this->_out&#40;'0000000000 65535 f '&#41;;
for&#40;$i=1;$i<=$this->n;$i++&#41;
$this->_out&#40;sprintf&#40;'%010d 00000 n ',$this->offsets&#91;$i&#93;&#41;&#41;;
//Trailer
$this->_out&#40;'trailer'&#41;;
$this->_out&#40;'<<'&#41;;
$this->_puttrailer&#40;&#41;;
$this->_out&#40;'>>'&#41;;
$this->_out&#40;'startxref'&#41;;
$this->_out&#40;$o&#41;;
$this->_out&#40;'%%EOF'&#41;;
$this->state=3;
&#125;

function _beginpage&#40;$orientation&#41;
&#123;
$this->page++;
$this->pages&#91;$this->page&#93;='';
$this->state=2;
$this->x=$this->lMargin;
$this->y=$this->tMargin;
$this->FontFamily='';
//Page orientation
if&#40;!$orientation&#41;
$orientation=$this->DefOrientation;
else
&#123;
$orientation=strtoupper&#40;$orientation&#123;0&#125;&#41;;
if&#40;$orientation!=$this->DefOrientation&#41;
$this->OrientationChanges&#91;$this->page&#93;=true;
&#125;
if&#40;$orientation!=$this->CurOrientation&#41;
&#123;
//Change orientation
if&#40;$orientation=='P'&#41;
&#123;
$this->wPt=$this->fwPt;
$this->hPt=$this->fhPt;
$this->w=$this->fw;
$this->h=$this->fh;
&#125;
else
&#123;
$this->wPt=$this->fhPt;
$this->hPt=$this->fwPt;
$this->w=$this->fh;
$this->h=$this->fw;
&#125;
$this->PageBreakTrigger=$this->h-$this->bMargin;
$this->CurOrientation=$orientation;
&#125;
&#125;

function _endpage&#40;&#41;
&#123;
//End of page contents
$this->state=1;
&#125;

function _newobj&#40;&#41;
&#123;
//Begin a new object
$this->n++;
$this->offsets&#91;$this->n&#93;=strlen&#40;$this->buffer&#41;;
$this->_out&#40;$this->n.' 0 obj'&#41;;
&#125;

function _dounderline&#40;$x,$y,$txt&#41;
&#123;
//Underline text
$up=$this->CurrentFont&#91;'up'&#93;;
$ut=$this->CurrentFont&#91;'ut'&#93;;
$w=$this->GetStringWidth&#40;$txt&#41;+$this->ws*substr_count&#40;$txt,' '&#41;;
return sprintf&#40;'%.2f %.2f %.2f %.2f re f',$x*$this->k,&#40;$this->h-&#40;$y-$up/1000*$this->FontSize&#41;&#41;*$this->k,$w*

$this->k,-$ut/1000*$this->FontSizePt&#41;;
&#125;

function _parsejpg&#40;$file&#41;
&#123;
//Extract info from a JPEG file
$a=GetImageSize&#40;$file&#41;;
if&#40;!$a&#41;
$this->Error&#40;'Missing or incorrect image file&#58; '.$file&#41;;
if&#40;$a&#91;2&#93;!=2&#41;
$this->Error&#40;'Not a JPEG file&#58; '.$file&#41;;
if&#40;!isset&#40;$a&#91;'channels'&#93;&#41; or $a&#91;'channels'&#93;==3&#41;
$colspace='DeviceRGB';
elseif&#40;$a&#91;'channels'&#93;==4&#41;
$colspace='DeviceCMYK';
else
$colspace='DeviceGray';
$bpc=isset&#40;$a&#91;'bits'&#93;&#41; ? $a&#91;'bits'&#93; &#58; 8;
//Read whole file
$f=fopen&#40;$file,'rb'&#41;;
$data='';
while&#40;!feof&#40;$f&#41;&#41;
$data.=fread&#40;$f,4096&#41;;
fclose&#40;$f&#41;;
return array&#40;'w'=>$a&#91;0&#93;,'h'=>$a&#91;1&#93;,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data&#41;;
&#125;

function _parsegif&#40;$file&#41;
&#123;
//Extract info from a GIF file
$a=GetImageSize&#40;$file&#41;;
if&#40;!$a&#41;
$this->Error&#40;'Missing or incorrect image file&#58; '.$file&#41;;
if&#40;$a&#91;2&#93;!=1&#41;
$this->Error&#40;'Not a GIF file&#58; '.$file&#41;;
if&#40;!isset&#40;$a&#91;'channels'&#93;&#41; or $a&#91;'channels'&#93;==3&#41;
$colspace='DeviceRGB';
elseif&#40;$a&#91;'channels'&#93;==4&#41;
$colspace='DeviceCMYK';
else
$colspace='DeviceGray';
$bpc=isset&#40;$a&#91;'bits'&#93;&#41; ? $a&#91;'bits'&#93; &#58; 8;
//Read whole file
$f=fopen&#40;$file,'rb'&#41;;
$data='';
while&#40;!feof&#40;$f&#41;&#41;
$data.=fread&#40;$f,4096&#41;;
fclose&#40;$f&#41;;
return array&#40;'w'=>$a&#91;0&#93;,'h'=>$a&#91;1&#93;,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data&#41;;
&#125;

function _parsepng&#40;$file&#41;
&#123;
//Extract info from a PNG file
$f=fopen&#40;$file,'rb'&#41;;
if&#40;!$f&#41;
$this->Error&#40;'Can\'t open image file&#58; '.$file&#41;;
//Check signature
if&#40;fread&#40;$f,8&#41;!=chr&#40;137&#41;.'PNG'.chr&#40;13&#41;.chr&#40;10&#41;.chr &#40;26&#41;.chr&#40;10&#41;&#41;
$this->Error&#40;'Not a PNG file&#58; '.$file&#41;;
//Read header chunk
fread&#40;$f,4&#41;;
if&#40;fread&#40;$f,4&#41;!='IHDR'&#41;
$this->Error&#40;'Incorrect PNG file&#58; '.$file&#41;;
$w=$this->_freadint&#40;$f&#41;;
$h=$this->_freadint&#40;$f&#41;;
$bpc=ord&#40;fread&#40;$f,1&#41;&#41;;
if&#40;$bpc>8&#41;
$this->Error&#40;'16-bit depth not supported&#58; '.$file&#41;;
$ct=ord&#40;fread&#40;$f,1&#41;&#41;;
if&#40;$ct==0&#41;
$colspace='DeviceGray';
elseif&#40;$ct==2&#41;
$colspace='DeviceRGB';
elseif&#40;$ct==3&#41;
$colspace='Indexed';
else
$this->Error&#40;'Alpha channel not supported&#58; '.$file&#41;;
if&#40;ord&#40;fread&#40;$f,1&#41;&#41;!=0&#41;
$this->Error&#40;'Unknown compression method&#58; '.$file&#41;;
if&#40;ord&#40;fread&#40;$f,1&#41;&#41;!=0&#41;
$this->Error&#40;'Unknown filter method&#58; '.$file&#41;;
if&#40;ord&#40;fread&#40;$f,1&#41;&#41;!=0&#41;
$this->Error&#40;'Interlacing not supported&#58; '.$file&#41;;
fread&#40;$f,4&#41;;
$parms='/DecodeParms <</Predictor 15 /Colors '.&#40;$ct==2 ? 3 &#58; 1&#41;.' /BitsPerComponent '.$bpc.' /Columns '.$w.

'>>';
//Scan chunks looking for palette, transparency and image data
$pal='';
$trns='';
$data='';
do
&#123;
$n=$this->_freadint&#40;$f&#41;;
$type=fread&#40;$f,4&#41;;
if&#40;$type=='PLTE'&#41;
&#123;
//Read palette
$pal=fread&#40;$f,$n&#41;;
fread&#40;$f,4&#41;;
&#125;
elseif&#40;$type=='tRNS'&#41;
&#123;
//Read transparency info
$t=fread&#40;$f,$n&#41;;
if&#40;$ct==0&#41;
$trns=array&#40;ord&#40;substr&#40;$t,1,1&#41;&#41;&#41;;
elseif&#40;$ct==2&#41;
$trns=array&#40;ord&#40;substr&#40;$t,1,1&#41;&#41;,ord&#40;substr&#40;$t,3,1&#41; &#41;,ord&#40;substr&#40;$t,5,1&#41;&#41;&#41;;
else
&#123;
$pos=strpos&#40;$t,chr&#40;0&#41;&#41;;
if&#40;is_int&#40;$pos&#41;&#41;
$trns=array&#40;$pos&#41;;
&#125;
fread&#40;$f,4&#41;;
&#125;
elseif&#40;$type=='IDAT'&#41;
&#123;
//Read image data block
$data.=fread&#40;$f,$n&#41;;
fread&#40;$f,4&#41;;
&#125;
elseif&#40;$type=='IEND'&#41;
break;
else
fread&#40;$f,$n+4&#41;;
&#125;
while&#40;$n&#41;;
if&#40;$colspace=='Indexed' and empty&#40;$pal&#41;&#41;
$this->Error&#40;'Missing palette in '.$file&#41;;
fclose&#40;$f&#41;;
return array&#40;'w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=

>$pal,'trns'=>$trns,'data'=>$data&#41;;
&#125;

function _freadint&#40;$f&#41;
&#123;
//Read a 4-byte integer from file
$i=ord&#40;fread&#40;$f,1&#41;&#41;<<24;
$i+=ord&#40;fread&#40;$f,1&#41;&#41;<<16;
$i+=ord&#40;fread&#40;$f,1&#41;&#41;<<8;
$i+=ord&#40;fread&#40;$f,1&#41;&#41;;
return $i;
&#125;

function _textstring&#40;$s&#41;
&#123;
//Format a text string
return '&#40;'.$this->_escape&#40;$s&#41;.'&#41;';
&#125;

function _escape&#40;$s&#41;
&#123;
//Add \ before \, &#40; and &#41;
return str_replace&#40;'&#41;','\\&#41;',str_replace&#40;'&#40;','\\&#40;',str_re place&#40;'\\','\\\\',$s&#41;&#41;&#41;;
&#125;

function _putstream&#40;$s&#41;
&#123;
$this->_out&#40;'stream'&#41;;
$this->_out&#40;$s&#41;;
$this->_out&#40;'endstream'&#41;;
&#125;

function _out&#40;$s&#41;
&#123;
//Add a line to the document
if&#40;$this->state==2&#41;
$this->pages&#91;$this->page&#93;.=$s."\n";
else
$this->buffer.=$s."\n";
&#125;
//End of class
&#125;

//Handle special IE contype request
if&#40;isset&#40;$HTTP_SERVER_VARS&#91;'HTTP_USER_AGENT'&#93;&#41; and $HTTP_SERVER_VARS&#91;'HTTP_USER_AGENT'&#93;=='contype'&#41;
&#123;
Header&#40;'Content-Type&#58; application/pdf'&#41;;
exit;
&#125;

&#125;
?>


All I did was put in an extra else if statement within the Image($file,$x,$y,$w=0,$h=0,$type='',$link='') which called a new function called _parsegif($file) function, which I created based on the original _parsejpg($file) funtion.

The set of else if statements tha now exist are as follows:


if&#40;$type=='jpg' or $type=='jpeg'&#41;
$info=$this->_parsejpg&#40;$file&#41;;
elseif&#40;$type=='gif'&#41;
$info=$this->_parsegif&#40;$file&#41;;
elseif&#40;$type=='png'&#41;
$info=$this->_parsepng&#40;$file&#41;;
else



The new function I added towards the bottom of fpdf.php is as follows:


function _parsegif&#40;$file&#41;
&#123;
//Extract info from a GIF file
$a=GetImageSize&#40;$file&#41;;
if&#40;!$a&#41;
$this->Error&#40;'Missing or incorrect image file&#58; '.$file&#41;;
if&#40;$a&#91;2&#93;!=1&#41;
$this->Error&#40;'Not a GIF file&#58; '.$file&#41;;
if&#40;!isset&#40;$a&#91;'channels'&#93;&#41; or $a&#91;'channels'&#93;==3&#41;
$colspace='DeviceRGB';
elseif&#40;$a&#91;'channels'&#93;==4&#41;
$colspace='DeviceCMYK';
else
$colspace='DeviceGray';
$bpc=isset&#40;$a&#91;'bits'&#93;&#41; ? $a&#91;'bits'&#93; &#58; 8;
//Read whole file
$f=fopen&#40;$file,'rb'&#41;;
$data='';
while&#40;!feof&#40;$f&#41;&#41;
$data.=fread&#40;$f,4096&#41;;
fclose&#40;$f&#41;;
return array&#40;'w'=>$a&#91;0&#93;,'h'=>$a&#91;1&#93;,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data&#41;;
&#125;

Cheers,

Rob Wisbey
http://www.robertwisbey.com

pedro
01-27-2004, 09:57 AM
Folks,

Just had a quick browse thru the above and it looks good, im gonna have a shot at implementing this later tonite. Can ye confirm that one just unpacks the fpdf to the relevant location and then cut 'n' shut the script in the first mail on this page into a document called index.php.

This can then be called from any php page along with the relevant listing id ?

Am I correctomundo ? Anything else I should try / look out for ?

best rgs, pedro.

JIM
01-27-2004, 06:52 PM
problem i download the fpdf152
ad i have put in a folder call pdf in the pdf i have add one file like index.php withe the folowing code




<?php

require('http://localhost/page/pdf/fpdf.php');

//Connect to your database
//include("conectmysql.php");
$connection = mysql_connect('localhost','root','')
or die ("Couldn't connect to database.");

$db = mysql_select_db('database')
or die ("Couldn't select database.");

$sql1 = "select * from default_listingsDB where ID = '$listingID'";
$sql2 = "select * from default_listingsImages where listing_id = '$listingID' ORDER BY rank";

//Select the results you want to show in your PDF file
$result=mysql_query($sql1, $connection);
$result2=mysql_query($sql2, $connection);

//Create new pdf file
$pdf=new FPDF();

//Disable automatic page break
$pdf->SetAutoPageBreak(false);

//Add first page
$pdf->AddPage();

//set initial y axis position per page
$y_axis = 25;
$x_axis = 18;
//var $y0;

//Set Row Height
$row_height = 4;

$y_axis = $y_axis + $row_height;

$pdf->SetFont('Arial','B',14);
//initialize counter
$i = 0;
while($row = mysql_fetch_array($result)) {

$ID = $row['ID'];
$Title = $row['Title'];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->Write(6,$Title);
//Go to next row
$y_axis = $y_axis + $row_height;
$i = $i + 1;
}

$i = 0;

$y_axis = $pdf->GetY() + 15;

while($row = mysql_fetch_array($result2)) {

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$listing_id = $row['listing_id'];
$file_name = $row['file_name'];
$thumb_file_name = $row['thumb_file_name'];
if ($i == 0) {
$pdf->Image("images/listing_photos/$file_name",75,$y_axis,100);
}

$pdf->Image("images/listing_photos/$thumb_file_name",20,$y_axis+$i,25);
//$pdf->Image('images/listing_photos/thumb_1_white-house.jpg',10,50,25);

//Go to next row
$y_axis = $pdf->GetY();
$y_axis = $y_axis + $row_height;
$i = $i + 22;
}

$y_axis = $pdf->GetY() + 65;
$x_axis = 68;

$pdf->SetFillColor(255,255,255);

$myArray = array('address', 'Tag', 'city', 'filler', 'state', 'section', 'zip', 'type', 'short_desc', 'sq_feet',
'price', 'lot_size', 'prop_tax', 'beds', 'garage_size', 'baths', 'status', 'floors', 'mls', 'year_built');

while ($stuff = array_shift($myArray)) {
$y_axis = $y_axis + 4;
$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$sql = "select field_caption from default_listingsFormElements where field_name = '$stuff' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$pdf->Cell(20,4,"$row[0]: ",'','',R,'');
$pdf->SetFont('Arial','',9);
}

$sql = "select field_value from default_listingsDBElements where field_name = '$stuff' and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if ($stuff == 'price') {
$row[0] = "$" . number_format($row[0], 2, '.', ',');
}
$pdf->Cell(40,4,"$row[0]");
}
$stuff = array_shift($myArray);
$pdf->SetFont('Arial','B',9);
$sql = "select field_caption from default_listingsFormElements where field_name = '$stuff' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if (!$row[0]) {
$pdf->Cell(30,4," ",'','',R,'');
}
else {
$pdf->Cell(30,4,"$row[0]: ",'','',R,'');
}
}
$pdf->SetFont('Arial','',9);

$sql = "select field_value from default_listingsDBElements where field_name = '$stuff' and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
if ($stuff == 'price') {
$row[0] = number_format($row[0], 2, '.', ',');
}
$pdf->Cell(40,4,"$row[0]");
}
$y_axis = $pdf->GetY();
}

$y_axis = $pdf->GetY() + 8;

$sql = "select a1.field_caption, a2.field_value from default_listingsFormElements as a1,
default_listingsDBElements as a2 where a1.field_name = 'full_desc' and a2.field_name = 'full_desc'
and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$FullDescCap = $row[0];
$FullDescVal = $row[1];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(20,4,"$FullDescCap: ",'','',R,'');
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(100,4,"$FullDescVal",'',L,'');
$y_axis = $pdf->GetY() + 4;
}

$sql = "select a1.field_caption, a2.field_value from default_listingsFormElements as a1,
default_listingsDBElements as a2 where a1.field_name = 'cemail' and a2.field_name = 'cemail'
and listing_id = '$listingID' limit 1";
$res = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($res)) {
$EmailCap = $row[0];
$EmailVal = $row[1];

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(20,4,"$EmailCap: ",'','',R,'');
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(100,4,"$EmailVal",'',L,'');
}

$y_axis = $pdf->GetY() + 4;

$pdf->SetY($y_axis);
$pdf->SetX($x_axis);
$pdf->Line(10,$y_axis,200,$y_axis);

$y_axis = $pdf->GetY() + 10;

$pdf->Image("images/flier.jpg",60,$y_axis,80);

mysql_close($connection);
//Create file
$pdf->Output();
?>



and later i put a link in the view.php
like <a target="_blank" href="pdf/index.php?listingID=<? echo $listingID; ?> "><b>Car PDF Catalog</b></a>

and.... click in one link .. but the result its
Fatal error: Cannot instantiate non-existent class: fpdf in c:\appserv\www\cosmo\pdf\index.php on line 21

any ideas ?

Anonymous
01-31-2004, 08:55 PM
looks like you are possibly working on a IIS box right? looks like your paths are wrong ('http://localhost/page/pdf/fpdf.php' vs. c:\appserv\www\cosmo\pdf\index.php) if your paths are right the FPD() Object should be able to be instantiated. Possible fix: include(cosmo/pdf/fpdf.php); Not familiar with you site structure so I'm just a guessing.

Anonymous
02-02-2004, 06:34 PM
If you cut and pasted you fpdf file from here, make sure it didnt get mangled in the process. Mine did so I got the original from the fpdf.org website and made the modifications suggested by bobbywise....

I got a similar error to yours but it complained about fpdf.php first of all... ring any bells ?

best rgs, pedro.
:wink:

Anonymous
02-02-2004, 10:09 PM
Folks,

Can anyone give me a scrap of code for the index.php file that will allow me to print out the home &amp; community features...

It has me a little confused at the moment...

rgs, pedro.

Anonymous
02-03-2004, 06:03 PM
Folks,

Can anyone give me a scrap of code for the index.php file that will allow me to print out the home &amp; community features...

It has me a little confused at the moment...

rgs, pedro.

Repost. The thread got lost so here we go again.

I did a little something and posted it here so please check it out.

http://www.open-realty.org/phpBB2/viewtopic.php?t=2204

iceman
03-04-2004, 07:58 AM
I noticed that "Home features" and "Community Features" are not included in the PDF layout.

Pls help as I tried whole day and couldn't get it right.

scd67
03-07-2004, 06:26 PM
Hey guys, thanks for sharing this awesome functionality with us! I'm having a bit of trouble getting the property features and images to output in my implementation. Albert, is there any way you can post some of your code from the awdcars site? I think if I could see a working implementation, I can get mine the way I want it.

awddesign
03-15-2004, 04:22 PM
Hi

Are you doing Houses or Cars?
As the code is not the same.

Al

scd67
03-15-2004, 04:36 PM
I'm doing houses. Anything that can help me get this going would be great, I can usually modify things the way I need them by looking at the code, but this still looks like foreign language to me. I'd like to get a similar type format to the way you did the cars brochure with the image(s) and listing info.

Thanks a million.

Steve

awddesign
03-15-2004, 10:35 PM
Hi

Here is a copy I found in the mod section

http://awdcars.co.uk/awd/>>removed<<

Al

scd67
03-16-2004, 04:58 AM
Thanks a million!

RichRodgers
03-27-2004, 11:08 AM
Looks like you guys have it all worked out so now my question is "WHERE IS IT?" :)

Mick
03-27-2004, 01:08 PM
It seems the copy that was posted in teh mods section was removed for some reason, although I'm not sure why.

However, the answer is in this thread you will see several people posted the code for this to work in this thread, you will just have to play with it a bit to get it working how you'd like.

caneaves
04-04-2004, 10:00 PM
If you need a copy of what was posted here as a Mod package that was compiled by 'The PcMan'.

Email me I will send you the package...

webmaster@jaagroundschool.com

Chris

FoxyWeb
04-05-2004, 08:37 AM
Rob Wisbey

I just went and looked at your site

Seems familiar I thought! Hidden in frames!

Went and had a look further and then looked at

http://www.properties-in-europe.com/listingview.php?listingID=40

Even more familiar!!!!

BUT WHATS THIS??????

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Thuir Ref: 5848</title>
<META name="title" content="Thuir Ref: 5848">
<meta name="Description" content="Properties in Europe is a European Property Portal containing a searchable database of European (French, Spanish, Italian, Portuguese properties to buy (for sale) or rent (for leasing). Properties in Europe is packed full of unbiased useful information about the processes involved in buying or renting a property in Europe (France, Spain, Italy, Portgual), and the European Tax Laws associated with owning a European (French, Spanish, Portuguese, Italian) property.">
<meta name="keywords" content="property,properties,in,france,french,spain,spanish ,portugal,portuguese,italy,italian,estate,agents,h omes,home,apartment,apartments,flat,flats,land,plo t,plots,house,houses,for,sale,buying,selling,rent, renting,leasing,accommodation,property,properties, tax,laws,mortgage,mortgages,europe,european">
<META name="owner" content="info@properties-in-europe.com">
<meta name="Author" content="www.scitech-solutions.com">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="English">
<META HTTP-EQUIV="VW96.OBJECT TYPE" CONTENT="Document">
<META HTTP-EQUIV="CHARSET" CONTENT="ISO-8859-1">
<META HTTP-EQUIV="EXPIRES" content="+1000 days">
<META NAME="REVISIT-AFTER" CONTENT="5 days">
<META NAME="RATING" CONTENT="General">
<META NAME="ROBOTS" CONTENT="ALL">

<link rel=stylesheet href="http://www.properties-in-europe.com/template/vertical-menu/style.css" type="text/css">
<script language="JavaScript" type="text/javascript">
<!--
var browser_type = navigator.appName
var mac = (navigator.userAgent.indexOf('Mac') != -1)
if ( browser_type == "Microsoft Internet Explorer" &amp;&amp; mac )
document.write('<LINK REL="StyleSheet" HREF="http://www.properties-in-europe.com/template/vertical-menu/ieMac_style.css" TYPE="text/css">');
else
document.write('<LINK REL="StyleSheet" HREF="http://www.properties-in-europe.com/template/vertical-menu/dft_style.css" TYPE="text/css">');
//-->
</script>
<SCRIPT language="JavaScript" type="text/javascript">
function confirmDelete()
{
var agree=confirm("Are you sure you want to delete?");
if (agree)
return true ;
else
return false ;
}
</script>

<script type="text/javascript" language="javascript" src="sniffer.js"></script>
<script type="text/javascript" language="javascript1.2" src="custom.js"></script>
<script type="text/javascript" language="javascript1.2" src="stylemenu.js"></script>
</head>

etc......



No GNU accreditation!!!!

Sorry boyo thats not good! Not good enough - It is not on any of the pages

and whats more you are English!


Don't say that it is not you - because it is your contact given as the owner of scitech and, it is on your site.


:evil:

iceman
04-06-2004, 04:20 AM
Really appreciate if anyone has the PDF MOD which can display "Home features" and "Community Features" to share their sample codes here or PM me.

Regards.

scd67
04-06-2004, 02:53 PM
I'd love to see the home features too, as that's exactly where I am in laying out the PDF printout.

nick_fla
04-08-2004, 02:15 PM
Firstly thanks to Open Realty and all forum users who have given their advice and time so freely, it had been a great source of information and education for me.

I would like to add the Listing Agent's details below the property details on the PDF file (including their thumbnail photo). Can anyone advise how to call theses details and add them at the foot of the PDF flyer/datasheet ?

An advice will be greatly appreciated.

Nick