Discussion:
Zend_Pdf requirements
Alexander Veremyev
2007-11-01 17:23:56 UTC
Permalink
Hi all,

I've tried to collect Zend_Pdf functionality requests and bring them into one list. It's placed in FW wiki now (http://framework.zend.com/wiki/x/45Y).

I ordered it by a priority I think items should have.

May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!


With best regards,
Alexander Veremyev.

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Holografix
2007-11-01 18:04:03 UTC
Permalink
Hi

It's just a suggestion. It would be nice to draw SVG images
(Zend_pdf_image).

Here is a link to a class that creates pdf with svg embedded:
http://www.godisaduck.com/file/svgload.zip?id=86&type=zip

Best regards
holo
Kevin McArthur
2007-11-01 19:55:43 UTC
Permalink
Moved to fw-formats as it is the correct list for this.

The traditional tact with Zend_Pdf_Image* was not to have a bunch of
external dependancies. Right now we have zzip and gd requirements, but those
will probably get factored out relatively soon. We could add svg, etc
support with various dependancies, but if we keep doing this, ZPDF will
require a _very_ custom webserver to run off-the-shelf applications, and
that could reduce the usibility of ZPDF enabled applications in the
long-run.

Another concern is that as SVG is a non-raster format, the current
Zend_Pdf_Image approach to embedding might be insufficient and a
raster-compatible approach added.

Complex questions for Zend to answer.

Kevin
----- Original Message -----
From: "Freddie Witherden" <freddie-JZsSkq+***@public.gmane.org>
To: <fw-general-***@public.gmane.org>
Sent: Thursday, November 01, 2007 10:36 AM
Subject: Re: [fw-general] Zend_Pdf requirements
Hi
Post by Holografix
It's just a suggestion. It would be nice to draw SVG images
(Zend_pdf_image).
. I (personally) think that the future is in the PHP- Cairo bindings,
which Zend_pdf could then wrap around to provide convenience functions.
Although I think it will be a while before the Cairo bindings attain
widespread usage.
Regards, Freddie.
Alexander Veremyev
2007-11-01 18:49:01 UTC
Permalink
Yeah, good idea. It already was requested at least one time.
I've just added it into the list.

With best regards,
Alexander Veremyev.
-----Original Message-----
Sent: Thursday, November 01, 2007 9:04 PM
To: Alexander Veremyev
Subject: Re: [fw-general] Zend_Pdf requirements
Hi
It's just a suggestion. It would be nice to draw SVG images
(Zend_pdf_image).
http://www.godisaduck.com/file/svgload.zip?id=86&type=zip
Best regards
holo
No virus found in this incoming message.
Checked by AVG Free Edition.
30.10.2007 18:26
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Jack Sleight
2007-11-01 19:57:34 UTC
Permalink
I've no idea about the complexity of these, or if they're even
realistic, but two features I would like to see are:

- Support for PostScript OpenType fonts
- The ability to use an already embedded font to draw new text

I'm sure I had another, but I can't remember it now... never mind.
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them into one list. It's placed in FW wiki now (http://framework.zend.com/wiki/x/45Y).
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
--
Jack
Logan Buesching
2007-11-01 20:43:17 UTC
Permalink
As far as #7 and #12, are those the same items? It would seem that #7
is just a simplified #12, and if so, is it the plan to come up with
something simple to get out there for #7 while we wait for #12 to fully
mature?

If so, then I know I had something that had most of #7 already
implemented if anyone was interested.

-Logan
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them into one list. It's placed in FW wiki now (http://framework.zend.com/wiki/x/45Y).
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Alexander Veremyev
2007-11-01 23:31:48 UTC
Permalink
-----Original Message-----
Sent: Thursday, November 01, 2007 10:56 PM
Cc: Willie Alberty
Subject: [fw-formats] moved: Re: [fw-general] Zend_Pdf requirements
Moved to fw-formats as it is the correct list for this.
The traditional tact with Zend_Pdf_Image* was not to have a bunch of
external dependancies. Right now we have zzip and gd requirements, but
those
will probably get factored out relatively soon. We could add svg, etc
support with various dependancies, but if we keep doing this, ZPDF will
require a _very_ custom webserver to run off-the-shelf applications, and
that could reduce the usibility of ZPDF enabled applications in the
long-run.
I do agree it shouldn't depend on any external library. But Cairo (or any other library) may be used to speed up implementation if it's installed.

I am not sure such optimization has high priority now, so it could be done in near future only if someone is ready to contribute to this :)
Another concern is that as SVG is a non-raster format, the current
Zend_Pdf_Image approach to embedding might be insufficient and a
raster-compatible approach added.
Fortunately, PDF itself is a vector format :)
So SVG implementation should not be based on Zend_Pdf_Resource_Image, but should be a canvas (not implemented yet) with some vector graphics inside.
PDF supports canvases internally (it's possible to apply one content stream, ex. page content, to some part of another).


With best regards,
Alexander Veremyev.
Complex questions for Zend to answer.
Kevin
----- Original Message -----
Sent: Thursday, November 01, 2007 10:36 AM
Subject: Re: [fw-general] Zend_Pdf requirements
Hi
Post by Holografix
It's just a suggestion. It would be nice to draw SVG images
(Zend_pdf_image).
msg03895.html
. I (personally) think that the future is in the PHP- Cairo bindings,
which Zend_pdf could then wrap around to provide convenience functions.
Although I think it will be a while before the Cairo bindings attain
widespread usage.
Regards, Freddie.
No virus found in this incoming message.
Checked by AVG Free Edition.
30.10.2007 18:26
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Alexander Veremyev
2007-11-01 23:32:16 UTC
Permalink
Post by Jack Sleight
I've no idea about the complexity of these, or if they're even
- Support for PostScript OpenType fonts
Yes, that would be good to have it.
Post by Jack Sleight
- The ability to use an already embedded font to draw new text
It can be done relatively easily. The only thing is that embedded fonts often don't contain full character set, but only used characters.
Just created an issue for this (ZF-2136).


With best regards,
Alexander Veremyev.

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Jack Sleight
2007-11-02 09:25:03 UTC
Permalink
One other thing. Add a setting that allows you to specify coordinates
from the top left rather than bottom left.
Post by Alexander Veremyev
Yes, that would be good to have it.
It can be done relatively easily. The only thing is that embedded fonts often don't contain full character set, but only used characters.
Just created an issue for this (ZF-2136).
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
--
Jack
Matt Paine
2007-11-04 08:04:18 UTC
Permalink
Just my two cents :)

