pixelsToMM($scale * $width)), round($this->pixelsToMM($scale * $height)) ); } function centreImage($img) { list($width, $height) = $this->resizeToFit($img); // you will probably want to swap the width/height // around depending on the page's orientation $this->Image( $img, (self::A4_HEIGHT - $width) / 2, (self::A4_WIDTH - $height) / 2, $width, $height ); } } // usage: $pdf = new PDF(); $pdf->AddPage("L"); $pdf->centreImage("path/to/my/image.jpg"); $pdf->Output(); ?>