Search

I wish I found mPDF before spending 4 hours today stuffing around with TCPDF. Oh well. Look out for a new extension shortly, URL to PDF.

What's bad about TCPDF? I want to use it for an upcoming project.

I've found it's pretty finicky with the HTML and CSS it supports, much like Outlook 2007 for a comparison. mPDF looks more competent at dealing with HTML/CSS in general handling CSS3 things like gradient backgrounds as well as the usual suspects (so like working with Mail for comparison sake ;))

The fact that TCPDF is also ~27000 lines is overwhelming when there are issues. There were a couple of little tweaks I had to add to get it working in my situation.

Ah OK, thanks. I want to create the PDF directly, without HTML/CSS in between. So TCPDF should be a good solution.

Definitely, there is a heap of functionality buried in the TCPDF library. It's all documented with PHPDoc, but it takes a bit to get your bearings!

Look out for a new extension shortly, URL to PDF.

great, I'd like to implement it in Lewises CRM ensemble

If you are working on your own servers (i.e. with root privileges), you might consider installing Apache FOP to generate PDFs from XSL-FO. I tried it the other day and it doesn't look bad. Additionally, using XSL-FO feels somehow "right" to me.

micheal-e: I have FOP installed on my server, how can I configure it to work with symphony? It looks not clear to me how exactly I can use this command to serve pdf files with apache

I haven't implemented it yet (tried from the command line only), but it should be rather straightforward:

  • start by testing FOP from the command line (if you have shell access). Example calls:

    • fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf
    • fop bar.fo bar -c config/cfg.xml
  • now create an XSL-FO page in Symphony (you don't transform your XML to HTML but to XSL-FO and choose the XML page type);

  • try to use these pages with FOP from the command line;
  • if it works: call FOP from php using the exec() function
  • and if that works: build an extension which performs the exec-call and writes the resulting PDF to the desired directory

I know that is just the basic idea...

P.S.: I will implement this on a big website in the coming weeks, so I will probably have some more thoughts to share then...

Just for the record: I've been working with PrinceXML for over 4 years after strugling with XSL-FO for 3 years and it was one of the best decisions we've ever made. Switching from XSL-FO to PrinceXML probably saved us hundreds of men hours. We used it to generate product documentation (see http://bdn.backbase.com/client/documentation PDF files).

The whole XML / XHTML and CSS approach was so intuitive that we were able to create PDF files that followed the company style book in very little time.

So if you have the money, go for PrinceXML. You will be thanking yourself for it.

Does anyone know if the URL to PDF extension will work with Symphony 2.3.x? The website says no, but I'm just wondering if anyone has used it successfully. Thanks

We've used it on a 2.3.3 install yes.

We also have a fork in work that is working on 2.3.3 It uses a different PDF library, which is much lighter in weight than current implementation. Easier to style as well.

@brendo mentions mPDF at top of post.. that's the library we've swapped it out for.

Don't forgot to send through a pull request once you're done :)

@brendo was gonna neaten up the code a bit as its branched into a word doc downloader as well.. so need to pair it back a bit first.

Thanks all

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details