History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-1254
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Alexander Veremyev
Reporter: Niko Sams
Votes: 28
Watchers: 22
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Improve Zend_Pdf Text-Functions

Created: 12/Apr/07 04:21 AM   Updated: 08/Dec/08 05:00 PM
Component/s: Zend_Pdf
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File Cell.php (18 kb)
2. Text File Cell.txt (12 kb)


Tags:
Participants: Alexander Veremyev, Bill Karwin, Logan Buesching, Niko Sams, Wil Sinclair and Willie Alberty


 Description  « Hide
Zend_Pdf currently only has a function drawText to draw Text at a specific position.
For real-world usage it is every hard to work with this - as you have to calculate width and height of texts all the time (only possible ZF-313).

It would be nice to have Features like FPDF where you don't have to manually calculate everytime the y-position of the next line:

Another helpful FPDF-feature is helpfull wenn creating tables:

Additionally there exists a FPDF-Addon which allows to switch the font in a line - without having to calculate x and y positions:


Zend_Pdf has has many features fpdf lacks, it would be very nice if we could use Zend_Pdf

  • a much better OO-Interface, fpdf is one big class
  • utf8-support
  • use ttf-fonts directly

thanks,
niko



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Bill Karwin - 12/Apr/07 04:06 PM
Assign to Alexander.

Alexander Veremyev - 25/May/07 02:48 AM
Depends on document representation model, which should be designed before.

Postponed to post-1.0 period


Logan Buesching - 25/Sep/07 12:09 PM
I have recently created a class that emulates the FPDF cells. Currently, it is very basic but allows for creating of a cell, positioning the cell, and aligning text inside of the cell. I have attached a diff that creates the functionality. A small example is the following:
//create and attach the cell to the first page, and center in the X and Y direction
$cell=new Zend_Pdf_Cell($pdf->pages[0],Zend_Pdf_Cell::POSITION_CENTER_X | Zend_Pdf_Cell::POSITION_CENTER_Y);
//align the text in the center
$cell->addText("The quick brown fox jumped over the lazy dog.",Zend_Pdf_Cell::ALIGN_CENTER);
$cell->newLine();
//write the cell to the PDF document
$cell->write();

Logan Buesching - 25/Sep/07 12:10 PM
Patch for a cell class that allows simple cell creation and text alignment.

Logan Buesching - 29/Nov/07 05:24 PM
I have updated the Cell.php file and fixed a few things. Added borders and word wrapping.

Logan Buesching - 19/Mar/08 09:50 PM
I have just finished up a proposal using the Zend_Pdf_Cell, any comments are welcome. The proposal may be viewed at at http://framework.zend.com/wiki/display/ZFPROP/Zend_Pdf_Cell+-+Logan+Buesching

Wil Sinclair - 25/Mar/08 10:06 PM
Resetting 'fix version priority' and 'fix version' to be re-evaluated for next release.

Willie Alberty - 04/Dec/08 10:34 PM
Unassigning Zend_Pdf issues currently assigned to me pending decision on ZF 2.0 release timeframe and potential contribution of comprehensive changeset.

Wil Sinclair - 08/Dec/08 05:00 PM
Alex, please take a look at this and resolve as necessary.