8
A
回答
9
使用FPDF你可以下載它導出從鏈接和更多信息,這裏的後,你可以整合如下http://fpdf.org
..
<?php
require_once('fpdf.php');
class PDF extends FPDF
{
function Header()
{
$query='your query';
$row=mysql_fetch_assoc($query); // data from database
$this->SetXY(50,60);
$this->Cell(45,6,'Name :',1,1,'R');
$this->SetXY(95,60);
$this->Cell(80,6,$row['pdf_name'],1,1);
$this->SetXY(50,66);
$this->Cell(45,6,'Email Address :',1,1,'R');
$this->SetXY(95,66);
$this->Cell(80,6,$row['pdf_email'],1,1);
$this->SetXY(50,72);
$this->Cell(45,6,'Question Paper Selected :',1,1,'R');
$this->SetXY(95,72);
$this->Cell(80,6,$row['subject_sel'],1,1);
$this->SetXY(50,78);
$this->Cell(45,6,'Total Correct Answers :',1,1,'R');
$this->SetXY(95,78);
$this->Cell(80,6,$row['right_answered'],1,1);
$this->SetXY(50,84);
$this->Cell(45,6,'Percentage :',1,1,'R');
$this->SetXY(95,84);
$this->Cell(80,6,$row['percentage']."%",1,1);
$this->Ln(20);
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(0,10,'abc according to you',0,0,'C');
}
}
$pdf=new PDF('P','mm',array(297,210));
$pdf->Output($name.'.pdf','D');
?>
您可以根據自己的需要進行編輯,它會以表格的形式顯示記錄並將其生成爲pdf。希望它對你有幫助。
更新:
圖像0
$this->Image('image path',80,30,50);
相關問題
- 1. PHP重定向到pdf然後導航到另一個頁面?
- 2. 將PDF頁面內容導出到單個頁面
- 3. ASP.Net頁面導出爲pdf
- 4. ASP.Net頁面導出爲pdf
- 5. 導出多個頁面html到單個pdf
- 6. 將網頁導出到pdf
- 7. 導出多個Highcharts到多頁PDF
- 8. PHP輸出結果到一個頁面
- 9. jQuery的導航到另一個頁面,PHP頁面加載到一個div
- 10. 導出爲PDF以外的頁面時出現更多頁面?
- 11. 將PHP頁面導出到.doc
- 12. primefaces pdf導出 - 頁面大小
- 13. 將多個PDF A4頁面擬合到一個A1頁面
- 14. PDF頁面溢出
- 15. 從一個彈出菜單導航到一個頁面?
- 16. 將整個php頁面複製到另一個_blank php頁面
- 17. 在xcode中從一個頁面導航到另一個頁面
- 18. 如何導航一個xaml頁面到另一個頁面?
- 19. 從一個頁面導航到另一個頁面的選項
- 20. 將一個php變量從一個頁面傳遞到另一個php頁面
- 21. 導出DataGridView到HTML頁面
- 22. PDF頁面導航問題
- 23. 將頁面添加到pdf在php
- 24. 如何從jsp頁面導出表格到pdf
- 25. 加載一個HTML頁面到/從一個PHP頁面
- 26. 按特定順序將多個頁面導出爲PDF
- 27. 使用iTextSharp將整個頁面導出爲pdf
- 28. ActiveAdmin導出爲每個頁面的{PDF,XML}自定義鏈接
- 29. 使用PHP獲取單個PDF頁面
- 30. 如何將頁面X或頁面Y導入合流pdf導出?
嘗試'mPdf'或'fPdf' PHP庫... – Red
當你正在使用PHP生成的頁面,我認爲最好的辦法是使用TCPDF包。它有如此強大的功能可以完成很多定製,而且更容易配置。 –
你可以使用[DOMPDF](http://www.tcpdf.org/)或[TCPDF](https://github.com/dompdf/dompdf)進行pdf導出。 –