Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Generating Invoices with Zend_Pdf
Oct 10, 2011 @ 14:07:15

On PHPMaster.com today there's a new tutorial about using the Zend_Pdf component of the Zend Framework to generate invoices from the billing data in your application.

The PDF format is currently the most used format to exchange documents. If you provide your website users with printable versions of invoices, event tickets and other similar documents, you’ll most likely want to generate them as PDFs on the fly. In this article you will see how you can use Zend_Pdf to auto-generate PDF invoices.

The concept is pretty simple - take the rows of invoice data from your system and inject them into a new PDF document. They show you how to create an invoice layout that includes that data, a header with your company name, invoice-related information and the total/amount due at the bottom. The full code is included to help you create the Zend_Pdf object, apply the text to it (based on location in the document) and working with the default font. You can download the full source from github.

tagged: invoices zendpdf zendframework dynamic tutorial pdf

Link:

Zend Developer Zone:
Creating PDF Documents with Zend Framework
Aug 31, 2010 @ 19:27:15

On the Zend Developer Zone there's a new post by Vikram Vaswani about a method for creating PDF files directly from a Zend Framework application (hint: it uses Zend_Pdf).

PHP comes with a number of options to help developers dynamically generate PDF files from within their applications. The Haru and PDFlib extensions offer a complete API for dynamic PDF generation, and there also exist a number of open-source PHP components that can be used for the same purpose. This article will introduce you to one such component, the Zend_Pdf component that ships as part of the Zend Framework, and illustrate how it can be used to perform sophisticated PDF operations from within a PHP application.

The tutorial walks you through some of the introductory steps to using the component (outside of the framework) and create a sample PDF with some basic text. It gets more technical by adding in pictures, text wrapping, drawing lines and shapes, styling text and using things like the My_Pdf_Table feature to easily create tables. There's even a bit at the end about using the properties of the file to set things like title, subject and author.

tagged: pdf tutorial zendframework zendpdf document

Link:

Jani Hartikainen's Blog:
Improved PDF generation with RE Framework RE_Pdf
Mar 24, 2009 @ 13:42:27

Jani Hartikainen has made a recent post about a library that can manage PDF generation a bit better than the Zend_PDF component of the Zend Framework - RE_PDF.

Zend_Pdf, while generally quite good, has one big issue: It does not support word wrapping text! There’s a new and still a bit obscure framework called RE Framework, which has an excellent PDF component - it includes support for word wrapping, better support for PDF templates, image loading etc.

The several of the interfaces (method calls) are similar between Zend_Pdf and RE_Pdf, so there's not too much rewriting involved if you're already using Zend's option. He shows how to parse an XML file, plug those values, the fonts and fields, in the PDF object then flesh it out with a presentation layer and information to fill in the blanks.

tagged: improved pdf generate framework zendpdf repdf reframework

Link:

Jani Hartikainen's Blog:
Making a PDF generator class using Zend_Pdf
Oct 06, 2008 @ 13:44:32

Using the Zend_Pdf component of the Zend Framework Jani Hartikainen has created a simple way to make a PDF generator class that uses templates and content arrays/XML to create the new files.

There are some expensive libraries that you can use to generate PDF files...but why bother with them, when there are good free alternatives like Zend_Pdf? [...] Since this is a quite repetitive task, let's also create a PDF generator class to help us. In case you don't have Zend_Pdf, just download Zend Framework to get it.

He shows how to set it up to work with basic PHP arrays to pull the content from as well as an XML structure with the same sort of information. You can download his class here.

tagged: zendpdf zendframework pdf generate tutorial download

Link:

Logan Buesching's Blog:
Zend_Pdf_Cell
Dec 05, 2007 @ 18:58:00

Logan Buesching has submitted a post about an extension he's created for the Zend_Pdf component of the Zend Framework to add one key feature - positioning.

Needless to say, I was quite disappointed when I came to find out that Zend_Pdf doesn't currently have any type of text layout support except for the exact position to place it. I created a small extension to Zend_Pdf, and building off of an idea from FPDF, I created Zend_Pdf_Cell.

His code is not officially included into the Framework, but has been posted for anyone to use if they might need it. It includes features like: the ability to create a cell and put text inside, position a cell, specify the height/width and format it with different fonts.

He also includes installation instructions (copy the file over, basically) and usage examples to get you started.

tagged: zendpdf zendframework positioning formatting zendpdfcell zendpdf zendframework positioning formatting zendpdfcell

Link:

Logan Buesching's Blog:
Zend_Pdf_Cell
Dec 05, 2007 @ 18:58:00

Logan Buesching has submitted a post about an extension he's created for the Zend_Pdf component of the Zend Framework to add one key feature - positioning.

Needless to say, I was quite disappointed when I came to find out that Zend_Pdf doesn't currently have any type of text layout support except for the exact position to place it. I created a small extension to Zend_Pdf, and building off of an idea from FPDF, I created Zend_Pdf_Cell.

His code is not officially included into the Framework, but has been posted for anyone to use if they might need it. It includes features like: the ability to create a cell and put text inside, position a cell, specify the height/width and format it with different fonts.

He also includes installation instructions (copy the file over, basically) and usage examples to get you started.

tagged: zendpdf zendframework positioning formatting zendpdfcell zendpdf zendframework positioning formatting zendpdfcell

Link:

Zend Developer Zone:
Zend_Pdf Tutorial
Sep 10, 2007 @ 12:58:00

The Zend Developer Zone has posted a new tutorial from Alexander Veremyev as an introduction to the Zend_Pdf component for the Zend Framework.

The Zend_Pdf component of the Zend Framework is intended to allow you to create or manipulate PDF documents from within your applications. [...] In this tutorial my goal is to give you an overview of the capabilities of Zend_Pdf.

Alexander shows the process from start to finish - loading the module, creating a new document, working with text, creating images and shapes, styling, rotation and cropping.

tagged: zendpdf zendframework tutorial pdf document zendpdf zendframework tutorial pdf document

Link:

Zend Developer Zone:
Zend_Pdf Tutorial
Sep 10, 2007 @ 12:58:00

The Zend Developer Zone has posted a new tutorial from Alexander Veremyev as an introduction to the Zend_Pdf component for the Zend Framework.

The Zend_Pdf component of the Zend Framework is intended to allow you to create or manipulate PDF documents from within your applications. [...] In this tutorial my goal is to give you an overview of the capabilities of Zend_Pdf.

Alexander shows the process from start to finish - loading the module, creating a new document, working with text, creating images and shapes, styling, rotation and cropping.

tagged: zendpdf zendframework tutorial pdf document zendpdf zendframework tutorial pdf document

Link:


Trending Topics: