Mark Steudel
Mark Steudel

Reputation: 1682

TCPDF: Mixed orientation in one pdf

Is it possible to have mixed orientation in one PDF. E.g. some pages portrait and some landscape? Or is it possible to rotate content? I can see that you can set the overall orientation can be set in the constructor, but didn't see anything.

MS

Upvotes: 4

Views: 5093

Answers (2)

Sumod Nair
Sumod Nair

Reputation: 439

For rotating the content you can use the following code.

$pdf->StartTransform();
$pdf->Rotate(-90);
$pdf->Cell(0,0,'This is a sample data',1,1,'L',0,'');
$pdf->StopTransform();

Upvotes: 0

Mark Steudel
Mark Steudel

Reputation: 1682

It's actually pretty easy all yo have to do is when you add a page:

// protrait
$tcpdf->addPage( 'P', 'LETTER' );

// landscape
$tcpdf->addPage( 'L', 'LETTER' );

Upvotes: 7

Related Questions