Search

Is there a way to hook into the system in such a way that data is made available in a context where FPDF could be used to generate a PDF which is then sent to the user?

I know that you can generate PDFs using XSL:FO (Formatting Objects). I haven’t tried this, but from what I can gather you transform your content into a specific XML format (FO) which is then parsed by a PDF-generation tool such as Apache FOP to create the file.

However I think Apache FOP requires a few Java components to be installed which might be tricky.

An extension can subscribe to a delegate in the frontend that grabs the source XML and the rendered HTML of a page when it has been built. Therefore you could attempt to use FPDF or HTMLDoc to parse this content and build the PDF this way — either stepping through the XML yourself and building the PDF line by line, or by shoving the full rendered HTML into the script and seeing how the PDF creator renders it.

An example of this is the Firebug Profiler extension which subscribes to a couple of frontend delegates (FrontendOutputPreGenerate and FrontendOutputPostGenerate) and uses the XML and HTML from there.

In a lot of cases where we have looked into this, it has ended up to be far, far quicker to just use some nice print stylesheets. Unless you’re doing some crazy formatting or layout, then you’re in a world of pain…

This project looks promising: dompdf

There already is a thread on it here, with dompdf as the most simple solution, and a tutorial.

Well remembered, I had forgotten about this. For reference here are two forum threads discussing PDF creation:

So it seems that while on paper XSLT can be used to create PDFs, it’s not a trivial thing to set up.

Given that Symphony is XSLt capable, I was hoping that it had some built-in support for document publishing solutions (using XSL-FO), but it seems as though Symphony is really designed to be a solution for creating websites, rather than as a document publishing. In my case, I'm looking for a solution for keeping a repository of technical documents that I can output to various formats (PDF, HTML, HTML Help, etc.).

For pdf maybe this will help you: https://github.com/jonmifsud/urltopdf/tree/mpdf

@rraleigh plenaforma has pointed to you a repo I use to generate PDF documents with Symphony. What we tend to use is HTML to PDF conversion using libraries such as mpdf. I'm not sure if that is what you are exactly after, but technically using XSLT we can have different templates for the same data allowing you to create multiple outputs.

I have never used XSL-FO or ventured into it but technically symphony should be able to do it, then we can plug the output (through an extension) with an xsl-fo processor which should be able to take care of the rest.

i used, phantom js to create a pdf, based on a custom formated html page

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