php-tcpdfHow do I set an image using PHP TCPDF?
Using the PHP library TCPDF, you can set an image using the Image()
method. This method requires the following parameters:
$file
: Path to the image file.$x
: Abscissa of the upper-left corner.$y
: Ordinate of the upper-left corner.$w
: Width of the image in the page.$h
: Height of the image in the page.$type
: Image format.$link
: URL or identifier returned byAddLink()
.$align
: Indicates the alignment of the pointer next to image insertion relative to image height.
Example code
$pdf->Image('example.jpg', 10, 10, 30, 40, 'JPG', '', 'T', false, 300, '', false, false, 1, false, false, false);
The output of the above code is a JPG image with a width of 30 and a height of 40, located at the coordinates (10, 10), with the text pointer aligned to the bottom of the image.
Helpful links
More of Php Tcpdf
- How do I install TCPDF using Yum on a PHP server?
- How do I add a watermark to PDFs using PHP and TCPDF?
- How can I generate a PDF from XML data using PHP and TCPDF?
- How do I use the setfont function in PHP TCPDF?
- How can I use PHP and TCPDF to read a PDF?
- 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 can I generate a PDF from data stored in a MySQL database using TCPDF and PHP?
- How can I generate a QR code using PHP and TCPDF?
See more codes...