Skip to end of metadata
Go to start of metadata
Under Construction
This proposal is under construction and is not ready for review.

Zend Framework: Zend_Rtf Component Proposal

Proposed Component Name Zend_Rtf
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Rtf
Proposers Andries Seutens
Revision 0.1 - use-cases
0.2 - module overview (wiki revision: 35)

Table of Contents

1. Overview

Zend_Rtf module functions as a RTF (Rich Text Format) manipulation engine. It should be able to load existing documents, create new, modify and save modified documents. Thus it can help any PHP-driven application dynamically prepare documents in RTF by modifying existing template or generating document from a scratch.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

Zend_Rtf module should/must supports the following features:

  • Must be able to create new document
  • Must be able to load an existing document and modify items
  • Must be able to manipulate pages within document
    • add and remove pages
    • change the page order
    • copy pages
    • change the format
  • Must support styles and markup to modify the visual look
    • alignment
    • font
    • font families
    • font size
    • font colors
    • italic
    • bold
    • background color
    • margins
    • borders
      • border kind
      • border type
      • border width
      • border color
      • border distance from paragraph
    • shading
    • scale
    • emboss
    • kerning
    • small capital
    • engrave
    • strike and double strike
    • subscript
    • superscript
    • ...
  • Must be able to draw and modify tables (html-like)
  • Tables must be able to be formatted as such:
    • table
      • borders
    • row
      • aligment
      • height
      • left, right margin
    • cell
      • left, right, top, bottom margin
      • shading
      • text direction
  • Must be able to draw text using built-in fonts or custom TrueType fonts
  • Must be able to draw primitives
    • lines
    • rectangles
    • olygons
    • circles
    • ellipses
    • sectors
  • Must be able to create document footers and headers
    • Footers and headers must be able to turn on/off per page and as a whole
  • Must be able to store metadata for the document
  • Must support different page orientations
    • portrait
    • landscape
  • Must support different page formats/sizes
    • A4
    • USLetter
    • B11 X 17
    • LGL8.5 X 14
    • HLT5.5 X 8.5
    • EXE7.5 X 10.5
    • A3
  • Must support custom page formats/sizes
  • Must be able to support unicode (help prefered here)
  • Must be able to support tabs
  • Must be able to support columns
  • Must be able to support bullets and numbering
  • Must be able to load images (*.bmp, *.jpg, *.gif)

In a later phase, there could be an engine for PDF to RTF, and vica versa.

4. Dependencies on Other Framework Components

  • Zend_Exception
  • ...

5. Theory of Operation

todo

6. Milestones / Tasks

  • Milestone 1: Proposal
  • Milestone 2: Proposal accepted
  • Milestone 3: Working release
  • Milestone 4: Unit tests
  • Milestone 5: Documentation
  • Milestone 6: Future enhancements

7. Class Index

  • Zend_Rtf
  • Zend_Rtf_Document
  • Zend_Rtf_Page
  • Zend_Rtf_Exception
  • ...
    -
  • Zend_Rtf_Style
  • Zend_Rtf_Style_Abstract
  • Zend_Rtf_Style_Paragraph
  • Zend_Rtf_Style_Heading
  • Zend_Rtf_Style_Table
  • ...
    -
  • Zend_Rtf_Section
  • Zend_Rtf_Section_Abstract
  • Zend_Rtf_Section_Header
  • Zend_Rtf_Section_Footer
  • ...
    -
  • Zend_Rtf_Color
  • Zend_Rtf_Color_Abstract
  • Zend_Rtf_Color_Html
  • Zend_Rtf_Color_Rgb
  • ...

8. Use Cases

UC-1: creating an RTF document, and setting it's metadata:

UC-2: adding pages:

UC-3: using styles and adding text:

UC-4: creating document header and footer:

UC-5: copying and modifying copied pages:

9. Class Skeletons

todo

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jan 16, 2008

    The way of handling the properties does not look very Zend'ish. It would be either Zend_Rtf_Document::setProperty($key, $value) or better Zend_Rtf_Document::setTitle(), Zend_Rtf_Document::setSubject() and the like. You could also externalize functionality from Zend_Rtf_Document to a Zend_Rtf_Document_Properties-object. The a call for setting a title would look like $doc->getProperties()->setTitle("foo") which is longer but in an OOP sense pretty correct.

    In UC-5 there is a "new new", just a type. Zend_Rtf_Document::setNoFooter() should be disableFooter().

  2. Jan 16, 2008

    Hi Lars,

    Thank you for the feedback. I am currently working with Willie Alberty to line the API up with Zend_Pdf. Zend_Rtf and Zend_Pdf share a lot in common, so their API's should be similar.

    I will keep you posted, but I expect the API to change pretty drasticly.

  3. May 14, 2008

    Andries, do you still plan to drive this proposal to recommendation? If not, can we move it to the archived section until you can pick it up again?

    Thanks.
    ,Wil

  4. Jun 20, 2008

    Moving to Archived section until Andries can start driving this proposal again.

    ,Wil