Closed jrocchia-wengel closed 1 year ago
Hi everyone,
i have a form with 2 input file. i work with laravel 10. I put in each a picture JPG and submit the form.
My coworker only want PDF at the end so i use TCPDF to create a PDF and put in it the image.
if(!empty($request->part_conv)){ // upload th JPG on the server $tmp_image = Storage::disk('public')->putFile('folder',$request->part_conv); $tmp_tcpdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $tmp_tcpdf::AddPage('P', 'A4'); $tmp_tcpdf::setJPEGQuality(75); $tmp_tcpdf::Image('storage/'.$tmp_image,0, 0, 297, 210, '', '', 'M', false, 300, 'C', false, false, 0, true, false, true, false, array()); $tmp_tcpdf::Output(public_path('storage/pdf1.pdf'), 'F'); } if(!empty($request->part_conv_bis)){ // upload th JPG on the server $tmp_image = Storage::disk('public')->putFile('folder',$request->part_conv_bis); $tmp_tcpdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $tmp_tcpdf::AddPage('P', 'A4'); $tmp_tcpdf::setJPEGQuality(75); $tmp_tcpdf::Image('storage/'.$tmp_image,0, 0, 297, 210, '', '', 'M', false, 300, 'C', false, false, 0, true, false, true, false, array()); $tmp_tcpdf::Output(public_path('storage/pdf2.pdf'), 'F'); }
if i put only one image and let the second input empty, i have no error.
if i put 2 images, I have Undefined property: Elibyy\TCPDF\TCPDFHelper::$inxobj
Undefined property: Elibyy\TCPDF\TCPDFHelper::$inxobj
but as i know, this is an error for template on TCPDF, and i have no template in my code.
Does anybody already have this error ?
Thanks
the error point on $tmp_tcpdf::AddPage('P', 'A4'); for the second input
$tmp_tcpdf::AddPage('P', 'A4');
You should probably close your issue here and open it there: https://github.com/elibyy/tcpdf-laravel
Hi everyone,
i have a form with 2 input file. i work with laravel 10. I put in each a picture JPG and submit the form.
My coworker only want PDF at the end so i use TCPDF to create a PDF and put in it the image.
if i put only one image and let the second input empty, i have no error.
if i put 2 images, I have
Undefined property: Elibyy\TCPDF\TCPDFHelper::$inxobj
but as i know, this is an error for template on TCPDF, and i have no template in my code.
Does anybody already have this error ?
Thanks