Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[982]PHP網站開發 進階應用技巧」目錄
MarkDown
13. 製作PDF檔(下)
1. 簡易jquery應用
1-1 index.html
2. jquery六大工具(上)
2-1 tabs範例
2-2 tabs AJAX範例
2-3 垂直選單
2-4 水平選單
3. jquery六大工具(下)
4. 即時新增表單欄位
4-1 telbook.php
4-2 電話簿+垂直捲軸
5. 表單驗證
5-1 mem.php
5-2 mem_chk.php
5-3 jquery.validationEngine-tw.js
6. PHP圖表pChart
6-1 demo1.php
7. 月曆功能
7-1 get_event.php(正確完成版,可抓出該月事件)
8. CSV的匯出與匯入
9. 所見即所得編輯器
10. 多檔上傳
10-1 index.php
11. 縮圖及上傳物件
11-1 index.php
12. 製作PDF檔(上)
12-1 pdf.php
12-2 解決Linux下PDF無法秀出中文
13. 製作PDF檔(下)
13-1 pdf.php
14. 線上影像合成
14-1 index.php
14-2 pic.php
15. 圖形認證與計數器
15-1 index.php
15-2 pic.php
15-3 show.php
15-4 counter.php
16. Google Map初探
16-1 index.html
17. 搜尋存取GMap位置
17-1 index.php
18. 憑空生出Excel檔
18-1 12月份工作表
18-2 excel.php
14. 線上影像合成
\[982\]PHP網站開發 進階應用技巧 ===================== <?php require('fpdf/chinese-unicode.php'); include 'data.php'; // 產生一個 FPDF 物件 $pdf=new PDF\_Unicode(); //設定UTF8字型 $pdf->AddUniCNShwFont('Uni'); // 目前還沒有任何頁面,使用 AddPage() 產生一個頁面 $pdf->AddPage("P","A4"); //AddPage(\[string 方向 ,\[ mixed 格式\]\]) $pdf->SetAutoPageBreak(false); $pdf->SetDisplayMode("fullpage","single"); $pdf->SetSubject("收據", true); $pdf->SetCreator("ck2 system" , true); $pdf->SetAuthor("tad", true); $pdf->SetLeftMargin(20); content($user,$data); content($user,$data); content($user,$data); // 產 pdf 檔案應在瀏覽器上顯示出來 $pdf->Output(); //收據 function content($user="",$data=""){ global $pdf; $pdf->Image("ck2\_logo.png" , $pdf->GetX(),$pdf->GetY(),34, 10,"png"); // 設定字體格式 $pdf->SetFont('Uni','B',22); $pdf->Cell(170 , 9 , "點兩下電腦工作室", 0 , 1 , "C"); //第二行 $pdf->SetFont('Uni','',14); $pdf->Cell(65 , 8 , "單位名稱:{$user\['company'\]}", 0 , 0); $pdf->Cell(60 , 8 , "姓名:{$user\['name'\]}", 0 , 0 ); $pdf->Cell(15 , 8 , "編號:", 0 , 0); $pdf->SetTextColor(255,0,0); //前景色(紅) $pdf->Cell(30 , 8 , time(), 0 , 1); $pdf->SetTextColor(0,0,0); //前景色(黑) //第三行 $pdf->SetFont('Uni','',12); $pdf->Cell(75 , 8 , "項目", 1 , 0 ,"C"); $pdf->Cell(10 , 8 , "數量", 1 , 0 ,"C"); $pdf->Cell(25 , 8 , "單價", 1 , 0 ,"C"); $pdf->Cell(25 , 8 , "金額", 1 , 0 ,"C"); $pdf->SetFont('Uni','',9); $pdf->Cell(35 , 4 , "實收金額", 1 , 2 ,"C"); $pdf->Cell(5 , 4 , "百", 1 , 0 ,"C"); $pdf->Cell(5 , 4 , "十", 1 , 0 ,"C"); $pdf->Cell(5 , 4 , "萬", 1 , 0 ,"C"); $pdf->Cell(5 , 4 , "千", 1 , 0 ,"C"); $pdf->Cell(5 , 4 , "百", 1 , 0 ,"C"); $pdf->Cell(5 , 4 , "十", 1 , 0 ,"C"); $pdf->Cell(5 , 4 , "元", 1 , 1 ,"C"); //項目內容 items(5,6,$data); $pdf->SetY($pdf->GetY()+2); $pdf->Text(122,$pdf->GetY()+4,"經手人:吳弘凱"); $pdf->Text(122,$pdf->GetY()+10,"日 期:".date("Y年m月d日")); //注意事項 $text="一、本收據請妥為保管,以便日後查考。\\n二、如欲查詢存款入帳詳情時,請檢附本收據及已填妥之查詢函交原存款局辦理。"; $pdf->SetFont('Uni','',9); $pdf->MultiCell(100, 4, $text ,0); $pdf->SetFont('Uni','',12); $pdf->SetY($pdf->GetY()+10); $pdf->Line(20,$pdf->GetY(),190,$pdf->GetY()); $pdf->SetY($pdf->GetY()+10); } //第四行(行數,高度) function items($n=4,$h=7,$data=""){ global $pdf; for($i=0 ; $i<$n ; $i++){ $sum=$data\[$i\]\[1\] \* $data\[$i\]\[2\]; $pdf->Cell(75 , $h , $data\[$i\]\[0\], 1 , 0 ,"C"); $pdf->Cell(10 , $h , $data\[$i\]\[1\], 1 , 0 ,"C"); $pdf->Cell(25 , $h , $data\[$i\]\[2\], 1 , 0 ,"C"); $pdf->Cell(25 , $h , $sum, 1 , 0 ,"C"); $sum\_text=sprintf("%'-7s",$sum); for($j=0;$j<7;$j++){ $w=substr($sum\_text,$j,1); $end=($j==6)?"1":"0"; $pdf->Cell(5 , $h , $w, 1 , $end ,"C"); } } //合計 $pdf->SetFont('Uni','',12); $pdf->Cell(30 , $h , "合計", 1 , 0 ,"C"); $pdf->Cell(95 , $h , "元整", "B" , 0 ,"R"); $pdf->Cell(10 , $h , "", "B" , 0 ,"C"); $pdf->Cell(5 , $h , "", 1 , 0 ,"C"); $pdf->Cell(5 , $h , "", 1 , 0 ,"C"); $pdf->Cell(5 , $h , "", 1 , 0 ,"C"); $pdf->Cell(5 , $h , "", 1 , 0 ,"C"); $pdf->Cell(5 , $h , "", 1 , 0 ,"C"); $pdf->Cell(5 , $h , "", 1 , 0 ,"C"); $pdf->Cell(5 , $h , "", 1 , 1 ,"C"); } ?>
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
60
人線上 (
13
人在瀏覽
線上書籍
)
會員: 0
訪客: 60
更多…