Discussion:
Upcoming Zend_Pdf Enhancements
Willie Alberty
2008-04-05 02:53:59 UTC
Permalink
For the last few months I have been working with Kevin McArthur on a
comprehensive PDF generation project for a client [Streamflow] who has
some pretty advanced layout needs. The project is nearing completion
and we have been discussing the possibility of contributing large
portions of the code back to the Zend Framework as improvements to
Zend_Pdf.

In light of several recent postings to fw-general and fw-formats, as
well as a few encouraging proposals recently submitted to the Wiki, we
would like to formally announce our plans and describe the new
functionality at a high level here.

We will be submitting proposals in the coming weeks that describe
these new components in more detail along with fully-functional
reference implementations. Our hope is to join forces with other
interested developers to help fast-track these proposals through the
feedback and approval process, write tests, user documentation, and
examples, and exercise the code as much as possible.

We're really proud of this work and are excited to share it with the
community. We believe that these enhancements will further establish
Zend_Pdf's role as the gold standard for PDF generation using PHP.


Text Layout Engine
------------------

"How do I wrap long lines of text?" This is probably the most commonly-
asked question regarding Zend_Pdf. I'm pleased to report that not only
have we solved the problem of text-wrapping, but a whole host of
others as well. The new engine provides fully-automatic text layout,
and has customization hooks in a variety of places.

