Forums / Developer / PDF Export

PDF Export

Author Message

Anita H

Friday 09 January 2009 2:06:15 am

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

Jérôme Vieilledent

Wednesday 28 January 2009 1: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

Anita H

Sunday 01 February 2009 6:21:49 am

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

Franck Michaux

Saturday 07 February 2009 5:26:22 am

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

Jérôme Vieilledent

Saturday 07 February 2009 6:38:59 am

Bonjour Franck :-)

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.

Softriva .com

Saturday 11 July 2009 12:55:19 pm

Hello,

Do you know if it supports unicode (utf8)?

Thx

Jérôme Vieilledent

Saturday 11 July 2009 1: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

SEBBANE Alexandre

Sunday 12 July 2009 5:12:38 am

Hello

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

Paris, France

Anita H

Thursday 12 November 2009 5:36:55 am

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

Sylvain Gogel

Friday 13 November 2009 12: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?

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Karnichi Mohamed

Saturday 14 November 2009 7:40:08 am

"

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" ?

http://www.amiralweb.com Certified eZPublish Expert

Sylvain Gogel

Saturday 14 November 2009 12: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

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Karnichi Mohamed

Saturday 14 November 2009 4:36:35 pm

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 ?

http://www.amiralweb.com Certified eZPublish Expert