Plans for Zend_PDF

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Plans for Zend_PDF

Markus Wolff
Hi,

since our project team is going to need to create PDF documents with
complex layouts soon and Zend_PDF does not really support hits right
now, we are considering adding support for cells and tables by ourselves.

Before we do that, I'd like to inquire if there are already plans (and
more importantly, time-tables) for adding those features to Zend_PDF
"officially".

Given that there have been quite a few patches and enhancements by other
users who also proposed these for official inclusion, I am also
wondering if Zend is currently considering one those options? If the
current patches are not being considered, it would be good to know why,
so we could work towards not repeating mistakes others have already made
and maybe be able to contribute our code?

Best wishes,
Markus
Reply | Threaded
Open this post in threaded view
|

Res: Plans for Zend_PDF

Luiz Fernando - webPROFIRE

Hi,


I support the idea of Markus.
You can count with me.
It is important the ZF team give us a direction to follow.

Best regards,
Luiz Fernando




----- Mensagem original ----
De: Markus Wolff <[hidden email]>
Para: fw-formats <[hidden email]>
Enviadas: Quinta-feira, 7 de Maio de 2009 8:51:21
Assunto: [fw-formats] Plans for Zend_PDF

Hi,

since our project team is going to need to create PDF documents with
complex layouts soon and Zend_PDF does not really support hits right
now, we are considering adding support for cells and tables by ourselves.

Before we do that, I'd like to inquire if there are already plans (and
more importantly, time-tables) for adding those features to Zend_PDF
"officially".

Given that there have been quite a few patches and enhancements by other
users who also proposed these for official inclusion, I am also
wondering if Zend is currently considering one those options? If the
current patches are not being considered, it would be good to know why,
so we could work towards not repeating mistakes others have already made
and maybe be able to contribute our code?

Best wishes,
Markus



      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: Plans for Zend_PDF

Nico Edtinger-4
In reply to this post by Markus Wolff
Markus Wolff:
> Hi,

Hi Markus!

> since our project team is going to need to create PDF documents with
> complex layouts soon and Zend_PDF does not really support hits right
> now, we are considering adding support for cells and tables by  
> ourselves.
>
> Before we do that, I'd like to inquire if there are already plans (and
> more importantly, time-tables) for adding those features to Zend_PDF
> "officially".
>
> Given that there have been quite a few patches and enhancements by  
> other
> users who also proposed these for official inclusion, I am also
> wondering if Zend is currently considering one those options? If the
> current patches are not being considered, it would be good to know  
> why,
> so we could work towards not repeating mistakes others have already  
> made
> and maybe be able to contribute our code?

IMO even if there is a big rewrite of Zend_Pdf in the feature it  
should hold us up adding API improvements and needed features. As I  
myself found it quite complicated to draw even simple text I started a  
new proposal for some enhancements: <http://framework.zend.com/wiki/x/UwDI 
 >. There has also been a proposal for Zend_Pdf_Cell <http://framework.zend.com/wiki/x/cak 
 >, but for some reason Logan Buesching didn't respond to comments.  
Maybe he could at least give us his code under the CLA to work upon.

Of course all changes done now should be made as forward compatible as  
possible, because a bigger rewrite of Zend_Pdf might happen. As long  
as we make that rewrite not to complicated, which shouldn't be that  
hard (even if it gets more modular we could keep the old methods, but  
mark the deprecated), I'm all for giving it some love.

> Best wishes,
> Markus

nico
Reply | Threaded
Open this post in threaded view
|

Re: Plans for Zend_PDF

LightflowMark-2
Hi Markus,
I did some research on this last week, as it happens, and came across a couple of links that may be useful:
The last people to try to re-write Zend_Pdf ended up spinning it off into a new project at http://www.refw.org/, I think so they could release it under LGPL  rather than a BSD license.

This appears to be abandoned, and sadly undocumented, but might contain a bunch of useful pointers.  I didn't explore it too much as it was so undocumented, but did start off life as a ZF proposal so may fit well.

