Ben (http://html2fpdf.sourceforge.net/), bir sayfanın bir PDF oluşturmak için kullanıcı HTML2FPDF çalışıyorum, ama düzgün çalışması için almak gibi olamaz.
Benim sayfa bir grafiğini göstermek için jQuery oluşur. Ben PDF olarak ihraç edilecek sayfadaki grafiği ve diğer metin istiyorum.
http://portal.flyingstartlifestyle.360southclients.com/leanne/leanne.php <- sayfanın altındaki html2fpdf kodu ile grafik.
HTML2FPDF kodu:
function createPDF() {
define('ABSPATH', dirname(__FILE__).'/');
require(ABSPATH.'classes/pdf/html2fpdf.php');
$pdf = new HTML2FPDF();
$pdf->AddPage();
$html = ob_get_contents();
//$html = htmlspecialchars($html);
if ($html) {
$fileName = "testing.pdf";
$pdf->WriteHTML($html);
$pdf->Output("pdfs/".$fileName);
echo "<p>PDF file is generated successfully! <a href=\"pdfs/$fileName\" target=\"_blank\">Click here</a> to open it.</p>";
} else {
echo "<p>There has been an error in creating your PDF.</p>";
};
};
Ben çizgiyi göstermek "Eğer $ html = htmlspecialchars ($ html);" aksi takdirde boş bir PDF oluşturur pdf sayfanın metin yazdırır. Herhangi bir PDF benim grafiği aktarabilirsiniz nasıl fikir?
Şerefe