2016-06-21 13 views
-2

Ich erzeuge PDF aus HTML. Problem ist, wenn es große Inhalte gibt, dann wird es nicht richtig angezeigt. Zuerst erscheint eine leere Seite, dann inhaltlich überlappende Fußzeile, aber Volltext wird nicht angezeigt. Der Restinhalt wird ausgeblendet und nicht auf die nächste Seite verschoben. Ich habe versucht page-break-after:always; page-break-inside:avoid;großen Inhalt nicht auf die nächste Seite in Dompdf

eine Idee zu diesem Thema?

Check Code unten: -

$html = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ 

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry 

ÆØÅ ÆØÅ ÆØÅ ÆØÅ "; 

pdfGenerate($html); 

function pdfGenerate($html="") 
{ 
    require_once("dompdf/dompdf_config.inc.php"); 
    $dompdf = new DOMPDF(); 


    $dompdf->load_html($html); 
    $dompdf->render(); 
    $canvas = $dompdf->get_canvas(); 
    $font = Font_Metrics::get_font("Arial"); 
    $canvas->page_text(510, 775, "{PAGE_NUM} av {PAGE_COUNT}", 
        $font, 10, array(0,0,0)); 
    $dompdf->stream("sample.pdf"); 
} 
+0

Ohne näher es unwahrscheinlich ist, zu wissen, Was ist das Problem? Irgendein Beispiel HTML? – apokryfos

+0

@apokryfos überprüfen Sie meine Bearbeitung – ripa

+0

schließen und negative Abstimmung geschätzt. Aber haben Sie eine Antwort auf diese Frage? – ripa

Antwort

0

Für mich geändert ich einen Wurf der Code aber im Grunde gut funktionieren. dompdf ein pdf mit 2 Seiten erzeugen

$dompdf = new \Dompdf\Dompdf(); 
$dompdf->load_html($html); 
$dompdf->render(); 
$canvas = $dompdf->get_canvas(); 
$options = new \Dompdf\Options(); 
$fontMetrics = new Dompdf\FontMetrics($canvas,$options); 
$font = $fontMetrics->getFont('Arial'); 
$canvas->page_text(510, 775, "{PAGE_NUM} av {PAGE_COUNT}", 
       $font, 10, array(0,0,0)); 
$dompdf->stream("sample.pdf"); 

Eine wichtige Sache ist, dass Ihr Beispiel Klartext ist und ich denke, ist genauer mit Hilfe von HTML (eine vollständige HTML-Seite)

Verwandte Themen