The project I ended up using for this was http://www.digitaljunkies.ca/dompdf/  Development on the original has been abandoned, but recently some other people took up the code at
http://groups.google.com/group/dompdf and are discussing which direction to take it.  

I liked it because in my application, I want to be able to display a page to the user and then download a PDF of the same page; dompdf lets me do the layout exactly once, in HTML (which I already understand), and then converts it to a PDF for me.  The discussion groups suggest it has some bugs, but for my simple HTML layout it's working fine.  Reformatting this project into a ZendX module might be a practical amount of work and also a good fit for ZF, because of it's HTML-centric conceptual basis, and also provide a good synergy with the dompdf project as the new developers are really looking for help with it.  This is also under the LGPL, but given the situation of the project at the moment  I'd think now would be the ideal time to ask if they'd consider licensing it under something Zend was happy with also.

If you go this route I'd be happy to put some time into it. Attached is a view helper for DomPdf which helps it play nicely with ZFs autoloader, etc.
 ConvertToDomPdf.php

Edit: put domPdf files in Application/Library/DOMPDF/ for this view helper to work.

M




Nico Edtinger-4 wrote
Markus Wolff:
> Hi,

Hi Markus!

> since our project team is going to need to create PDF documents with
> complex layouts soon and Zend_PDF does not really support hits right
> now, we are considering adding support for cells and tables by  
> ourselves.
>
> Before we do that, I'd like to inquire if there are already plans (and
> more importantly, time-tables) for adding those features to Zend_PDF
> "officially".
>
> Given that there have been quite a few patches and enhancements by  
> other
> users who also proposed these for official inclusion, I am also
> wondering if Zend is currently considering one those options? If the
> current patches are not being considered, it would be good to know  
> why,
> so we could work towards not repeating mistakes others have already  
> made
> and maybe be able to contribute our code?

IMO even if there is a big rewrite of Zend_Pdf in the feature it  
should hold us up adding API improvements and needed features. As I  
myself found it quite complicated to draw even simple text I started a  
new proposal for some enhancements: <http://framework.zend.com/wiki/x/UwDI 
 >. There has also been a proposal for Zend_Pdf_Cell <http://framework.zend.com/wiki/x/cak 
 >, but for some reason Logan Buesching didn't respond to comments.  
Maybe he could at least give us his code under the CLA to work upon.

Of course all changes done now should be made as forward compatible as  
possible, because a bigger rewrite of Zend_Pdf might happen. As long  
as we make that rewrite not to complicated, which shouldn't be that  
hard (even if it gets more modular we could keep the old methods, but  
mark the deprecated), I'm all for giving it some love.

> Best wishes,
> Markus

nico
Reply | Threaded
Open this post in threaded view
|

Re: Plans for Zend_PDF

Markus Wolff
lightflowmark schrieb:
> Hi Markus,
> I did some research on this last week, as it happens, and came across a
> couple of links that may be useful:
> The last people to try to re-write Zend_Pdf ended up spinning it off into a
> new project at http://www.refw.org/, I think so they could release it under
> LGPL  rather than a BSD license.
[...]
> The project I ended up using for this was
> http://www.digitaljunkies.ca/dompdf/  Development on the original has been
> abandoned, but recently some other people took up the code at
> http://groups.google.com/group/dompdf and are discussing which direction to
> take it.  

Hi,

thanks for your pointers. In my special case though, using a third party
library has been discouraged by the project lead, who would like to keep
things as stricly ZF-only as possible.

If I had the free choice, I'd use TCPDF
(http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf), which
does just about everything anyone could wish for in the PDF department.

FPDF would have been a good choice, too, were it not for the fact that
it does not support UTF8, which is a requirement. There is a patch for
that, but it's unofficial.

Best wishes,
Markus
Reply | Threaded
Open this post in threaded view
|

Re: Plans for Zend_PDF

