zend-pdf

Where to get and how to use zend_pdf standalone

三世轮回 提交于 2020-01-11 04:56:12
问题 I spent the last 2 days looking for answers on how to use zend_pdf as standalone. Everything I found on google refers to a pdf.php that I can't find anywhere. I have found zend_pdf here ( https://github.com/zendframework/ZendPdf ) I don't want to install the entire framework on the server and I don't want people to tell me to use fpdf or tcpdf or anything else. zend_pdf seems to be the perfect solution. I just want to know how to use it asstandalon. Any clear instructions? Thank you 回答1: To

How to rotate text while creating PDF in Zend Framework?

守給你的承諾、 提交于 2019-12-24 15:45:25
问题 I am placing text on pdf something like this using Zend_Pdf: $page1->drawText( 'Hello World!', 100, 100 ); But now I want to rotate text to 90 degree on pdf. How is it possible ?? Thanks 回答1: How about: $page->rotate(0, 0, M_PI/12); $page->drawText('Hello world!', 100, 100); See also: Zend PDF tutorial 回答2: You can use rotate() which uses Radians to determine the amount to rotate. For example: // Rotate at the X and Y coordinates // and 90 Degrees Counter-Clockwise (which is 1.5708 Radians)

Arabic in zend pdf

依然范特西╮ 提交于 2019-12-23 01:52:45
问题 I am new in Zend framework. Now I have a problem with Zend pdf. I am trying to make a pdf document which contains arabic as well as english. But I can't print arabic in zend. Please help me with any tutorials or sample code links. 回答1: This is still an issue in Zend_pdf I would recommend you to use TCPDF here is the link for that http://www.tcpdf.org/ Go through there examples http://www.tcpdf.org/examples.php If you still want to stick with zend pdf may this link be helpful. http://devzone

Zend_pdf, display a url (qrcode)

二次信任 提交于 2019-12-13 04:15:45
问题 I want want to display a qrcode from a url. I try this but that dind't work, I think my code doesn't save the url on my computer and he fail went he try to open the qrcode $imageUrl = 'https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=toto'; $imagePath = sys_get_temp_dir() . '\\' . basename($imageUrl); file_put_contents($imagePath, file_get_contents($imageUrl)); $image = Zend_Pdf_Image::imageWithPath($imagePath); unlink($imagePath); $page = $this->newPage($settings); $page->drawImage(

Zend_Pdf Add text link to pdf page

烂漫一生 提交于 2019-12-12 11:08:36
问题 Is it possible to add anchor text(link) in Zend_PDF page? I wasn't be able to find any information about this in Zend_Pdf online manual, or reading code, so I guess it is not possible. If there is way, please suggest! Thanks! 回答1: Disable border: ... $target = Zend_Pdf_Action_URI::create('http://example.com'); $annotation = Zend_Pdf_Annotation_Link::create(0,0,100,100,$target); $annotation->getResource()->Border = new Zend_Pdf_Element_Array(); $pdf->pages[0]->attachAnnotation($annotation); ..

zend_pdf document issue in windows 7

青春壹個敷衍的年華 提交于 2019-12-12 06:27:49
问题 I am using zend_pdf to generate pdf in magento 1.7 and I have tried something like public function getpdf() { $pdf = new Zend_Pdf(); $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); $page->setFont($font, 24) ->drawText('Hello World', 72, 720); $pdf->pages[] = $page; $pdfString = $pdf->render(); header("Content-Disposition: attachment; filename=helloworld.pdf"); header("Content-type: application/x-pdf"); echo $pdfString; }

Zend PDF trying to print Russian language

纵然是瞬间 提交于 2019-12-11 18:49:35
问题 I am using Zend PDF, trying to print Russian words. My code is $unicodeString = "это фигня"; $page->drawText($unicodeString, 72, 720, 'UTF-8'); but the result is ѕто фигнѕ So, it is printing something weird. I read that the issue might have to do with fonts and Unicode, so I am planning to fix it by doing this: $font = Zend_Pdf_Font::fontWithPath('/Library/Fonts/Times New Roman Bold.ttf'); How can i find the path to this font in on an IBM i / AS/400 machine? One more very basic

PHP pdf 2 text problem

痴心易碎 提交于 2019-12-11 07:04:10
问题 I'm using Zend_Pdf library for extract text from pdf and I have some problems... <?php set_include_path (__DIR__ . '\data'); require_once 'Zend/Pdf.php'; // Load PDF document from a file. $fileName = 'carbsarticle.pdf'; $pdf = new Zend_Pdf($fileName); $pdf = Zend_Pdf::parse($pdf); var_dump($pdf); Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message 'File is not a PDF.' I tried to download other pdf file, but the error is the same .. EDIT: try { $pdf2 = Zend_Pdf::load('test.pdf');

Arabic in zend pdf

家住魔仙堡 提交于 2019-12-08 04:07:25
I am new in Zend framework. Now I have a problem with Zend pdf. I am trying to make a pdf document which contains arabic as well as english. But I can't print arabic in zend. Please help me with any tutorials or sample code links. This is still an issue in Zend_pdf I would recommend you to use TCPDF here is the link for that http://www.tcpdf.org/ Go through there examples http://www.tcpdf.org/examples.php If you still want to stick with zend pdf may this link be helpful. http://devzone.zend.com/1064/zend_pdf-tutorial/ //Apply font file(.ttf) for zend pdf. for example below will allow arabic

Zend_pdf document throws error in magento due to presence of html contents

流过昼夜 提交于 2019-12-04 05:36:40
问题 In magento1.7, just write following lines in app\code\core\Mage\Wishlist\Helper\Data.php (Data.php) file public function getpdf() { $pdf = new Zend_Pdf(); $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); for($i=0; $i<5; $i++) { $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); $page->setFont($font, 24) ->drawText('Hello World page '.$i, 72, 720); $pdf->pages[] = $page; } $pdfString = $pdf->render(); header("Content-Disposition: attachment; filename=myfile.pdf"); header(