Page 1 of 1
rendering DirectPHP output
Posted: 10 Aug 2012, 08:44
by AndyR
Hello,
Is there any way to get PhocaPHP to render the output of a page created with DirectPHP? it's a pretty simple set of tables I'm generating from an external database so actually generating the PDF shouldn't be a problem, but PhocaPDF currently just outputs the php code on the page instead.
From looking through the forum it seems some customisation might be needed, with either a custom plugin or editing the PhocaPDF code. I just wondered if anyone had already done anything similar & might be able to give me a few pointers.
Thanks.
Re: rendering DirectPHP output
Posted: 14 Aug 2012, 21:25
by Jan
Hi, which Joomla! version you are running. Since 2.5 Phoca PDF can render plugin output (needs to be enabled in plugin parameters) but of course it is PDF, not HTML, so it is limited.
Jan
Re: rendering DirectPHP output
Posted: 01 Dec 2013, 05:37
by tmcdougle
Jan, when I enable the parameter in Phoca PDF "Display Plugin Code" to YES, the page is blank. When parameter is disabled, page show static article text, but not the Jumi PHP output.
I'm using Joomla 2.5. Please help,
Tony
Re: rendering DirectPHP output
Posted: 01 Dec 2013, 22:39
by Jan
Hi, then it means, the plugin outputs some code which cannot be managed by PDF - in such case:
a) you need to disable the plugin for PDF
b) or you can try to enable php error reporting and check what can be wrong (but for this, PHP, server error reporting and TCPDF needs to be checked)
Jan
Re: rendering DirectPHP output
Posted: 01 Dec 2013, 23:59
by tmcdougle
Hi Jan,
What do you mean, "the plugin outputs some code which cannot be managed by PDF"? What do you mean, "a) you need to disable the plugin for PDF"?
I disabled Jumi and installed DirectPHP but with the same results. I am adding a simple echo command (dropped <> so it would show the php code in the forum):
?php
echo 'stuff';
?
The text "stuff" shows up in the article. But when I create the PDF using PhocaPDF, either the article text is created in the PDF without "stuff" or the PDF is blank with only a header and footer, depending whether "Display Plugin Code" is set to Yes or No in "Phoca PDF - Content" plugin.
Has anyone tested Jumi or DirectPHP to generate dynamic content in an article and then tried to create a PDF from the article using PhocaPDF?
Thank you for your help,
Tony
Re: rendering DirectPHP output
Posted: 03 Dec 2013, 18:04
by Jan
Hi, as you can read on Phoca PDF site, PDF is not like HTML (both are different types of document - one for the dynamic screen, second mostly for printing or fixed screen with fixed measurements) ... The basics of html to pdf is a text, PDF can somehow work with some html tags and with some very basic css attributes (PDF is rendered by TCPDF class) - if the PDF gets text, mostly the one problem can be memory - lenght of text - if it gets html - then there can be a lot of problems (while translating html parts to PDF parts) - if it gets HTML and CSS, mostly some really eays formatted text can be transformed.
I don't know what code jumi or directphp produces but if the code is some difficult code (full featured html and css) it can get problems while transforming such code - so the plugin output needs to be tested and if possible the plugin output needs to be simplified ... As written in Phoca PDF documentation - displaying plugin code is an experimental function and if it will work or not, it always depends on the part which produces the output (in this case the plugin produces the output - the easier output the better)