Kevin McArthur-2
In reply to this post by LightflowMark-2
For the record, refw->zpdf is still a possibility for zf 2.0 inclusion... the project is not abandoned, but rather we're working away on a fairly major changeset/guide-style documentation upgrade which may or may not meet with the zend'rs approval/timeframe. The main reason it was spun off is that so much of it had to be totally reworked, and any chance of API compatibility in the 1.x line was just not going to happen. The 2.x line might fit in better, and that door's definitely not closed.

K

lightflowmark wrote:
Hi Markus,
I did some research on this last week, as it happens, and came across a
couple of links that may be useful:
The last people to try to re-write Zend_Pdf ended up spinning it off into a
new project at http://www.refw.org/, I think so they could release it under
LGPL  rather than a BSD license.

This appears to be abandoned, and sadly undocumented, but might contain a
bunch of useful pointers.  I didn't explore it too much as it was so
undocumented, but did start off life as a ZF proposal so may fit well.

The project I ended up using for this was
http://www.digitaljunkies.ca/dompdf/  Development on the original has been
abandoned, but recently some other people took up the code at 
http://groups.google.com/group/dompdf and are discussing which direction to
take it.  

I liked it because in my application, I want to be able to display a page to
the user and then download a PDF of the same page; dompdf lets me do the
layout exactly once, in HTML (which I already understand), and then converts
it to a PDF for me.  The discussion groups suggest it has some bugs, but for
my simple HTML layout it's working fine.  Reformatting this project into a
ZendX module might be a practical amount of work and also a good fit for ZF,
because of it's HTML-centric conceptual basis, and also provide a good
synergy with the dompdf project as the new developers are really looking for
help with it.  This is also under the LGPL, but given the situation of the
project at the moment  I'd think now would be the ideal time to ask if
they'd consider licensing it under something Zend was happy with also.

If you go this route I'd be happy to put some time into it. Attached is a
view helper for DomPdf which helps it play nicely with ZFs autoloader, etc.
  http://www.nabble.com/file/p23469553/ConvertToDomPdf.php
ConvertToDomPdf.php 

M





Nico Edtinger-4 wrote:
  
Markus Wolff:
    
Hi,
      
Hi Markus!

    
since our project team is going to need to create PDF documents with
complex layouts soon and Zend_PDF does not really support hits right
now, we are considering adding support for cells and tables by  
ourselves.

Before we do that, I'd like to inquire if there are already plans (and
more importantly, time-tables) for adding those features to Zend_PDF
"officially".

Given that there have been quite a few patches and enhancements by  
other
users who also proposed these for official inclusion, I am also
wondering if Zend is currently considering one those options? If the
current patches are not being considered, it would be good to know  
why,
so we could work towards not repeating mistakes others have already  
made
and maybe be able to contribute our code?
      
IMO even if there is a big rewrite of Zend_Pdf in the feature it  
should hold us up adding API improvements and needed features. As I  
myself found it quite complicated to draw even simple text I started a  
new proposal for some enhancements: <http://framework.zend.com/wiki/x/UwDI 
 >. There has also been a proposal for Zend_Pdf_Cell
<http://framework.zend.com/wiki/x/cak 
 >, but for some reason Logan Buesching didn't respond to comments.  
Maybe he could at least give us his code under the CLA to work upon.

Of course all changes done now should be made as forward compatible as  
possible, because a bigger rewrite of Zend_Pdf might happen. As long  
as we make that rewrite not to complicated, which shouldn't be that  
hard (even if it gets more modular we could keep the old methods, but  
mark the deprecated), I'm all for giving it some love.

    
Best wishes,
Markus
      
nico


    

  

-- 

Kevin McArthur

StormTide Digital Studios Inc.
http://www.stormtide.ca

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Plans for Zend_PDF

Alexander Veremyev
In reply to this post by Markus Wolff

Hi Markus and all,

 

Sorry for the delay with response, I had to review current state of RE Framework to make decisions about Zend_Pdf future plans.

 

