0

When I try to generate a landscape page with a custom size with TCPDF, the page does not fit to what I asked at all.

Try this :

require('tcpdf.php');
$pdf = new TCPDF('L', 'mm', array(210,97), true, 'UTF-8', false);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetFont('helvetica', '', 10);
$pdf->AddPage('L', array(210,97));
$pdf->Text(0, 72, 'Test');
$pdf->Text(0, 73, 'Test');
$pdf->Output('test.pdf', 'I');

TCPDF add a new page, but it shouldn't. It's the same with images. The page doesn't seem to be 210mm large.

Is it me or a TCPDF bug ? How to solve that ?

Thank you ! Nils

user1527491
  • 895
  • 10
  • 22
  • `TCPDF add a new page, but it shouldn't`. Remove the `$pdf->addPage()` line. Also, when not changing dimensions, there is no need to include these in the `addPage()` call. – Dirk McQuickly May 02 '13 at 16:21
  • Thanks for answer. But distances are still wrong :( . – user1527491 May 02 '13 at 17:18
  • Okay. It was my image that didn't resized correctly. This solved the issue : http://stackoverflow.com/questions/8135975/why-is-tcpdf-image-smaller-than-it-should-be . Thank you :) . – user1527491 May 02 '13 at 17:31

0 Answers0