Html 如何在mpdf中获得完整的图像宽度

Html 如何在mpdf中获得完整的图像宽度,html,codeigniter,mpdf,Html,Codeigniter,Mpdf,我正在使用mpdf转换html页面。我添加了如下代码 $html=$this->load->view('client_admin/test_poepdf',$data, true); $pdfFilePath ="Test_".$task_id.'_'.$startdate.'.pdf'; $pdf = $this->m_pdf->load(); $stylesheet =''; $styl

我正在使用mpdf转换html页面。我添加了如下代码

         $html=$this->load->view('client_admin/test_poepdf',$data, true);

        $pdfFilePath ="Test_".$task_id.'_'.$startdate.'.pdf';

      $pdf = $this->m_pdf->load();
        $stylesheet ='';
        $stylesheet .= file_get_contents(base_url().'assets/css/bootstrap.min.css'); // external css
        $stylesheet .= file_get_contents(base_url().'assets/css/icons.css'); // external css
        $pdf->WriteHTML($stylesheet,1);
        $pdf->WriteHTML($html,2);
        $pdf->Output($pdfFilePath, "D");
        $pdf->Output($destination2, "F");
我在mpdf页面中添加了一个图像,并添加了宽度,如下所示:

assets/poemages/“class=”side\u logos“id=”poeid“style=”width:1300px;高度:自动;">

但如果我在正在应用的浏览器中打开,则图像宽度不适用。请帮助我。

当mPDF生成您的PDF时,它会将您的几乎所有内容放在“打印区域”内。打印区域的计算方式为:页面框减去页边距

______________________________
|                         |   |<- sheet
|                         |<--+-- crop marks
|   ______________________|___|
|  |    A                 |   |
|  |    ______________    |<--+-- page box
|  |   |   HEADER     |   |   |
|  | D |              | B |   |
|  |   |              |   |   |
|  |   |              |<--+---+-- page box minus margins = printed area
|  |   |              |   |   |
|  |   |              |   |   |
|  |   |              |   |   |
|  |   |___FOOTER_____|   |   |   A: margin-top
|  |    C                 |   |   B: margin-right
|  |______________________|   |   C: margin-bottom
|                             |   D: margin-left
|_____________________________|
______________________________

|| |当mPDF生成PDF时,它会将几乎所有内容放在“打印区域”内。打印区域的计算方式为:页面框减去页边距

______________________________
|                         |   |<- sheet
|                         |<--+-- crop marks
|   ______________________|___|
|  |    A                 |   |
|  |    ______________    |<--+-- page box
|  |   |   HEADER     |   |   |
|  | D |              | B |   |
|  |   |              |   |   |
|  |   |              |<--+---+-- page box minus margins = printed area
|  |   |              |   |   |
|  |   |              |   |   |
|  |   |              |   |   |
|  |   |___FOOTER_____|   |   |   A: margin-top
|  |    C                 |   |   B: margin-right
|  |______________________|   |   C: margin-bottom
|                             |   D: margin-left
|_____________________________|
______________________________
|                         |   |
<style>
    @page {
        margin: 0;
    }

    table {
        width: 100%;
    }
</style>
<div style="position: absolute; left: 0; width: 100%; >
   <img src="" />
</div>