I would like to be able to add images to pdfs that have been dynamically
generated. At the moment I create an image (imagecreatejpg()), get a
reference, draw to it, write it to a file so I can suck it into a PDF.
Then I can clean up the file.

I think this would be more streamlined if I dind't need to write the
file first (as well as working on systems that do not allow writing to
the filesystem :)



Thanx

Matt.
Alexander Veremyev
2007-11-01 23:32:21 UTC
Permalink
Yes, #7 is a simplified #12. But they may have completely different API.

So we can implement #7 early and use any appropriate implementation for this.
Another option is to separate a subset of #12 API required for #7. It may take a little bit more time, but produces only one API.

I think first way should be used only if it can be done using really trivial API. For example, if it uses only one additional method (something like drawTextExtended()).


Of course, you are welcome to contribute to it! :)

With best regards,
Alexander Veremyev.
-----Original Message-----
Sent: Thursday, November 01, 2007 11:43 PM
To: Alexander Veremyev
Subject: Re: [fw-formats] Zend_Pdf requirements
As far as #7 and #12, are those the same items? It would seem that #7
is just a simplified #12, and if so, is it the plan to come up with
something simple to get out there for #7 while we wait for #12 to fully
mature?
If so, then I know I had something that had most of #7 already
implemented if anyone was interested.
-Logan
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them
into one list. It's placed in FW wiki now
(http://framework.zend.com/wiki/x/45Y).
Post by Alexander Veremyev
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
30.10.2007 18:26
No virus found in this incoming message.
Checked by AVG Free Edition.
30.10.2007 18:26
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Logan Buesching
2007-11-27 22:25:09 UTC
Permalink
I have attached a prototype implementation for #7. Currently, I am
using this to produce a small bit of formatted text on the screen, but
nothing intensive.

This implementation creates cells. Cells can positioned to the left,
right, top, bottom or centered on the X/Y axis. The text within the
cell can be positioned left, right or centered (with future support for
justification).

--Example usage--
<?php
$pdf=new Zend_Pdf();
$pdf->pages[] =new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_ITALIC);
$pdf->pages[0]->setFont($font,12);
$cell=new Zend_Pdf_Cell($pdf->pages[0]);
//adds a cell in the upper right with "Hello World"
$cell->addText("Hello World");
$cell->write();

