DomPDF and image

942 Views Asked by At

I converted HTML into PDF by means of DomPDF 0.7. On the first page everything is well displayed, and on the second page the same images aren't shown. Help to solve this problem please. Used $dompdf = new Dompdf(array('enable_remote' => true));, but hasn't helped. Prescribed a way both absolute and relative, but they aren't as though on the page at all. Php code:

set_include_path( get_include_path() . PATH_SEPARATOR .   $_SERVER["DOCUMENT_ROOT"]."/_system/dompdf");

    require_once "autoload.inc.php";
    use Dompdf\Dompdf;
    $dompdf = new Dompdf();
    $dompdf = new Dompdf(array('enable_remote' => true));
    $dompdf = new Dompdf(array('ENABLE_AUTOLOAD' => true));
    $dompdf->set_paper("a4");
    $dompdf->load_html( $html);
    $dompdf->render();
    $canvas = $dompdf->get_canvas();
    $canvas->page_text(287, 815, "- {PAGE_NUM} -", 'times', 10, array(0,0,0,0.5));
    $dompdf->stream("Коммерческое предложение.pdf",array("Attachment"=>0));

Html code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <link rel="stylesheet" type="text/css" href="{$smarty.server.DOCUMENT_ROOT}/css/invoice.css" />
        </head>
        <body>
            <div class="layout">
                <div class="header">
        <img class="logo" src="{$smarty.server.DOCUMENT_ROOT}/images/pdf_logo.png">
         <img src="{$smarty.server.DOCUMENT_ROOT}/images/lines_pdf.png">
        {if $com_list.contacts}
        <div class="contacts_block">
            <ul>
                <li><b>{$com_list.contacts.index} Республика Казахстан</b></li>
                <li>{$com_list.contacts.adr}</li>
                <li>Тел: {$com_list.contacts.tel}</li>
                <li>Моб.: {$com_list.contacts.mobile}</li>
                <li>Skype: {$com_list.contacts.skype}</li>
                <li>E-mail: <a href="mailto:{$com_list.contacts.email}" target="_blank">{$com_list.contacts.email}</a></li>
                <li><a href="http://k.moremota.com.kz/" target="_blank">k.moremota.com.kz</a></li>
            </ul>
        </div> 
        {/if}
        <div class="gost">
            <span>
                Система менеджмента качества соответствует требованиям СТ РК ИСО 9001-2009<br/>
                ISO 9001: 2008 № KZ.7100967.07.03.00022 от 19.01.2016 г
            </span>
        </div>
    </div>
                <div class="content">

                </div>  
            </div>
            <div style="page-break-before: always;"></div>

        </body>
    </html> 
0

There are 0 best solutions below