dompdf图像不起作用

The images do not appear loop. Only the first image appears the rest does not.

$namePic = "";
    foreach($_POST['ck'] as $ck){
        $namePic.= $ck.", ";
        $namesPic = explode(",", $namePic);
    }

$dompdf = new DOMPDF();
$html = "";

    for($i = 0; $i < $count; $i ++){
       $html.= "<html><head><style type='text/css'> </style></head><body><div style=\"page-break-after: always;\"><p align=\"center\"><img src=\"../folder/images/$namePic[$i]\" ></p></div>";
    }

$html.= "</body></html>";

$dompdf->load_html($html);
$dompdf->set_paper("a4", "portrail");
$dompdf->render();
$pdf = $dompdf->output();
$folder = "../sample.pdf";
file_put_contents($folder,$pdf);

With this I can generate the pdf, but it does not show all the images of the loop shows only the first image. How can I do to show all the images in my loop?

查看全部
doupian9798
doupian9798
2017/06/05 03:26
  • dompdf
  • php
  • 点赞
  • 收藏
  • 回答
    私信

1个回复