Html generated instead PDF

Phoca PDF - creating PDF documents in Joomla! CMS
luciani
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 29 Mar 2019, 19:27

Html generated instead PDF

Post by luciani »

Hi,

I don't knwo why when I click on the pdf button the generated content is HTML instead of PDF.
I try with simple article and with the same result.
ex : http://arkeotopia.org/fr/ressources/vei ... =component
Any idea ?
(joomla 3.9.3, phoca system 3.0.6, content 3.0.6, phoca pdf 3.0.8)

Thanks for your help
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Html generated instead PDF

Post by Jan »

Hi, what happen when you disable SEF? Which format does the URL have?

Jan
If you find Phoca extensions useful, please support the project
luciani
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 29 Mar 2019, 19:27

Re: Html generated instead PDF

Post by luciani »

Hi Jan,

Thanks, I disabled "Add a suffix to the URL" to have now PDF (empty PDF but PDF).

Thanks again & regards
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Html generated instead PDF

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
luciani
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 29 Mar 2019, 19:27

Re: Html generated instead PDF

Post by luciani »

So.
When I disabled "Add a suffix to the URL" the URL to export the PDF file contains "&format=pdf"
When I activated "Add a suffix to the URL" the URL doesn't contains "&format=pdf" and the export is in HTML

So I changed the template to add this PHP instruction :
$phocaPDF = str_replace("tmpl=component", "tmpl=component&format=pdf", $phocaPDF);
It works but that does not seem to me satisfactory.
Is there a better way to do this ???
Thanks !
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Html generated instead PDF

Post by Jan »

Hi, hard to say, I don't know the function of the suffixes, what is the reason to have them, but I think to run the PDF function with suffixes, the core Joomla! must be customized, so instead of xxx.html it ads xxx.pdf. Because it just seems that the suffix function tries to remove all possible values to get only the .html suffix :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply