php-tcpdfHow do I set the page orientation when using PHP TCPDF?
To set the page orientation when using PHP TCPDF, use the setPageOrientation()
method. This method takes two parameters: the page orientation (P
for portrait or L
for landscape) and the page format (e.g. A4
).
For example:
$pdf->setPageOrientation('L', 'A4');
This will set the page orientation to landscape and the page format to A4.
The parts of this code are:
$pdf
: the TCPDF objectsetPageOrientation()
: the method used to set the page orientation'L'
: the page orientation (P
for portrait orL
for landscape)'A4'
: the page format
For more information, see the TCPDF documentation on setPageOrientation().
More of Php Tcpdf
- How do I install TCPDF using Yum on a PHP server?
- How do I use the PHP TCPDF WriteHTMLCell function?
- How do I add a watermark to PDFs using PHP and TCPDF?
- How do I use the setfont function in PHP TCPDF?
- How can I generate a QR code using PHP and TCPDF?
- How do I install TCPDF with Composer in a PHP project?
- How can I use TCPDF's writeHTML() function in PHP?
- How do I use the setxy function in PHP TCPDF?
- How do I set the margins using PHP TCPDF?
See more codes...