Reputation: 346
I want to add a cell in a generated PDF with a copyright symbol .But adding the cell output shows some unwanted symbol at the beginning. Need a solution on this.
function Footer {
$this->SetTextColor(96,96,96);
$this->SetFont('Times','B',12);
$this->Cell(0,5,'abc Limited',0,2,'C',0);
$this->Cell(50,5,'',0,2,'C',0);
$this->Cell(0,5,'this is address',0,2,'C',0);
$this->Cell(188,5,'','B',1,'c',0);
$this->Cell(50,5,'',0,2,'C',0);
$this->Cell(0,5, '©All rights reserved abc Ltd',0,1,'C',0);
}
Upvotes: 4
Views: 5398
Reputation: 10
Use this simple, no need to add function footer:
<?php
//assume $MainPayment is a company
$MainPayment = 'Your Company';
// previous FPDF and linked library
//.. here...
$pdf->Cell(0, 8, "Copyright \xA9 $currentYear $MainPayment All rights reserved.", 0, 1, 'C');
?>
Upvotes: 0
Reputation: 5505
I tried the "©" suggestion and all it showed was literally "©", so I tried some other options. Just simple chr worked fine...
$this->Cell(0, 5, chr(169) . ' All rights reserved, etc', 0, 1, 'C', 0);
Upvotes: 7
Reputation: 346
function Footer {
$this->Cell(0,5,iconv("UTF-8", "ISO-8859-1", "©").'All rights reserved
Ltd.',0,1,'C',0);
}
Upvotes: 2
Reputation: 851
You have 2 choices:
Encode your document in utf-8 from your text Editor.
Use directly the Unicode Html entity ©.This would turn your code into:
<?php
$this->Cell (0'5, '© All rights reserved blahblah');?>
Upvotes: 1