You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have a code with which I add a png image to a pdf document. But if you upload a document larger than 1MB, an error occurs: Uninitialized string offset: 35. Here is my code:
` $pdf = new TCPDI(PDF_PAGE_ORIENTATION, 'px', PDF_PAGE_FORMAT, true, 'UTF-8', false);
$lists = $pdf->setSourceFile($file_dir);
$pdf->SetAutoPageBreak(false);
for($i=1; $i<=$lists; $i++) {
$import = $pdf->importPage($i);
$size = $pdf->getTemplatesize($import);
$pdf->AddPage($size['w'] > $size['h'] ? 'L' : 'P');
$pdf->useTemplate($import, 0, 0);
if($i==$lists){
$res = getimagesize(stream_get_meta_data($this->sign)['uri']);
$pdf->SetY(-$res[1] / 2 - 10);
$pdf->SetX(-$res[0] / 2 - 10);
$pdf->Image(stream_get_meta_data($this->sign)['uri'], $pdf->getX(), $pdf->getY(), $res[0] / 2, $res[1] / 2);
}
}
Hello! I have a code with which I add a png image to a pdf document. But if you upload a document larger than 1MB, an error occurs: Uninitialized string offset: 35. Here is my code:
` $pdf = new TCPDI(PDF_PAGE_ORIENTATION, 'px', PDF_PAGE_FORMAT, true, 'UTF-8', false);
$lists = $pdf->setSourceFile($file_dir);
$pdf->SetAutoPageBreak(false);
for($i=1; $i<=$lists; $i++) {
$import = $pdf->importPage($i);
$size = $pdf->getTemplatesize($import);
$pdf->AddPage($size['w'] > $size['h'] ? 'L' : 'P');
$pdf->useTemplate($import, 0, 0);
if($i==$lists){
$res = getimagesize(stream_get_meta_data($this->sign)['uri']);
$pdf->SetY(-$res[1] / 2 - 10);
$pdf->SetX(-$res[0] / 2 - 10);
$pdf->Image(stream_get_meta_data($this->sign)['uri'], $pdf->getX(), $pdf->getY(), $res[0] / 2, $res[1] / 2);
}
}
Php.ini config:
max_execution_time = 60max_input_vars = 5000
memory_limit = -1
post_max_size = 128M
upload_max_filesize = 50M
`
The text was updated successfully, but these errors were encountered: