2012 年二月 一 二 三 四 五 六 日 « 一 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 近期评论
- wlx [微博 ] 发表在《google彻底被封?》
- snake 发表在《google彻底被封?》
- Andrew Pelt 发表在《debian testing上安装oracle 10g》
- tiplip 发表在《webmap.cn使用的WEBGIS技术》
- 求助Evolution问题!! 发表在《evolution crashed in gutsy alpha》
分类目录
标签
anjuta apache backup breezy c++ compile convert dapper debian dns edgy evolution feisty firefox flash gnome gobang GRASS gutsy humor intrepid Linux mailman MapServer mysql openoffice Oracle php phpbb postfix PostGIS postgresql qgis sarge scim skype subversion svn tomcat ubuntu utf8 westdc Windows wordpress 中文
Tag Archives: fpdi
用PHP处理中文PDF
因项目需要,现在想在服务器端动态生成PDF文件,已一个PDF为模板,然后把所需的数据动态填入。 本来在使用zend framework,因此很直接的就使用zend_pdf类来进行测试,代码实现如下: $pdf = Zend_Pdf::load($this->view->config->offline->template); $pdf->pages = array_reverse($pdf->pages); $style = new Zend_Pdf_Style(); $font = Zend_Pdf_Font::fontWithPath($this->view->config->offline->font, ( Zend_Pdf_Font::EMBED_DONT_SUBSET)); $pdf->pages[0]->setFont($font, 10); $pdf->pages[0]->saveGS(); //datalist $pdf->pages[0]->drawText(str_replace(“;”,”\n”,$datalist), 100, 570,”UTF-8″); //project $pdf->pages[0]->drawText($formData['project'], 100, 430,”UTF-8″); $pdf->pages[0]->drawText($formData['realname'], 100, 78,”UTF-8″); $pdf->pages[0]->drawText($formData['realname'], 130, 590,”UTF-8″); $pdf->pages[0]->drawText($formData['unit'], 95, 58,”UTF-8″); $pdf->pages[0]->drawText($formData['address'], 285, … Continue reading