2016-09-22 5 views
2

ここでは、いくつかのヘッダー、本文、フッターでpdfを生成するためにdompdfを使用しています。 しかし、私がフッタを追加しようとすると、それは付いていません。Dompdfフッターが設定されていません..?

いつもボディコードが付いています。 フッターを一番下に置きたいと思います。

誰でも以下のコードでどこが間違っているのか理解できますか?

コード:DOMPDFで

global $_dompdf_show_warnings; 
    global $_dompdf_debug; 
    global $_DOMPDF_DEBUG_TYPES; 
    global $_dompdf_warnings; 
    $_dompdf_show_warnings = FALSE; 

    require_once(realpath(APPPATH."third_party/dompdf")."/dompdf_config.inc.php"); 
    spl_autoload_register('DOMPDF_autoload'); 

    $dompdf = new DOMPDF(); 
    $dompdf->set_paper("letter", "portrait"); 

    $html = '<html> 
       <head> 
        <title> 
        </title> 
        </head> 

`enter code here`     <body style="margin:0; background-color:#ff9900; color:#ffffff;"> 
         <div> 
          <div style="margin:15px;"> 
           <div> 
            <span style="font-size:25px; font-weight:600;"> 
             Hi, John 
            </span> 
           </div> 
           <div> 
            <span> 
             Your account statement is here. 
            </span> 
           </div> 

           <div style="margin-top:15px; border: 2px solid;border-radius:5px; padding:10px; position:absolute; diplay:block;"> 
            <div style="float:left;">left</div> 
            <div style="float:right;">right</div> 
           </div> 
          </div> 
         </div> 
         <div style="background-color:#ffffff; color:#ff9900; position:fixed; bottom:0;width:100%;padding:10px;"> 
          <div> 
           <span> 
            <b><i>This is a system generated statement.</i></b> 
           </span> 
          </div> 
          <div> 
           <span> 
            <b><i> If you have any queries, email [email protected]</i></b> 
           </span> 
          </div> 
         </div> 
        </body> 
       </html>'; 


     $dompdf->load_html($html); 
     $dompdf->render(); 

     $dompdf->stream("dompdf_out.pdf", array("Attachment" => false)); 
+0

あなたのコードサンプルにランダムな "enter code here"というテキストがありますか? – BrianS

答えて

0

(最大バージョン0.7.0を含む)の要素は、(一般的に)され、それらが最初に表示されるページから始まるレンダリング。このため、ヘッダー/フッターのコンテンツをドキュメントの上部に配置する必要があります。

関連する問題