DomPdf不显示仅显示单个图像的动态图像

时间:2016-01-12 08:00:35

标签: php joomla dompdf

我正在创建基于Joomla用户的打印会员卡,在生成会员卡后需要打印为pdf,问题是在domp pdf中正确显示单张图像,但多张图片不显示只显示单张图像,< / p>

如default.php

<form method='POST' action='index.php?option=com_mycomponentbs&view=MembershipCard&task=cardpdf'>
<?php foreach($orderitems as $re) { ?>
  <tr>
    <td>
      <input type='checkbox' class="checkbox1" name='id[]' id="id" value="<?php echo $re->id?>">
    </td>
    <td>
      <?php echo $re->id?></td> <td><?php echo $re->name?>
    </td>
  </tr>
<?php } ?>
<input type='submit' name='submit'>

cardpdf.php

foreach ($orderitems as $re):
  $user = JFactory::getUser();
  $path = JURI::Root().'back.jpeg';
  $font_path="Lin.ttf";
  $card = imagecreatefromjpeg($path);
  $white = imagecolorallocate($card, 255, 255, 255);
  imagettftext($card, 22, 0, 40, 515, $white, $font_path, $re->id);
  $file= $_SERVER['DOCUMENT_ROOT'].'tmpl/back1.jpeg';

  ImageGIF($card, $filenametemp);
  $ImageData = file_get_contents($filenametemp);
  $ImageDataEnc = base64_encode($ImageData);
  unlink($filenametemp); // delete the file
  ?>

  <img src="data:image/gif;base64,<?=$ImageDataEnc1?>>
  </td>
  </tr>
<?php endforeach; } ?>

```

0 个答案:

没有答案