There are pictures in HTML
The converted PDF has no
And I used the regular to replace the picture inside and then insert the picture.
$pattern = "//i";
Preg_match_all ($pattern, $file, $match);
Var_dump ($match);
for ($i =0; $i
$img _url=preg_match ("/^http:\/\//", $match [1][$i])? $ $match [1][$i]: "http://file.aconf.org". $match [1][$i];
Preg_replace ($match [0][$i], $pdf->image ($img _url, 5, 5, Max, max, $type = ", $link =" ", $paint =true), $file);
}
$pdf->image ($img _url, 5, 5, $, =true, $type = ", $link =" "," $paint ");
Error occurred
Ask the great God for guidance.
Reply to discussion (solution)
Confirm that your image format can be accepted (JPEG, PNG)
Confirm that the remote picture can be read by the file function (if the other party has a chain of anti-theft, not enrolled)
The picture is JPG can be read to be sure
Vendor (' html2fpdf.html2fpdf ');
$pdf = new FPDF ();
$pdf->addpage ();
$pdf->setfont (' Arial ', ' B ', 16);
$pdf->cell (40,10, ' Hello world! ');
$pdf->image (' http://file.aconf.org/public/images/logo.png ', 60,30,90,0, ' png ');
$pdf->output ();
I directly use the Insert Image function Error alpha channel not supported:http://file.aconf.org/public/images/logo.png
The following modes are not supported for PNG
interlacing (Interleaved type)
Alpha Channel
Thank you so much for the fact that I changed a picture.