//creates a cell in the center of the page
$cell=new Zend_Pdf_Cell($pdf->pages[0],Zend_Pdf_Cell::POSITION_CENTER_X
| Zend_Pdf_Cell::POSITION_CENTER_Y);
//add a 1 pixel border
$cell->setBorder(1);
//align to the right
$cell->addText("The quick brown fox jumped over the lazy
dog",Zend_Pdf_Cell::ALIGN_RIGHT);
$cell->write();
?>
(I can create a slew of examples for those that want)

--Internal Workings--

When adding text to the cell, it formats it in it's private variable,
$_text. This is a multi dimensional array. The first dimension of the
array is the line number for the text in the cell.

Then, the 2nd diminsion of the line number is either a property for the
line (such as alignment, offset, or width), or a section of text for
that line (key being numerical). These properties are so that you can
have text aligned center on one line of the cell, and aligned on the
left in another line. In each section of text, there is a font, font
size, width and encoding property, with future support for color. This
is so that you can have bolded text with unbolded text in the same line.

I just recently implemented support for borders - so that's proof of
concept. Also the same for word wrapping - just finished proof of
concept code, but still need to test it better before a real release.

When adding text to the cell, it adds it to the internal variable which
gets written to the screen with a call to write().

If you feel that this is a good starting point for #7, I would gladly
sign the contributer agreement and work towards testing and stabilizing
this. Otherwise, I will just use it myself until another implementation
comes along that I can use.

-Logan
Post by Alexander Veremyev
Yes, #7 is a simplified #12. But they may have completely different API.
So we can implement #7 early and use any appropriate implementation for this.
Another option is to separate a subset of #12 API required for #7. It may take a little bit more time, but produces only one API.
I think first way should be used only if it can be done using really trivial API. For example, if it uses only one additional method (something like drawTextExtended()).
Of course, you are welcome to contribute to it! :)
With best regards,
Alexander Veremyev.
-----Original Message-----
Sent: Thursday, November 01, 2007 11:43 PM
To: Alexander Veremyev
Subject: Re: [fw-formats] Zend_Pdf requirements
As far as #7 and #12, are those the same items? It would seem that #7
is just a simplified #12, and if so, is it the plan to come up with
something simple to get out there for #7 while we wait for #12 to fully
mature?
If so, then I know I had something that had most of #7 already
implemented if anyone was interested.
-Logan
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them
into one list. It's placed in FW wiki now
(http://framework.zend.com/wiki/x/45Y).
Post by Alexander Veremyev
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
30.10.2007 18:26
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Logan Buesching
2007-11-27 22:25:27 UTC
Permalink
I have attached a prototype implementation for #7. Currently, I am
using this to produce a small bit of formatted text on the screen, but
nothing intensive.

This implementation creates cells. Cells can positioned to the left,
right, top, bottom or centered on the X/Y axis. The text within the
cell can be positioned left, right or centered (with future support for
justification).

--Example usage--
<?php
$pdf=new Zend_Pdf();
$pdf->pages[] =new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_ITALIC);
$pdf->pages[0]->setFont($font,12);
$cell=new Zend_Pdf_Cell($pdf->pages[0]);
//adds a cell in the upper left with "Hello World"
$cell->addText("Hello World");
$cell->write();

