views:

11

answers:

0

Every time I draw a cell, I get this weird padding between where the border ends and where the text begins. This happens for left and right aligned text.

It's much easier to show than describe, so here we go. My code sample:

class FPDI_Report extends FPDI {
    var $now = null;

    function __construct() {
        $args = func_get_args();
        call_user_func_array(array('parent', '__construct'), $args);

        $this->now = time();

        $this->setPageUnit('in');
        $this->setPageFormat('LETTER', 'P');
        $this->SetMargins(0.5, 0.5);
        $this->SetAutoPageBreak(false);

        $this->SetAuthor('Author');
        $this->SetCreator('Creator');
        $this->SetTitle('Title');
    }

    function addTest() {
        $this->addPage();

        $this->SetFont('helvetica', '', 18);
        $this->SetY(2);
        $this->Cell(0, 0, 'Left Aligned Text', 1, 0, 'L');
        $this->SetXY(2, 3);
        $this->Cell(0, 0, 'More Left Aligned Text', 1, 0, 'L');
        $this->SetY(4);
        $this->Cell(0, 0, 'Right Aligned Text', 1, 0, 'R');
    }
}

$pdf =& new FPDI_Report();
$pdf->addTest();
$pdf->Output('newpdf.pdf', 'D');

This gives me the following output:

http://i.imgur.com/ZlB5k.png

Why in the heck is it doing this, and how do I get it to stop?