首页
开发手册
应用中心
工具
用户中心
FoundPHP Use html Code to Output PDF
English
中文简体
English
上一篇
下一篇
FoundPHP PDF allows developers to generate PDF using html they are good at. #### Generate Single Page PDF We use html code to generate a complete single page pdf ```php //Generate single page PDF head(array( 'logo'=>'logo.png', //logo 'size'=>25, //size 'text'=>'FoundPHP Framework', //word description 'intro'=>'FoundPHP It is the simplest MVC framework in the world', //Text description 'color'=> '#666666' //text color )); //add new page to use html content $pdf->html_page(array('html'=>'
FoundPHP
Framework PDF Class!')); //footer shows page number $pdf->foot(); //browser printing $filename = 'FoundPHP'; //file name $pdf->p($filename); //save $dir = './'; //save directory $pdf->s($filename,$dir); ?> ``` display effect: ![](data/files/edit/20/03/19/200319_16507020.jpg)
#### Generate multi-page PDF ```php head(array( 'logo'=>'logo.png', //logo 'size'=>25, //size 'text'=>'FoundPHP Framework', //word description 'intro'=>'FoundPHP is the simplest MVC framework in the world', //word description 'color'=> '#666666' //text color )); //add first page $pdf->html_page(array('html'=>'
FoundPHP
Framework PDF Class!
the first page')); //add second page $pdf->html_page(array('html'=>'
FoundPHP
Framework PDF Class!
the second page')); //footer shows page number $pdf->foot(); //browser printing $pdf->p('FoundPHP'); ?> ``` display effect: Can display the content of the header, footer and customized content。 ![](data/files/edit/20/03/19/200319_17006557.jpg)