//creates a cell in the center of the page
$cell=new Zend_Pdf_Cell($pdf->pages[0],Zend_Pdf_Cell::POSITION_CENTER_X
| Zend_Pdf_Cell::POSITION_CENTER_Y);
//add a 1 pixel border
$cell->setBorder(1);
//align to the right
$cell->addText("The quick brown fox jumped over the lazy
dog",Zend_Pdf_Cell::ALIGN_RIGHT);
$cell->write();
?>
(I can create a slew of examples for those that want)

--Internal Workings--

When adding text to the cell, it formats it in it's private variable,
$_text. This is a multi dimensional array. The first dimension of the
array is the line number for the text in the cell.

Then, the 2nd diminsion of the line number is either a property for the
line (such as alignment, offset, or width), or a section of text for
that line (key being numerical). These properties are so that you can
have text aligned center on one line of the cell, and aligned on the
left in another line. In each section of text, there is a font, font
size, width and encoding property, with future support for color. This
is so that you can have bolded text with unbolded text in the same line.

I just recently implemented support for borders - so that's proof of
concept. Also the same for word wrapping - just finished proof of
concept code, but still need to test it better before a real release.

When adding text to the cell, it adds it to the internal variable which
gets written to the screen with a call to write().

If you feel that this is a good starting point for #7, I would gladly
sign the contributer agreement and work towards testing and stabilizing
this. Otherwise, I will just use it myself until another implementation
comes along that I can use.

-Logan
Post by Alexander Veremyev
Yes, #7 is a simplified #12. But they may have completely different API.
So we can implement #7 early and use any appropriate implementation for this.
Another option is to separate a subset of #12 API required for #7. It may take a little bit more time, but produces only one API.
I think first way should be used only if it can be done using really trivial API. For example, if it uses only one additional method (something like drawTextExtended()).
Of course, you are welcome to contribute to it! :)
With best regards,
Alexander Veremyev.
-----Original Message-----
Sent: Thursday, November 01, 2007 11:43 PM
To: Alexander Veremyev
Subject: Re: [fw-formats] Zend_Pdf requirements
As far as #7 and #12, are those the same items? It would seem that #7
is just a simplified #12, and if so, is it the plan to come up with
something simple to get out there for #7 while we wait for #12 to fully
mature?
If so, then I know I had something that had most of #7 already
implemented if anyone was interested.
-Logan
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them
into one list. It's placed in FW wiki now
(http://framework.zend.com/wiki/x/45Y).
Post by Alexander Veremyev
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
30.10.2007 18:26
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Logan Buesching
2007-11-27 22:27:39 UTC
Permalink
Forgot the attachment...
Post by Logan Buesching
I have attached a prototype implementation for #7. Currently, I am
using this to produce a small bit of formatted text on the screen, but
nothing intensive.
This implementation creates cells. Cells can positioned to the left,
right, top, bottom or centered on the X/Y axis. The text within the
cell can be positioned left, right or centered (with future support for
justification).
--Example usage--
<?php
$pdf=new Zend_Pdf();
$pdf->pages[] =new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_ITALIC);
$pdf->pages[0]->setFont($font,12);
$cell=new Zend_Pdf_Cell($pdf->pages[0]);
//adds a cell in the upper left with "Hello World"
$cell->addText("Hello World");
$cell->write();
//creates a cell in the center of the page
$cell=new Zend_Pdf_Cell($pdf->pages[0],Zend_Pdf_Cell::POSITION_CENTER_X
| Zend_Pdf_Cell::POSITION_CENTER_Y);
//add a 1 pixel border
$cell->setBorder(1);
//align to the right
$cell->addText("The quick brown fox jumped over the lazy
dog",Zend_Pdf_Cell::ALIGN_RIGHT);
$cell->write();
?>
(I can create a slew of examples for those that want)
--Internal Workings--
When adding text to the cell, it formats it in it's private variable,
$_text. This is a multi dimensional array. The first dimension of the
array is the line number for the text in the cell.
Then, the 2nd diminsion of the line number is either a property for the
line (such as alignment, offset, or width), or a section of text for
that line (key being numerical). These properties are so that you can
have text aligned center on one line of the cell, and aligned on the
left in another line. In each section of text, there is a font, font
size, width and encoding property, with future support for color. This
is so that you can have bolded text with unbolded text in the same line.
I just recently implemented support for borders - so that's proof of
concept. Also the same for word wrapping - just finished proof of
concept code, but still need to test it better before a real release.
When adding text to the cell, it adds it to the internal variable which
gets written to the screen with a call to write().
If you feel that this is a good starting point for #7, I would gladly
sign the contributer agreement and work towards testing and stabilizing
this. Otherwise, I will just use it myself until another implementation
comes along that I can use.
-Logan
Post by Alexander Veremyev
Yes, #7 is a simplified #12. But they may have completely different API.
So we can implement #7 early and use any appropriate implementation for this.
Another option is to separate a subset of #12 API required for #7. It may take a little bit more time, but produces only one API.
I think first way should be used only if it can be done using really trivial API. For example, if it uses only one additional method (something like drawTextExtended()).
Of course, you are welcome to contribute to it! :)
With best regards,
Alexander Veremyev.
-----Original Message-----
Sent: Thursday, November 01, 2007 11:43 PM
To: Alexander Veremyev
Subject: Re: [fw-formats] Zend_Pdf requirements
As far as #7 and #12, are those the same items? It would seem that #7
is just a simplified #12, and if so, is it the plan to come up with
something simple to get out there for #7 while we wait for #12 to fully
mature?
If so, then I know I had something that had most of #7 already
implemented if anyone was interested.
-Logan
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them
into one list. It's placed in FW wiki now
(http://framework.zend.com/wiki/x/45Y).
Post by Alexander Veremyev
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
30.10.2007 18:26
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Rick Gigger
2007-11-06 19:47:00 UTC
Permalink
I noticed that you intend to add "Full UTF-8 support". Last time I
investigated using unicode directly in pdfs I concluded that you could
only use unicode in a pdf if you also embedded a unicode font into the
pdf. This was a long time ago and it's possible I was incorrect in
that conclusion. But I am curious as to how you are planning on
implementing this. My understanding is that you have to either embed
the unicode font, or convert each bit of text to other non-unicode
encodings. I would love it if I was wrong and it was now possible to
include unicode directly in the pdf without having to embed the font.
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them
into one list. It's placed in FW wiki now (http://framework.zend.com/wiki/x/45Y
).
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Rick Gigger
2007-11-07 21:05:30 UTC
Permalink
I am currently using both R&OS PDF and FPDF. I'm going to need to add
support for both Japanese and Chinese soon. I am planning on either
updating one or both of those those two pdf engines to handle unicode
or switching over to Zend_Pdf entirely and adding in the support there
for that. I know that I can just extend FPDF to work if I need to but
I don't know if I could just extend Zend_Pdf or if I would need to
actually patch the code to Zend_Pdf itself. Of course if I could
discuss my implementation with a Zend_Pdf developer and gain
confidence that my changes could be incorporated into Zend_Pdf that
would be optimal.

Also if Zend_Pdf completes Full UTF-8 support before I do that would
be even better. Just looking for ways to share the load, if anyone
here is interested in discussing this with me please drop me a line,
on or off the list.

Thanks,

Rick
Post by Alexander Veremyev
Hi all,
I've tried to collect Zend_Pdf functionality requests and bring them
into one list. It's placed in FW wiki now (http://framework.zend.com/wiki/x/45Y
).
I ordered it by a priority I think items should have.
May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!
With best regards,
Alexander Veremyev.
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26
Loading...