eZ Community » Forums » Developer » PDF Export
expandshrink

PDF Export

PDF Export

Friday 09 January 2009 11:06:15 am - 12 replies

Hi All,

probably a stupid question yet I cannot get my head around: I'd like to offer PDF Generation for certain pages and therefore am playing around with PDF Exports in Setting.

But I just dont understand how to proceed. So, firstly, all PDF functions are marked with depreciated but I could not find a "successor", so shall I still build on the PDF functions?

Secondly, when created a PDF export what's the point? How do I re-use it, build it into the site? Could you give me a hint? an example how to implement the PDF exports into a site?

Sorry, sitting on my wires here....

Thanks
Anita

Wednesday 28 January 2009 10:28:14 pm

Hi Anita

eZPDF has been deprecated because of many problems essentially due to Unicode problems, as far as I know.
I have to generate PDF too for my project and I decided to use <b>TCPDF</b> for that (http://www.tcpdf.org). It's an open source PHP library for generating PDF files. The problem is that you cannot use the templating system to generate your PDF, you have to program it in PHP, for example with a template operator.
TCPDF supports some basic XHTML, so maybe it could be easier to template your PDF files. You can also use <b>FPDI</b> (http://www.setasign.de/products/pdf-php-solutions/fpdi/) with TCPDF to load PDF templates.

I hope this helps

Sunday 01 February 2009 3:21:49 pm

Hi Jérôme,
thanks a lot for your help. Although I hoped there might be a "ready-to-go" ez solution, I'm more than happy to have a starting point.

Will digg into it.
Thanks a lot
Anita

Saturday 07 February 2009 2:26:22 pm

Hi Jérôme,

thanks a lot for your help, but please, could you explain, how to program it in PHP with a template operator ?
Do you make sql query or do you use the template and pdf system of ezpublish ?
For example, do you get the stream of the pdf and you use it in the fpdi ?
Do you have some sample ?

thanks

Climbo

Saturday 07 February 2009 3:38:59 pm

Bonjour Franck happy.gif Emoticon

The main idea is to develop something in PHP using TCPDF or any other PHP PDF library (Zend_PDF, FPDF...). You could that by developping a module or just a simple template operator.
TCPDF supports xHTML, so it can be possible to build the PDF from within a template with a raw layout outputed with <i>application/pdf</i> mimetype (see layout.ini for that). Let's say that you have developped an operator named <i>pdf_output</i> which builds your PDF in PHP from xHTML content (see TCPDF examples at http://tcpdf.org). In your template, you can bufferize your generated HTML content with the <i>{set-block}</i> function. So all you have to do is :

{set-block variable=$myContent}
    {* Add you content here, with all your fetches, includes, etc... *}
{/set-block}
{pdf_output($myContent)}

Of course, your operator is supposed to return the PDF stream generated by TCPDF.

Saturday 11 July 2009 9:55:19 pm

Hello,

Do you know if it supports unicode (utf8)?

Thx

Saturday 11 July 2009 10:40:53 pm

Hi
TCPDF is indeed compatible with Unicode.
I also recently found a very promising and interesting extension named ParadoxPDF (http://projects.ez.no/paradoxpdf). You can use it within the template engine (just like the old eZPDF). It uses a small Java application to generate PDF from XHTML.

By the way, eZ Publish 4.2 will embed eZ Components 2009.1 which have a PDF component (through the Document component). Apparently we'll be able to use it in the template engine too. 4.2 is planned for september 29th 2009

Sunday 12 July 2009 2:12:38 pm

Hello

you can try the new extension : paradoxpdf on projects.ez.no. we use it : it's great one

Thursday 12 November 2009 2:36:55 pm

Hi There,I gotta admit I'm still not really done with my PDF generation. However, currently I'm thinking about PDF security, DRM etc., trying to answer how to secure my PDF content? e.g. from copying text and/or pictures, changing content, passing the document on etc.etc. now my questions: do you have any experience with securing PDF files generated out of your content management system? Thanks a lot Anita

Friday 13 November 2009 9:50:04 pm

Hello

you can try the new extension : paradoxpdf on projects.ez.no. we use it : it's great one

I second that paradoxpdf is a nice extension to generate pdf from content, basicaly it convert html output to pdf, so keep in mind that your html output must be valid.

Well all pages MUST be valid against it's Schema, but you know what a contributor can do with a WYSIWYG... ^_^

I cannot remember how resource angry paradox can be, anyone knows?

Saturday 14 November 2009 4:40:08 pm

Well all pages MUST be valid against it's Schema, but you know what a contributor can do with a WYSIWYG... ^_^

I cannot remember how resource angry paradox can be, anyone knows?

The content generated by ezOE (online editor) is always Valid.

If you cannot make a valid HTML pages try to use Html Tidy filter operator before passing html to paradoxpdf.

What do you mean by "I cannot remember how resource angry paradox can be" ?

Saturday 14 November 2009 9:53:00 pm

The content generated by ezOE (online editor) is always Valid.

If you cannot make a valid HTML pages try to use Html Tidy filter operator before passing html to paradoxpdf.

What do you mean by "I cannot remember how resource angry paradox can be" ?

i mean hungry, sorry for my bad english

so i mean how many CPU it consume, how much memory, does it leak? etc, i'm not sure but i think the extension embed a jetty Servlet Engine wich mean you need a jre on your env etc.. (well ezfind also require a jre)

About html validity, i'm also concerned about accessibility which is harder to acheave

Sunday 15 November 2009 1:36:35 am

If you read paradoxpdf documentation, JRE is a requirement just as for ezfind.

Unfortunately i dont have time to benchmark the application. But i will try to make one when i can.

Paradoxpdf steels the simplest way to convert ezpublish content to pdf in a linux environment. "Simplest" because you just deal with html and CSS.

To understand this just try to use TCPDF, ZendPDF or other php libs to convert html content to PDF.

What make you say that the extension embeds a jetty SE ?

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from