Some time ago Kevin and Willie (ones of Zend_Pdf authors) branched RE Framework (http://www.refw.org/) from Zend_Pdf. The goal was to have an ability to make changes which were not backward compatible with Zend_Pdf.

Plans to merge back these changes into ZF were also announced at that time (e.g. for ZF 2.0).

 

 

As I checked, RE_Pdf has good improvements in text and fonts processing.

It uses an advantage of following standards used in the printing industry. E.g. text (represented as attributed strings) may have up to 15 standard attributes set (font, font size, color, bgcolor, stroke with/color, underline style, ...).

 

Other parts of changes are some code reorganization and PDF objects processing reimplementation.

 

These "engine" updates may or may not be merged into Zend_Pdf. That's subject for discussions (I see using SplObjectStorage and using arrays instead of objects for some cases are more effective), but these changes don't affect user API.

So, functional changes may be merged back into Zend_Pdf as extension of current functionality without waiting for 2.0 ZF release, if Kevin and Willie have an ability to do this.

 

 

If you and your team have resources to work on Zend_Pdf extending, that would also be really nice.

 

I should also say that Zend_Pdf may implement different drawing approaches in the same time.

It may be an imperative approach: draw this text here (in this rectangle) using this font and following attributes (padding, alignment, color, ...).

It may be some text flow processing engine (please take a look at http://framework.zend.com/wiki/x/nI0)

It may use some markup language to prepare PDF page.

 

 

You are welcome to contribute to it!

 

 

With best regards,

   Alexander Veremyev.

 

> -----Original Message-----

> From: Markus Wolff [mailto:[hidden email]]

> Sent: Thursday, May 07, 2009 3:51 PM

> To: fw-formats

> Subject: [fw-formats] Plans for Zend_PDF

>

> Hi,

>

> since our project team is going to need to create PDF documents with

> complex layouts soon and Zend_PDF does not really support hits right

> now, we are considering adding support for cells and tables by ourselves.

>

> Before we do that, I'd like to inquire if there are already plans (and

> more importantly, time-tables) for adding those features to Zend_PDF

> "officially".

>

> Given that there have been quite a few patches and enhancements by other

> users who also proposed these for official inclusion, I am also

> wondering if Zend is currently considering one those options? If the

> current patches are not being considered, it would be good to know why,

> so we could work towards not repeating mistakes others have already made

> and maybe be able to contribute our code?

>

> Best wishes,

> Markus

 

Reply | Threaded
Open this post in threaded view
|

Re: Plans for Zend_PDF

Markus Wolff
In reply to this post by Nico Edtinger-4
Nico Edtinger schrieb:
>>> we are considering adding support for cells and tables by ourselves.
>
> What's your current status?

We did indeed implement the needed funtionality by ourselves, but the
way I see it, it's not ready for contribution as-is, as the code was
tailored more to satisfy the immediate needs than to provide a
comprehensive feature set. No modifications were made to Zend_PDF
itself, but some new classes were put on top of it instead.

Also, while it basically does the job, there are some edge-cases that
are still not being solved, IIRC particularly concerning page breaks
(tables spanning more than one page). I'm not too sure about the
details, because I was not the one who this got assigned to.

>>  As I myself found it quite complicated to draw even simple text I
>> started a new proposal for some enhancements:
>> <http://framework.zend.com/wiki/x/UwDI>.
>
> This proposal is now ready for review.
>
> I'm asking, because if you're still considering contributing we should
> coordinate our efforts.

The code is publicly viewable:

http://phprojekt.svn.sourceforge.net/viewvc/phprojekt/trunk/phprojekt/library/Phprojekt/Pdf/

And a usage example would be:

http://phprojekt.svn.sourceforge.net/viewvc/phprojekt/trunk/phprojekt/application/Minutes/Helpers/Pdf.php?revision=2079&view=markup

I don't know how much this is similar to your approach. The code
currently is licensed under LGPL, but if you can use any of it, I'm
pretty optimistic that the powers-that-be could be made to agree on
re-releasing this particular library under a different license.

CU
 Markus