Thanks, but I notice you are still specifying the dimensions of the image. I want it to resize to fill the whole document, regardless of the document size.
Thanks again!!
-j
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What do you mean for document size? the size of a single page? or all pages?
TCPDF allows you to set a background image to fit one page at time.
You have just to set the image size equal to the page size.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Be sure that you are using the latest TCPDF version and check the default example n. 51.
You have just to disable the auto-page-break before inserting a full page background image.
Hi everyone,
Pretty simple question here:
I have a background image which needs to be the same size as the entire PDF page. (Just one page.)
How to do this?
Thanks in advance!!!! Best,
-joshua
Thanks, but I notice you are still specifying the dimensions of the image. I want it to resize to fill the whole document, regardless of the document size.
Thanks again!!
-j
What do you mean for document size? the size of a single page? or all pages?
TCPDF allows you to set a background image to fit one page at time.
You have just to set the image size equal to the page size.
Be sure that you are using the latest TCPDF version and check the default example n. 51.
You have just to disable the auto-page-break before inserting a full page background image.
For example:
$auto_page_break = $this->AutoPageBreak;
$this->SetAutoPageBreak(false, 0);
$img_file = K_PATH_IMAGES.'image_demo.jpg';
$this->Image($img_file, $x=0, $y=0, $w=210, $h=297, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0);
$this->SetAutoPageBreak($auto_page_break);
Thanks! It solved my problem too.