eZ Community » Forums » Extensions » How to set PDF Paradox, properly
expandshrink

How to set PDF Paradox, properly

How to set PDF Paradox, properly

Friday 07 September 2012 4:51:42 pm - 1 reply

regards
Paradox install the PDF extension, but I have no idea how to properly configure, use ez 4.4.

Monday 10 September 2012 1:49:52 pm

What it is:
Its essentialy a wrapper for the Flying Saucer XHTML renderer.  so, when troubleshooting, remember to search with these terms as well as paradoxpdf since the majority off the issues are not unique to paradoxpdf, but the underlying java.

A quick overview of what is involved to get from code to pdf:

  1. Somewhere you capture your XHTML complaint markup and pass it to the paradoxpdf template operator
  2. This template operator then creates the temporary xhtml file
  3. Then java is used to process the xhtml file to a pdf
  4. The pdf file is then sent to the client
  5. Normally, the xhtml version is deleted at this step.

If you install the extension as listed in the tiny install.txt and then look at doc.txt, you should be on your way to at least troubleshooting. The default settings include a new layout for PDF and is explained in doc.txt

There is some smoke & mirrors and magic in that the original pagelayout is used and captured in a set-block to then send it to the template operator.

Java, temporary files, layout.ini, etc  - lots of pitfalls, but none of them are big in themselves.

So, to begin, I suggest the following:
Turn on debugging.  This will give you the temporary xhtml file in var/paradoxpdf.  This may be helpful in troubleshooting (like validating it online). You also get the benefit of the java backtraces in paradoxpdf.log when the whole thing goes sour.

 

paradoxpdf.ini:
[DebugSettings]
DebugPDF=enabled
Verbose=enabled

 

Oh java, where art thou?
Make sure you have your java executable set properly.

 

Start small.
Once you get over any file permissions and the java path and autolaods and acll caches being cleared, the biggest item that will get you will be how strict the java converting process is (the xhtml parser part). It really requires valid hxtml.. really.. really.

 

So, if you look at doc.txt and follow the example, and get a blank page, there are few items I would suggest:

  1. in your paradoxpdf_layout.tpl, comment out the call to the template operator and just print the content of the $xhtml variable.  This is your page as captured by set-block
  2. look at the error logs paradoxpdf.log and see if java is havin a hissy fit over something in the exported markup
  3. take the xhtml temoprary file and validate it.

Number 2 above is the most likely issue. The java backtrace is daunting at first look, but read backwards and you will find the issues eventually like:   is not a valid entity or similiar.

 

More info regarding what you can do -like embedding fonts and other nice stuff?
Search for XHTML Flying Saucer - since that's really the gem under the hood.

Jump through enough hurdles and it will work - and does a nice job
We have successful implementations on both windows and Linux including items related to features of FlyingSaucer not covered under the docs for paradoxpdf.

In the end, to get a universally workable extension that even works well with ezpublish xml blocks, we also pre-process our page with character-encoding checks, html entity replacements and a final run through xmltidy(template operators made to assist with pre-flight cleanup to keep the XHTML parser happy).
If you get some specific error messages when trying to implement it, post them.  I will have most likely already stumbled across the issue before and can at least direct you in the right direction a bit.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from