Line breaks are calculated using the Unicode Line Breaking Algorithm
(UAX #14), providing linguistically-appropriate line breaks, not just
at whitespace characters.

Paragraph styles allow you to specify left-, center-, and right-
alignment, as well as full justification, line leading, line height,
line multiple (double-space, triple-space, etc.), pre- and post-
paragraph spacing, left- and right-side margins, and first-line
indentation. Paragraph styles also support left-, center-, right-, and
decimal-aligned tab stops, with or without leaders, for intra-line
alignment needs.

In addition to the left-to-right line sweep used by most Latin-based
scripts, right-to-left line sweep is also supported, and is
automatically detected by the layout engine; you never need to supply
strings in reverse character order for right-to-left text layout.

The layout engine is based around the concept of an attributed string.
These are Unicode strings of unlimited length, and fully support the
entire Unicode character set, including characters outside the Basic
Multilingual Plane (BMP).

Attributed strings allow you to assign stylistic attributes to
arbitrary ranges of characters within the string. These attributes are
used by typesetters to determine the specific look and location for
every character. This means that you can make unlimited style changes
within a block of text, even changing styles character-by-character if
desired.

The layout engine automatically manages all of these style changes,
applying them as necessary when drawing the text on the page. The
following style attributes are supported:

- Font
- Font size
- Fill color
- Stroke width and color
- Underline and strikethrough
- Super- and sub-script
- Background color

You can add your own custom attributes as well, which you can use in
your own subclasses to completely customize the layout engine's
behavior.

These attributed strings will eventually be shared with Zend_Rtf
(recently proposed by Andries Seutens), as each attributed string is
essentially a self-contained RTF document. This opens up the
possibility for generating fully-styled PDF or RTF output from the
same source with only a couple of lines of code. It will also
eventually be possible to use existing styled RTF documents as the
basis for PDF text drawing, eliminating the need to manually apply
style attributes in your PHP code.

A layout manager class is responsible for drawing these attributed
strings. It lays out the text in a series of arbitrarily-shaped text
containers, automatically moving from one to the next as each is
filled. Rectangular and circular containers will be provided, but you
can easily create your own custom containers for other shapes or to
flow text around images.

Multi-column output is as easy as creating two adjacent text
containers on the same page. Text containers don't even need to be on
the same PDF page: you can start your text in a small container on
page 1, then continue it on page 17.

Callback functions are provided to allow you to create text additional
containers as needed, which can be located on new pages. This is
useful if you do not know the length of the text you are drawing ahead
of time, or if you want to adapt your layout on-the-fly.

You can also use multiple layout managers on a single page, allowing
you to create complex multi-page flows for a series of text runs.
These can be useful for creating page headers and footers, or for
running stories side-by-side in a newsletter.


Drawing Model
-------------

Three new primitive geometry classes allow you to precisely define
drawing locations, sizes, and regions. They also provide a host of
convenience functions allowing for calculation, conversion,
intersection testing, etc.:

- Point: x and y coordinate
- Size: height and width
- Rectangle: combination of a point and size

PDF pages are drawn using a series of content streams, which contain
all of the low-level drawing commands. Zend_Pdf_Page currently manages
its own private content stream.

We've separated content streams from Zend_Pdf_Page, promoting them to
first-class objects. This allows us to use these content streams as
templates that can be reused again and again, either on a single page
or multiple pages. Templates can greatly reduce PDF file sizes and
improve memory use and performance in PDF viewer applications.

It is also possible to create a template from any page in an existing
PDF document. You can then reuse the template in the same PDF, or even
copy it to a new PDF document, where you can use it as a page
background, draw it as a thumbnail, perform imposition, etc.


Performance and Memory
----------------------

We've also made numerous performance and memory-usage improvements
throughout the code. Most data is now lazily-loaded, allowing you to
manipulate very large documents, containing thousands or millions of
individual objects or hundreds of megabytes or gigabytes in size, with
a very low memory footprint.


Future Enhancements
-------------------

All of this new functionality lays the groundwork for even more
powerful enhancements down the road:

- Top-to-bottom line sweep for Asian scripts
- Bi-directional text (for Hebrew, Arabic, and others)
- Bulleted and numbered text lists
- HTML-inspired inline text tables
- Inline attachments (for example, images that flow with text)
- Advanced typographic features such as tracking, pairwise kerning,
ligatures, etc.
- Hyphenation support
- Glyph substitution using fallback fonts
- and more...


Again, we're really excited to be sharing this code with the
community. We'll be creating the proposals for the various components
in the coming weeks and announcing them on the fw-formats list when
they're ready for review. In the meantime, if you have any high-level
questions, please don't hesitate to ask.

--

Willie Alberty, Owner
Spenlen Media
willie-***@public.gmane.org

http://www.spenlen.com/
Rob Allen
2008-04-05 08:57:48 UTC
Permalink
Post by Willie Alberty
Again, we're really excited to be sharing this code with the
community. We'll be creating the proposals for the various
components in the coming weeks and announcing them on the fw-formats
list when they're ready for review. In the meantime, if you have any
high-level questions, please don't hesitate to ask.
That all sounds excellent, especially templates from existing PDFs,
word wrapping and the memory footprint reductions.

Regards,

Rob...
Amr Mostafa
2008-04-18 16:48:27 UTC
Permalink
Awesome, I'm looking forward a "formal" proposal of all this! :)

Best,
- Amr
Post by Willie Alberty
For the last few months I have been working with Kevin McArthur on a
comprehensive PDF generation project for a client [Streamflow] who has some
pretty advanced layout needs. The project is nearing completion and we have
been discussing the possibility of contributing large portions of the code
back to the Zend Framework as improvements to Zend_Pdf.
In light of several recent postings to fw-general and fw-formats, as well
as a few encouraging proposals recently submitted to the Wiki, we would like
to formally announce our plans and describe the new functionality at a high
level here.
We will be submitting proposals in the coming weeks that describe these
new components in more detail along with fully-functional reference
implementations. Our hope is to join forces with other interested developers
to help fast-track these proposals through the feedback and approval
process, write tests, user documentation, and examples, and exercise the
code as much as possible.
We're really proud of this work and are excited to share it with the
community. We believe that these enhancements will further establish
Zend_Pdf's role as the gold standard for PDF generation using PHP.
Text Layout Engine
------------------
"How do I wrap long lines of text?" This is probably the most
commonly-asked question regarding Zend_Pdf. I'm pleased to report that not
only have we solved the problem of text-wrapping, but a whole host of others
as well. The new engine provides fully-automatic text layout, and has
customization hooks in a variety of places.
Line breaks are calculated using the Unicode Line Breaking Algorithm (UAX
#14), providing linguistically-appropriate line breaks, not just at
whitespace characters.
Paragraph styles allow you to specify left-, center-, and right-alignment,
as well as full justification, line leading, line height, line multiple
(double-space, triple-space, etc.), pre- and post- paragraph spacing, left-
and right-side margins, and first-line indentation. Paragraph styles also
support left-, center-, right-, and decimal-aligned tab stops, with or
without leaders, for intra-line alignment needs.
In addition to the left-to-right line sweep used by most Latin-based
scripts, right-to-left line sweep is also supported, and is automatically
detected by the layout engine; you never need to supply strings in reverse
character order for right-to-left text layout.
The layout engine is based around the concept of an attributed string.
These are Unicode strings of unlimited length, and fully support the entire
Unicode character set, including characters outside the Basic Multilingual
Plane (BMP).
Attributed strings allow you to assign stylistic attributes to arbitrary
ranges of characters within the string. These attributes are used by
typesetters to determine the specific look and location for every character.
This means that you can make unlimited style changes within a block of text,
even changing styles character-by-character if desired.
The layout engine automatically manages all of these style changes,
applying them as necessary when drawing the text on the page. The following
- Font
- Font size
- Fill color
- Stroke width and color
- Underline and strikethrough
- Super- and sub-script
- Background color
You can add your own custom attributes as well, which you can use in your
own subclasses to completely customize the layout engine's behavior.
These attributed strings will eventually be shared with Zend_Rtf (recently
proposed by Andries Seutens), as each attributed string is essentially a
self-contained RTF document. This opens up the possibility for generating
fully-styled PDF or RTF output from the same source with only a couple of
lines of code. It will also eventually be possible to use existing styled
RTF documents as the basis for PDF text drawing, eliminating the need to
manually apply style attributes in your PHP code.
A layout manager class is responsible for drawing these attributed
strings. It lays out the text in a series of arbitrarily-shaped text
containers, automatically moving from one to the next as each is filled.
Rectangular and circular containers will be provided, but you can easily
create your own custom containers for other shapes or to flow text around
images.
Multi-column output is as easy as creating two adjacent text containers on
you can start your text in a small container on page 1, then continue it on
page 17.
Callback functions are provided to allow you to create text additional
containers as needed, which can be located on new pages. This is useful if
you do not know the length of the text you are drawing ahead of time, or if
you want to adapt your layout on-the-fly.
You can also use multiple layout managers on a single page, allowing you
to create complex multi-page flows for a series of text runs. These can be
useful for creating page headers and footers, or for running stories
side-by-side in a newsletter.
Drawing Model
-------------
Three new primitive geometry classes allow you to precisely define drawing
locations, sizes, and regions. They also provide a host of convenience
- Point: x and y coordinate
- Size: height and width
- Rectangle: combination of a point and size
PDF pages are drawn using a series of content streams, which contain all
of the low-level drawing commands. Zend_Pdf_Page currently manages its own
private content stream.
We've separated content streams from Zend_Pdf_Page, promoting them to
first-class objects. This allows us to use these content streams as
templates that can be reused again and again, either on a single page or
multiple pages. Templates can greatly reduce PDF file sizes and improve
memory use and performance in PDF viewer applications.
It is also possible to create a template from any page in an existing PDF
document. You can then reuse the template in the same PDF, or even copy it
to a new PDF document, where you can use it as a page background, draw it as
a thumbnail, perform imposition, etc.
Performance and Memory
----------------------
We've also made numerous performance and memory-usage improvements
throughout the code. Most data is now lazily-loaded, allowing you to
manipulate very large documents, containing thousands or millions of
individual objects or hundreds of megabytes or gigabytes in size, with a
very low memory footprint.
Future Enhancements
-------------------
All of this new functionality lays the groundwork for even more powerful
- Top-to-bottom line sweep for Asian scripts
- Bi-directional text (for Hebrew, Arabic, and others)
- Bulleted and numbered text lists
- HTML-inspired inline text tables
- Inline attachments (for example, images that flow with text)
- Advanced typographic features such as tracking, pairwise kerning,
ligatures, etc.
- Hyphenation support
- Glyph substitution using fallback fonts
- and more...
Again, we're really excited to be sharing this code with the community.
We'll be creating the proposals for the various components in the coming
weeks and announcing them on the fw-formats list when they're ready for
review. In the meantime, if you have any high-level questions, please don't
hesitate to ask.
--
Willie Alberty, Owner
Spenlen Media
http://www.spenlen.com/
--
Amr Mostafa, Head of Software Development, IT Synergy
amr-***@public.gmane.org http://itsyn.com
+(2012)1700502 +(202)35371020
ezamaze
2008-06-27 16:52:47 UTC
Permalink
This sounds like an exciting enhancement of Zend_Pdf.
Post by Willie Alberty
Our hope is to join forces with other
interested developers to help fast-track these proposals through the
feedback and approval process, write tests, user documentation, and
examples, and exercise the code as much as possible.
I would be glad to help where possible...

Best regards,
Matthias
--
View this message in context: http://www.nabble.com/Upcoming-Zend_Pdf-Enhancements-tp16509067p18159412.html
Sent from the Zend MFS mailing list archive at Nabble.com.
mvug
2009-02-04 22:49:12 UTC
Permalink
Does anybody know what the status is? And especially the status of the
enhancements to the memory usage and template system of zend pdf?
Thanks!
Post by Willie Alberty
For the last few months I have been working with Kevin McArthur on a
comprehensive PDF generation project for a client [Streamflow] who has
some pretty advanced layout needs. The project is nearing completion
and we have been discussing the possibility of contributing large
portions of the code back to the Zend Framework as improvements to
Zend_Pdf.
In light of several recent postings to fw-general and fw-formats, as
well as a few encouraging proposals recently submitted to the Wiki, we
would like to formally announce our plans and describe the new
functionality at a high level here.
We will be submitting proposals in the coming weeks that describe
these new components in more detail along with fully-functional
reference implementations. Our hope is to join forces with other
interested developers to help fast-track these proposals through the
feedback and approval process, write tests, user documentation, and
examples, and exercise the code as much as possible.
We're really proud of this work and are excited to share it with the
community. We believe that these enhancements will further establish
Zend_Pdf's role as the gold standard for PDF generation using PHP.
Text Layout Engine
------------------
"How do I wrap long lines of text?" This is probably the most commonly-
asked question regarding Zend_Pdf. I'm pleased to report that not only
have we solved the problem of text-wrapping, but a whole host of
others as well. The new engine provides fully-automatic text layout,
and has customization hooks in a variety of places.
Line breaks are calculated using the Unicode Line Breaking Algorithm
(UAX #14), providing linguistically-appropriate line breaks, not just
at whitespace characters.
Paragraph styles allow you to specify left-, center-, and right-
alignment, as well as full justification, line leading, line height,
line multiple (double-space, triple-space, etc.), pre- and post-
paragraph spacing, left- and right-side margins, and first-line
indentation. Paragraph styles also support left-, center-, right-, and
decimal-aligned tab stops, with or without leaders, for intra-line
alignment needs.
In addition to the left-to-right line sweep used by most Latin-based
scripts, right-to-left line sweep is also supported, and is
automatically detected by the layout engine; you never need to supply
strings in reverse character order for right-to-left text layout.
The layout engine is based around the concept of an attributed string.
These are Unicode strings of unlimited length, and fully support the
entire Unicode character set, including characters outside the Basic
Multilingual Plane (BMP).
Attributed strings allow you to assign stylistic attributes to
arbitrary ranges of characters within the string. These attributes are
used by typesetters to determine the specific look and location for
every character. This means that you can make unlimited style changes
within a block of text, even changing styles character-by-character if
desired.
The layout engine automatically manages all of these style changes,
applying them as necessary when drawing the text on the page. The
- Font
- Font size
- Fill color
- Stroke width and color
- Underline and strikethrough
- Super- and sub-script
- Background color
You can add your own custom attributes as well, which you can use in
your own subclasses to completely customize the layout engine's
behavior.
These attributed strings will eventually be shared with Zend_Rtf
(recently proposed by Andries Seutens), as each attributed string is
essentially a self-contained RTF document. This opens up the
possibility for generating fully-styled PDF or RTF output from the
same source with only a couple of lines of code. It will also
eventually be possible to use existing styled RTF documents as the
basis for PDF text drawing, eliminating the need to manually apply
style attributes in your PHP code.
A layout manager class is responsible for drawing these attributed
strings. It lays out the text in a series of arbitrarily-shaped text
containers, automatically moving from one to the next as each is
filled. Rectangular and circular containers will be provided, but you
can easily create your own custom containers for other shapes or to
flow text around images.
Multi-column output is as easy as creating two adjacent text
containers on the same page. Text containers don't even need to be on
the same PDF page: you can start your text in a small container on
page 1, then continue it on page 17.
Callback functions are provided to allow you to create text additional
containers as needed, which can be located on new pages. This is
useful if you do not know the length of the text you are drawing ahead
of time, or if you want to adapt your layout on-the-fly.
You can also use multiple layout managers on a single page, allowing
you to create complex multi-page flows for a series of text runs.
These can be useful for creating page headers and footers, or for
running stories side-by-side in a newsletter.
Drawing Model
-------------
Three new primitive geometry classes allow you to precisely define
drawing locations, sizes, and regions. They also provide a host of
convenience functions allowing for calculation, conversion,
- Point: x and y coordinate
- Size: height and width
- Rectangle: combination of a point and size
PDF pages are drawn using a series of content streams, which contain
all of the low-level drawing commands. Zend_Pdf_Page currently manages
its own private content stream.
We've separated content streams from Zend_Pdf_Page, promoting them to
first-class objects. This allows us to use these content streams as
templates that can be reused again and again, either on a single page
or multiple pages. Templates can greatly reduce PDF file sizes and
improve memory use and performance in PDF viewer applications.
It is also possible to create a template from any page in an existing
PDF document. You can then reuse the template in the same PDF, or even
copy it to a new PDF document, where you can use it as a page
background, draw it as a thumbnail, perform imposition, etc.
Performance and Memory
----------------------
We've also made numerous performance and memory-usage improvements
throughout the code. Most data is now lazily-loaded, allowing you to
manipulate very large documents, containing thousands or millions of
individual objects or hundreds of megabytes or gigabytes in size, with
a very low memory footprint.
Future Enhancements
-------------------
All of this new functionality lays the groundwork for even more
- Top-to-bottom line sweep for Asian scripts
- Bi-directional text (for Hebrew, Arabic, and others)
- Bulleted and numbered text lists
- HTML-inspired inline text tables
- Inline attachments (for example, images that flow with text)
- Advanced typographic features such as tracking, pairwise kerning,
ligatures, etc.
- Hyphenation support
- Glyph substitution using fallback fonts
- and more...
Again, we're really excited to be sharing this code with the
community. We'll be creating the proposals for the various components
in the coming weeks and announcing them on the fw-formats list when
they're ready for review. In the meantime, if you have any high-level
questions, please don't hesitate to ask.
--
Willie Alberty, Owner
Spenlen Media
http://www.spenlen.com/
--
View this message in context: http://www.nabble.com/Upcoming-Zend_Pdf-Enhancements-tp16509067p21841469.html
Sent from the Zend MFS mailing list archive at Nabble.com.
Joseph
2009-04-07 10:00:01 UTC
Permalink
Same question!!
Post by mvug
Does anybody know what the status is? And especially the status of the
enhancements to the memory usage and template system of zend pdf?
Thanks!
Post by Willie Alberty
For the last few months I have been working with Kevin McArthur on a
comprehensive PDF generation project for a client [Streamflow] who has
some pretty advanced layout needs. The project is nearing completion
and we have been discussing the possibility of contributing large
portions of the code back to the Zend Framework as improvements to
Zend_Pdf.
In light of several recent postings to fw-general and fw-formats, as
well as a few encouraging proposals recently submitted to the Wiki, we
would like to formally announce our plans and describe the new
functionality at a high level here.
We will be submitting proposals in the coming weeks that describe
these new components in more detail along with fully-functional
reference implementations. Our hope is to join forces with other
interested developers to help fast-track these proposals through the
feedback and approval process, write tests, user documentation, and
examples, and exercise the code as much as possible.
We're really proud of this work and are excited to share it with the
community. We believe that these enhancements will further establish
Zend_Pdf's role as the gold standard for PDF generation using PHP.
Text Layout Engine
------------------
"How do I wrap long lines of text?" This is probably the most commonly-
asked question regarding Zend_Pdf. I'm pleased to report that not only
have we solved the problem of text-wrapping, but a whole host of
others as well. The new engine provides fully-automatic text layout,
and has customization hooks in a variety of places.
Line breaks are calculated using the Unicode Line Breaking Algorithm
(UAX #14), providing linguistically-appropriate line breaks, not just
at whitespace characters.
Paragraph styles allow you to specify left-, center-, and right-
alignment, as well as full justification, line leading, line height,
line multiple (double-space, triple-space, etc.), pre- and post-
paragraph spacing, left- and right-side margins, and first-line
indentation. Paragraph styles also support left-, center-, right-, and
decimal-aligned tab stops, with or without leaders, for intra-line
alignment needs.
In addition to the left-to-right line sweep used by most Latin-based
scripts, right-to-left line sweep is also supported, and is
automatically detected by the layout engine; you never need to supply
strings in reverse character order for right-to-left text layout.
The layout engine is based around the concept of an attributed string.
These are Unicode strings of unlimited length, and fully support the
entire Unicode character set, including characters outside the Basic
Multilingual Plane (BMP).
Attributed strings allow you to assign stylistic attributes to
arbitrary ranges of characters within the string. These attributes are
used by typesetters to determine the specific look and location for
every character. This means that you can make unlimited style changes
within a block of text, even changing styles character-by-character if
desired.
The layout engine automatically manages all of these style changes,
applying them as necessary when drawing the text on the page. The
- Font
- Font size
- Fill color
- Stroke width and color
- Underline and strikethrough
- Super- and sub-script
- Background color
You can add your own custom attributes as well, which you can use in
your own subclasses to completely customize the layout engine's
behavior.
These attributed strings will eventually be shared with Zend_Rtf
(recently proposed by Andries Seutens), as each attributed string is
essentially a self-contained RTF document. This opens up the
possibility for generating fully-styled PDF or RTF output from the
same source with only a couple of lines of code. It will also
eventually be possible to use existing styled RTF documents as the
basis for PDF text drawing, eliminating the need to manually apply
style attributes in your PHP code.
A layout manager class is responsible for drawing these attributed
strings. It lays out the text in a series of arbitrarily-shaped text
containers, automatically moving from one to the next as each is
filled. Rectangular and circular containers will be provided, but you
can easily create your own custom containers for other shapes or to
flow text around images.
Multi-column output is as easy as creating two adjacent text
containers on the same page. Text containers don't even need to be on
the same PDF page: you can start your text in a small container on
page 1, then continue it on page 17.
Callback functions are provided to allow you to create text additional
containers as needed, which can be located on new pages. This is
useful if you do not know the length of the text you are drawing ahead
of time, or if you want to adapt your layout on-the-fly.
You can also use multiple layout managers on a single page, allowing
you to create complex multi-page flows for a series of text runs.
These can be useful for creating page headers and footers, or for
running stories side-by-side in a newsletter.
Drawing Model
-------------
Three new primitive geometry classes allow you to precisely define
drawing locations, sizes, and regions. They also provide a host of
convenience functions allowing for calculation, conversion,
- Point: x and y coordinate
- Size: height and width
- Rectangle: combination of a point and size
PDF pages are drawn using a series of content streams, which contain
all of the low-level drawing commands. Zend_Pdf_Page currently manages
its own private content stream.
We've separated content streams from Zend_Pdf_Page, promoting them to
first-class objects. This allows us to use these content streams as
templates that can be reused again and again, either on a single page
or multiple pages. Templates can greatly reduce PDF file sizes and
improve memory use and performance in PDF viewer applications.
It is also possible to create a template from any page in an existing
PDF document. You can then reuse the template in the same PDF, or even
copy it to a new PDF document, where you can use it as a page
background, draw it as a thumbnail, perform imposition, etc.
Performance and Memory
----------------------
We've also made numerous performance and memory-usage improvements
throughout the code. Most data is now lazily-loaded, allowing you to
manipulate very large documents, containing thousands or millions of
individual objects or hundreds of megabytes or gigabytes in size, with
a very low memory footprint.
Future Enhancements
-------------------
All of this new functionality lays the groundwork for even more
- Top-to-bottom line sweep for Asian scripts
- Bi-directional text (for Hebrew, Arabic, and others)
- Bulleted and numbered text lists
- HTML-inspired inline text tables
- Inline attachments (for example, images that flow with text)
- Advanced typographic features such as tracking, pairwise kerning,
ligatures, etc.
- Hyphenation support
- Glyph substitution using fallback fonts
- and more...
Again, we're really excited to be sharing this code with the
community. We'll be creating the proposals for the various components
in the coming weeks and announcing them on the fw-formats list when
they're ready for review. In the meantime, if you have any high-level
questions, please don't hesitate to ask.
--
Willie Alberty, Owner
Spenlen Media
http://www.spenlen.com/
Luiz Fernando
2009-04-07 12:33:57 UTC
Permalink
Same question.

Please look at

http://www.refw.org/

It's Zend_Pdf based and they like to contribute to ZF.

This component, Re_Pdf, have a lot of goodies over Zend_Pdf.

But don't have a good documentation, only API PHPDOC, no reference guide, tutorials...
Only a IRC channel where nobody returns.

Best regards,
Luiz Fernando





________________________________
De: Joseph <joseph007-***@public.gmane.org>
Para: fw-formats <fw-formats-***@public.gmane.org>
Enviadas: Terça-feira, 7 de Abril de 2009 7:00:01
Assunto: Re: [fw-formats] Upcoming Zend_Pdf Enhancements

Same question!!
Post by mvug
Does anybody know what the status is? And especially the status of the
enhancements to the memory usage and template system of zend pdf?
Thanks!
Post by Willie Alberty
For the last few months I have been working with Kevin McArthur on a
comprehensive PDF generation project for a client [Streamflow] who has
some pretty advanced layout needs. The project is nearing completion
and we have been discussing the possibility of contributing large
portions of the code back to the Zend Framework as improvements to
Zend_Pdf.
In light of several recent postings to fw-general and fw-formats, as
well as a few encouraging proposals recently submitted to the Wiki, we
would like to formally announce our plans and describe the new
functionality at a high level here.
We will be submitting proposals in the coming weeks that describe
these new components in more detail along with fully-functional
reference implementations. Our hope is to join forces with other
interested developers to help fast-track these proposals through the
feedback and approval process, write tests, user documentation, and
examples, and exercise the code as much as possible.
We're really proud of this work and are excited to share it with the
community. We believe that these enhancements will further establish
Zend_Pdf's role as the gold standard for PDF generation using PHP.
Text Layout Engine
------------------
"How do I wrap long lines of text?" This is probably the most commonly-
asked question regarding Zend_Pdf. I'm pleased to report that not only
have we solved the problem of text-wrapping, but a whole host of
others as well. The new engine provides fully-automatic text layout,
and has customization hooks in a variety of places.
Line breaks are calculated using the Unicode Line Breaking Algorithm
(UAX #14), providing linguistically-appropriate line breaks, not just
at whitespace characters.
Paragraph styles allow you to specify left-, center-, and right-
alignment, as well as full justification, line leading, line height,
line multiple (double-space, triple-space, etc.), pre- and post-
paragraph spacing, left- and right-side margins, and first-line
indentation. Paragraph styles also support left-, center-, right-, and
decimal-aligned tab stops, with or without leaders, for intra-line
alignment needs.
In addition to the left-to-right line sweep used by most Latin-based
scripts, right-to-left line sweep is also supported, and is
automatically detected by the layout engine; you never need to supply
strings in reverse character order for right-to-left text layout.
The layout engine is based around the concept of an attributed string.
These are Unicode strings of unlimited length, and fully support the
entire Unicode character set, including characters outside the Basic
Multilingual Plane (BMP).
Attributed strings allow you to assign stylistic attributes to
arbitrary ranges of characters within the string. These attributes are
used by typesetters to determine the specific look and location for
every character. This means that you can make unlimited style changes
within a block of text, even changing styles character-by-character if
desired.
The layout engine automatically manages all of these style changes,
applying them as necessary when drawing the text on the page. The
- Font
- Font size
- Fill color
- Stroke width and color
- Underline and strikethrough
- Super- and sub-script
- Background color
You can add your own custom attributes as well, which you can use in
your own subclasses to completely customize the layout engine's
behavior.
These attributed strings will eventually be shared with Zend_Rtf
(recently proposed by Andries Seutens), as each attributed string is
essentially a self-contained RTF document. This opens up the
possibility for generating fully-styled PDF or RTF output from the
same source with only a couple of lines of code. It will also
eventually be possible to use existing styled RTF documents as the
basis for PDF text drawing, eliminating the need to manually apply
style attributes in your PHP code.
A layout manager class is responsible for drawing these attributed
strings. It lays out the text in a series of arbitrarily-shaped text
containers, automatically moving from one to the next as each is
filled. Rectangular and circular containers will be provided, but you
can easily create your own custom containers for other shapes or to
flow text around images.
Multi-column output is as easy as creating two adjacent text
containers on the same page. Text containers don't even need to be on
the same PDF page: you can start your text in a small container on
page 1, then continue it on page 17.
Callback functions are provided to allow you to create text additional
containers as needed, which can be located on new pages. This is
useful if you do not know the length of the text you are drawing ahead
of time, or if you want to adapt your layout on-the-fly.
You can also use multiple layout managers on a single page, allowing
you to create complex multi-page flows for a series of text runs.
These can be useful for creating page headers and footers, or for
running stories side-by-side in a newsletter.
Drawing Model
-------------
Three new primitive geometry classes allow you to precisely define
drawing locations, sizes, and regions. They also provide a host of
convenience functions allowing for calculation, conversion,
- Point: x and y coordinate
- Size: height and width
- Rectangle: combination of a point and size
PDF pages are drawn using a series of content streams, which contain
all of the low-level drawing commands. Zend_Pdf_Page currently manages
its own private content stream.
We've separated content streams from Zend_Pdf_Page, promoting them to
first-class objects. This allows us to use these content streams as
templates that can be reused again and again, either on a single page
or multiple pages. Templates can greatly reduce PDF file sizes and
improve memory use and performance in PDF viewer applications.
It is also possible to create a template from any page in an existing
PDF document. You can then reuse the template in the same PDF, or even
copy it to a new PDF document, where you can use it as a page
background, draw it as a thumbnail, perform imposition, etc.
Performance and Memory
----------------------
We've also made numerous performance and memory-usage improvements
throughout the code. Most data is now lazily-loaded, allowing you to
manipulate very large documents, containing thousands or millions of
individual objects or hundreds of megabytes or gigabytes in size, with
a very low memory footprint.
Future Enhancements
-------------------
All of this new functionality lays the groundwork for even more
- Top-to-bottom line sweep for Asian scripts
- Bi-directional text (for Hebrew, Arabic, and others)
- Bulleted and numbered text lists
- HTML-inspired inline text tables
- Inline attachments (for example, images that flow with text)
- Advanced typographic features such as tracking, pairwise kerning,
ligatures, etc.
- Hyphenation support
- Glyph substitution using fallback fonts
- and more...
Again, we're really excited to be sharing this code with the
community. We'll be creating the proposals for the various components
in the coming weeks and announcing them on the fw-formats list when
they're ready for review. In the meantime, if you have any high-level
questions, please don't hesitate to ask.
--
Willie Alberty, Owner
Spenlen Media
http://www.spenlen.com/
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
Joseph
2009-04-07 13:28:38 UTC
Permalink
Yeah, thanks!!

It would be great to have all that features in Zend_Pdf.
In this case it would be some documented, test cases added, etc,
etc ... ...officially released.

Its a pity but right now it is just a third party component that is not
allowed to be used in serious projects :/
Post by Luiz Fernando
Same question.
Please look at
http://www.refw.org/
It's Zend_Pdf based and they like to contribute to ZF.
This component, Re_Pdf, have a lot of goodies over Zend_Pdf.
But don't have a good documentation, only API PHPDOC, no reference guide, tutorials...
Only a IRC channel where nobody returns.
Best regards,
Luiz Fernando
______________________________________________________________________
Enviadas: Terça-feira, 7 de Abril de 2009 7:00:01
Assunto: Re: [fw-formats] Upcoming Zend_Pdf Enhancements
Same question!!
Post by mvug
Does anybody know what the status is? And especially the status of
the
Post by mvug
enhancements to the memory usage and template system of zend pdf?
Thanks!
Post by Willie Alberty
For the last few months I have been working with Kevin McArthur on
a
Post by mvug
Post by Willie Alberty
comprehensive PDF generation project for a client [Streamflow] who
has
Post by mvug
Post by Willie Alberty
some pretty advanced layout needs. The project is nearing
completion
Post by mvug
Post by Willie Alberty
and we have been discussing the possibility of contributing
large
Post by mvug
Post by Willie Alberty
portions of the code back to the Zend Framework as improvements
to
Post by mvug
Post by Willie Alberty
Zend_Pdf.
In light of several recent postings to fw-general and fw-formats,
as
Post by mvug
Post by Willie Alberty
well as a few encouraging proposals recently submitted to the
Wiki, we
Post by mvug
Post by Willie Alberty
would like to formally announce our plans and describe the new
functionality at a high level here.
We will be submitting proposals in the coming weeks that
describe
Post by mvug
Post by Willie Alberty
these new components in more detail along with fully-functional
reference implementations. Our hope is to join forces with other
interested developers to help fast-track these proposals through
the
Post by mvug
Post by Willie Alberty
feedback and approval process, write tests, user documentation,
and
Post by mvug
Post by Willie Alberty
examples, and exercise the code as much as possible.
We're really proud of this work and are excited to share it with
the
Post by mvug
Post by Willie Alberty
community. We believe that these enhancements will further
establish
Post by mvug
Post by Willie Alberty
Zend_Pdf's role as the gold standard for PDF generation using PHP.
Text Layout Engine
------------------
"How do I wrap long lines of text?" This is probably the most
commonly-
Post by mvug
Post by Willie Alberty
asked question regarding Zend_Pdf. I'm pleased to report that not
only
Post by mvug
Post by Willie Alberty
have we solved the problem of text-wrapping, but a whole host of
others as well. The new engine provides fully-automatic text
layout,
Post by mvug
Post by Willie Alberty
and has customization hooks in a variety of places.
Line breaks are calculated using the Unicode Line Breaking
Algorithm
Post by mvug
Post by Willie Alberty
(UAX #14), providing linguistically-appropriate line breaks, not
just
Post by mvug
Post by Willie Alberty
at whitespace characters.
Paragraph styles allow you to specify left-, center-, and right-
alignment, as well as full justification, line leading, line
height,
Post by mvug
Post by Willie Alberty
line multiple (double-space, triple-space, etc.), pre- and post-
paragraph spacing, left- and right-side margins, and first-line
indentation. Paragraph styles also support left-, center-, right-,
and
Post by mvug
Post by Willie Alberty
decimal-aligned tab stops, with or without leaders, for
intra-line
Post by mvug
Post by Willie Alberty
alignment needs.
In addition to the left-to-right line sweep used by most
Latin-based
Post by mvug
Post by Willie Alberty
scripts, right-to-left line sweep is also supported, and is
automatically detected by the layout engine; you never need to
supply
Post by mvug
Post by Willie Alberty
strings in reverse character order for right-to-left text layout.
The layout engine is based around the concept of an attributed
string.
Post by mvug
Post by Willie Alberty
These are Unicode strings of unlimited length, and fully support
the
Post by mvug
Post by Willie Alberty
entire Unicode character set, including characters outside the
Basic
Post by mvug
Post by Willie Alberty
Multilingual Plane (BMP).
Attributed strings allow you to assign stylistic attributes to
arbitrary ranges of characters within the string. These attributes
are
Post by mvug
Post by Willie Alberty
used by typesetters to determine the specific look and location
for
Post by mvug
Post by Willie Alberty
every character. This means that you can make unlimited style
changes
Post by mvug
Post by Willie Alberty
within a block of text, even changing styles
character-by-character if
Post by mvug
Post by Willie Alberty
desired.
The layout engine automatically manages all of these style
changes,
Post by mvug
Post by Willie Alberty
applying them as necessary when drawing the text on the page.
The
Post by mvug
Post by Willie Alberty
- Font
- Font size
- Fill color
- Stroke width and color
- Underline and strikethrough
- Super- and sub-script
- Background color
You can add your own custom attributes as well, which you can use
in
Post by mvug
Post by Willie Alberty
your own subclasses to completely customize the layout engine's
behavior.
These attributed strings will eventually be shared with Zend_Rtf
(recently proposed by Andries Seutens), as each attributed string
is
Post by mvug
Post by Willie Alberty
essentially a self-contained RTF document. This opens up the
possibility for generating fully-styled PDF or RTF output from
the
Post by mvug
Post by Willie Alberty
same source with only a couple of lines of code. It will also
eventually be possible to use existing styled RTF documents as
the
Post by mvug
Post by Willie Alberty
basis for PDF text drawing, eliminating the need to manually
apply
Post by mvug
Post by Willie Alberty
style attributes in your PHP code.
A layout manager class is responsible for drawing these
attributed
Post by mvug
Post by Willie Alberty
strings. It lays out the text in a series of arbitrarily-shaped
text
Post by mvug
Post by Willie Alberty
containers, automatically moving from one to the next as each is
filled. Rectangular and circular containers will be provided, but
you
Post by mvug
Post by Willie Alberty
can easily create your own custom containers for other shapes or
to
Post by mvug
Post by Willie Alberty
flow text around images.
Multi-column output is as easy as creating two adjacent text
containers on the same page. Text containers don't even need to be
on
Post by mvug
Post by Willie Alberty
the same PDF page: you can start your text in a small container
on
Post by mvug
Post by Willie Alberty
page 1, then continue it on page 17.
Callback functions are provided to allow you to create text
additional
Post by mvug
Post by Willie Alberty
containers as needed, which can be located on new pages. This is
useful if you do not know the length of the text you are drawing
ahead
Post by mvug
Post by Willie Alberty
of time, or if you want to adapt your layout on-the-fly.
You can also use multiple layout managers on a single page,
allowing
Post by mvug
Post by Willie Alberty
you to create complex multi-page flows for a series of text
runs.
Post by mvug
Post by Willie Alberty
These can be useful for creating page headers and footers, or
for
Post by mvug
Post by Willie Alberty
running stories side-by-side in a newsletter.
Drawing Model
-------------
Three new primitive geometry classes allow you to precisely
define
Post by mvug
Post by Willie Alberty
drawing locations, sizes, and regions. They also provide a host
of
Post by mvug
Post by Willie Alberty
convenience functions allowing for calculation, conversion,
- Point: x and y coordinate
- Size: height and width
- Rectangle: combination of a point and size
PDF pages are drawn using a series of content streams, which
contain
Post by mvug
Post by Willie Alberty
all of the low-level drawing commands. Zend_Pdf_Page currently
manages
Post by mvug
Post by Willie Alberty
its own private content stream.
We've separated content streams from Zend_Pdf_Page, promoting them
to
Post by mvug
Post by Willie Alberty
first-class objects. This allows us to use these content streams
as
Post by mvug
Post by Willie Alberty
templates that can be reused again and again, either on a single
page
Post by mvug
Post by Willie Alberty
or multiple pages. Templates can greatly reduce PDF file sizes
and
Post by mvug
Post by Willie Alberty
improve memory use and performance in PDF viewer applications.
It is also possible to create a template from any page in an
existing
Post by mvug
Post by Willie Alberty
PDF document. You can then reuse the template in the same PDF, or
even
Post by mvug
Post by Willie Alberty
copy it to a new PDF document, where you can use it as a page
background, draw it as a thumbnail, perform imposition, etc.
Performance and Memory
----------------------
We've also made numerous performance and memory-usage
improvements
Post by mvug
Post by Willie Alberty
throughout the code. Most data is now lazily-loaded, allowing you
to
Post by mvug
Post by Willie Alberty
manipulate very large documents, containing thousands or millions
of
Post by mvug
Post by Willie Alberty
individual objects or hundreds of megabytes or gigabytes in size,
with
Post by mvug
Post by Willie Alberty
a very low memory footprint.
Future Enhancements
-------------------
All of this new functionality lays the groundwork for even more
- Top-to-bottom line sweep for Asian scripts
- Bi-directional text (for Hebrew, Arabic, and others)
- Bulleted and numbered text lists
- HTML-inspired inline text tables
- Inline attachments (for example, images that flow with text)
- Advanced typographic features such as tracking, pairwise
kerning,
Post by mvug
Post by Willie Alberty
ligatures, etc.
- Hyphenation support
- Glyph substitution using fallback fonts
- and more...
Again, we're really excited to be sharing this code with the
community. We'll be creating the proposals for the various
components
Post by mvug
Post by Willie Alberty
in the coming weeks and announcing them on the fw-formats list
when
Post by mvug
Post by Willie Alberty
they're ready for review. In the meantime, if you have any
high-level
Post by mvug
Post by Willie Alberty
questions, please don't hesitate to ask.
--
Willie Alberty, Owner
Spenlen Media
http://www.spenlen.com/
______________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 -
Celebridades - Música - Esportes
Loading...