FPDF 中文 参考手册 1.52

PDF 1.52 參考手冊

1. AcceptPageBreak - 接受或不接受自動分頁
        boolean AcceptPageBreak()
        版本1.4
        內容:        每逢有分頁的情況出現,就代表這個功能已經被執行了,而且,分頁會自動顯示出來,也不需要依靠在其他數值資料。預設履行反回數值,取決於 SetAutoPageBreak() 的模式選擇。這個功能是會自動處理的,也不需要其他程式操控。
        例子
        這個功能,對於有三個欄位編排的頁面是無有作用的:
        [php]         class PDF extends  FPDF       {
                var $col=0;
               
                function SetCol($col)
                {
                    //Move position to a column
                    $this->col=$col;
                    $x=10+$col*65;
                    $this->SetLeftMargin($x);
                    $this->SetX($x);
                }
               
                function AcceptPageBreak()
                {
                    if($this->col<2)
                    {
                        //Go to next column
                        $this->SetCol($this->col+1);
                        $this->SetY(10);
                        return false;
                    }
                    else
                    {
                        //Go back to first column and issue page break
                        $this->SetCol(0);
                        return true;
                    }
                }
        }
       
        $pdf=new PDF();
        $pdf->Open();
        $pdf->AddPage();
        $pdf->SetFont('Arial','',12);
        for($i=1;$i<=300;$i++)
        {
                $pdf->Cell(0,5,"Line $i",0,1);
        }
        $pdf->Output();  
        ?>[/php]        參見SetAutoPageBreak().
       
2. AddFont - 加入一個新的字型
        AddFont(string family [, string style [, string file]])
        版本        1.5
        內容:        匯入一個 TrueType 或 Type1 字型,並且另到這個字型可以運作。必需要先行利用 makefont.php 這個程式來產生一個字型定義檔案。
        這個定義檔案 (and the font file itself when embedding) 一定要放在目前使用中的目錄或利用一些指令FPDF_FONTPATH來提供路徑。如果找不這個定義檔,就會出現錯誤訊息 "Could not include font definition file"。
        參數
        family         字型家族(family): 你可以任意選擇字型名稱。 如果這個字型是一個標準字型家族名稱,將會不理符合的字型。
        style         字型風格(style):

阅读全文>>

转载于:https://my.oschina.net/lgc/blog/5336

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值