임은 mpdf 라이브러리를 사용하여 PDF 파일을 구축하려는 이미지를 사용하여 ... mpdf 부문
include('convert-to-pdf/mpdf.php');
// build the content for the preview...
ob_start();
include (DIR_BOOKS.'/'.$book_path.'/preview-male.php');
$html = ob_get_contents();
ob_end_clean();
// build the overlay on the child image
$mpdf=new mPDF('utf-8', array(221,221));
$stylesheet = file_get_contents(DIR_BOOKS.$book_path.'/stylesheet.css');
$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML($html,2);
$mpdf->Output(DIR_TEMPORARY_IMAGES.$this->session->data['pdf_id'].'.pdf','F');
그리고 임 오류를 받고 mpdf의 코드 ...
$this->WriteHTML($html , 4); // parameter 4 saves output to $this->headerbuffer
$actual_h = $this->y - $y;
$use_w = $w;
$use_h = $h;
//Line 13865
$ratio = $actual_h/$use_w;
if ($overflow!='hidden' && $overflow!='visible') {
//Line 13868
$target = $h/$w;
if (($ratio/$target) > 1) {
$nl = CEIL($actual_h/$this->lineheight);
$l = $use_w * $nl;
$est_w = sqrt(($l * $this->lineheight)/$target) * 0.8;
$use_w += ($est_w - $use_w) - ($w/100);
}
//Line 13875
$bpcstart = ($ratio/$target);
$bpcctr = 1;
while(($ratio/$target) > 1) {
if ($this->progressBar) { $this->UpdateProgressBar(4,intval(100/($ratio/$target)),('Auto-sizing fixed-position block: '.$bpcctr++)); } // *PROGRESS-BAR*
$this->x = $x;
$this->y = $y;
if (($ratio/$target) > 1.5 || ($ratio/$target) < 0.6) {
$use_w += ($w/$this->incrementFPR1);
}
else if (($ratio/$target) > 1.2 || ($ratio/$target) < 0.85) {
$use_w += ($w/$this->incrementFPR2);
}
//Line 13890
else if (($ratio/$target) > 1.1 || ($ratio/$target) < 0.91) {
$use_w += ($w/$this->incrementFPR3);
}
else {
$use_w += ($w/$this->incrementFPR4);
}
$use_h = $use_w * $target ;
$this->rMargin=$this->w - $use_w - $x;
$this->pgwidth = $this->w - $this->lMargin - $this->rMargin;
$this->HTMLheaderPageLinks = array();
$this->HTMLheaderPageAnnots = array();
$this->HTMLheaderPageForms = array();
$this->pageBackgrounds = array();
$this->WriteHTML($html , 4); // parameter 4 saves output to $this->headerbuffer
$actual_h = $this->y - $y;
$ratio = $actual_h/$use_w;
}
if ($this->progressBar) { $this->UpdateProgressBar(4,'100',' '); } // *PROGRESS-BAR*
}
$shrink_f = $w/$use_w;
그리고 에서 HTML을 가져 오는 메신저 내 PHP 파일 ...
<div class="page-1-image-1"><img src="https://www.example.com/working-image.jpg" /> </div>
임 내 mpdf의 HTML 코드에 이미지를 포함 할 때 다음과 같은 오류가 점점 ...
<b>Warning</b>: Division by zero in <b>/var/www/html/example/mpdf.php</b> on line <b>13865</b>
<b>Warning</b>: Division by zero in <b>/var/www/html/example/mpdf.php</b> on line <b>13868</b>
<b>Warning</b>: Division by zero in <b>/var/www/html/example/mpdf.php</b> on line <b>13869</b>
<b>Warning</b>: Division by zero in <b>/var/www/html/example/mpdf.php</b> on line <b>13875</b>
<b>Warning</b>: Division by zero in <b>/var/www/html/example/stuff.php</b> on line <b>13877</b>
<b>Warning</b>: Division by zero in <b>/var/www/html/example/mpdf.php</b> on line <b>13910</b>
<B>mPDF error: </B>Please do not use values equal to zero for scaling
갓 생성 된 내 자신의 이미지를 모두 시도했지만 온라인에서도 완벽하게 좋은 이미지 URL을 시도했지만 기쁨이 없었습니다. 나는 pngs와 jpgs를 시도했다.
Im 이러한 오류는 단순히 이미지를로드하지 않는 문제에서 비롯된 것으로 의심됩니다. 미리 감사드립니다.
이 우리에게 보여주십시오'stuff.php' 라인 :'13860' - 당신 말이 있지만 위해서는 아마있어'13915' – Rizier123
을 사람들이 당신을 도울 수 있다면, 어떻게 오류가 발생했는지 보여줄 필요가 있습니다. 쇼 코드! – BigScar
사과, mpdf.php에 stuff.php를 변경하여 더 명확하게하고 일부 코드를 게시 할 예정입니다. – Adrian