1
這是我的代碼HTML圖像在PDF不打印
<?php
class Diagram
{
function outLet()
{
$boothsizer = 3;
if($boothsizer == 3){
$cellWidth = '112px';
$cellHeight = '52px';
$innerDivElectricTop = '41px';
$innerDivElectricLeft = '110px';
$backgroundImage = 'url(booth_top_images/5X20TOP.jpg)';
$width = '900px';
$height = '225px';
$sidewalls = 2;
$backwalls = 6;
}
else
if($boothsizer == 19)
{
$cellWidth = '144px';
$cellHeight = '145px';
$innerDivElectricTop = '105px';
$innerDivElectricLeft = '73px';
$backgroundImage = 'url(booth_top_images/10X10TOP.jpg)';
$width = '599px';
$height = '605px';
$sidewalls = 3;
$backwalls = 3;
}
$innerDivElectricWidth = $backwalls * $cellWidth;
$innerDivElectricHeight = $sidewalls * $cellHeight;
$output = '<div style="width:'.$width.'; height:'.$height.'; background-image:'.$backgroundImage.'">';
$output .= '<div id="inner_div_electric" style="position: relative; top: '.$innerDivElectricTop.'; left: '.$innerDivElectricLeft.';width:'.$innerDivElectricWidth.';height:'.$innerDivElectricHeight.'">';
for($i=1; $i<=$sidewalls; $i++)
{
for($j=1; $j<=$backwalls; $j++)
{
$output .= '<span class="droppable_class" style="width:'.($cellWidth-2).'; height:'.($cellHeight-2).'; border:1px solid red; float:left;display:inline-block;margin:0px;padding:0px;"></span>';
}
}
$output .= '</div></div>';
echo $output;
include("test/mpdf/mpdf.php");
$mpdf=new mPDF();
$mpdf->ignore_invalid_utf8 = true;
$stylesheet = file_get_contents('appstyle_pdf.css');
$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML($output);
$comname = "vam";
$name = "test/generated_pdfs/".str_replace(" ","-",$comname).".pdf";
$mpdf->Output($name,"F");
}
}
$diag = new Diagram;
print $diag->outLet();
?>
在我的代碼,我試圖生成在圖像的一些廣場,並試圖生成PDF,當我呼應$輸出,我可以看到廣場在圖像上,但在我生成的pdf只有圖像正在打印,正方形不是?
有人有什麼想法?
請問您可以添加調試功能來查看錯誤並進行編輯嗎? '$ mpdf-> debug = true;' – soumer 2013-04-05 11:30:45