Phoca PDF not working

Phoca PDF - creating PDF documents in Joomla! CMS
edelweb
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 17 Jul 2024, 12:03

Phoca PDF not working

Post by edelweb »

Hello,

I followed the guide I am pasting below to start using Phoca PDF. after installing the component and the content plugin, I couldn't see any "Download PDF" button, so I created one in a custom module as indicated in the guide using this code:

<a href="<?php echo JRoute::_('index.php?option=com_phocapdf&view=article&id=' . $article->id); ?>" class="btn btn-primary">Download PDF</a>

Unfortunately, the module with the button doesn't work=> https://gobrand.ch/parametric/de/test-pdf

I also added the same code inside this article=> https://gobrand.ch/parametric/de/wissen ... es-devices
but it also doesn't work.

I appreciate your help and support and would gladly donate if the project works. Thanks!

Best regards,
Rich
................................
Here is the guide I followed:

It looks like you found the GitHub repository for the TCPDF library for Joomla, but you're right that it doesn't provide a straightforward Joomla extension installer. Instead, it provides the library itself, which you can integrate into your Joomla site.

However, if you prefer using a Joomla extension, here’s a more streamlined approach to integrating TCPDF into Joomla:
Using a Joomla Extension for PDF Generation

Install a Joomla PDF Plugin:
Instead of directly using the TCPDF library, you can use a Joomla extension that already integrates TCPDF or similar functionality.
Phoca PDF is a commonly used extension for this purpose. You can download Phoca PDF directly from the Phoca website.

Install Phoca PDF:
Download the extension package from the Phoca website.
Go to your Joomla Administrator panel.
Navigate to Extensions > Manage > Install.
Upload the downloaded package and install it.

Configure Phoca PDF:
Once installed, go to Components > Phoca PDF to configure the settings.
Set up the default font, header, footer, and other parameters according to your needs.
Ensure that the content plugin is enabled to customize what gets included in the PDF.

Add a "Download PDF" Button:
To add a "Download PDF" button, you can use the following approach:

Adding the Button via Module:

Create a Custom HTML Module:
Go to Extensions > Modules > New.
Select Custom from the list.
Add the following HTML code in the editor:

html

<a href="<?php echo JRoute::_('index.php?option=com_phocapdf&view=article&id=' . $article->id); ?>" class="btn btn-primary">Download PDF</a>

Assign this module to a suitable position on your site (e.g., sidebar, top, bottom).
Publish the module.

Adding the Button Directly in the Template:

Edit the Template Files:
Navigate to templates/your_template_name.
Edit the template files where you want the button to appear (typically index.php or default.php of your article view).

Add the Button Code:
Add the following PHP code snippet to generate the "Download PDF" button:

php

<a href="<?php echo JRoute::_('index.php?option=com_phocapdf&view=article&id=' . $this->item->id); ?>" class="btn btn-primary">Download PDF</a>
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48287
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca PDF not working

Post by Jan »

Hi, did you try to install the system plugin which tries to add this button to core articles?

Jan
If you find Phoca extensions useful, please support the project
edelweb
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 17 Jul 2024, 12:03

Re: Phoca PDF not working

Post by edelweb »

Hi Jan, yes I did => Phoca PDF System Plugin (J5), but I have no clue how to make it work.
I'll be happy to support the project financially. I can send you a login to the backend (from outside the forum) if needed.
Thanks for your support.
Rich
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48287
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca PDF not working

Post by Jan »

Hi, there is no specific options for the system plugin, just install it and enable it and the button should be displayed for the article view. It works for standard templates but in case the template make some specific override, then it is hard to get the info about where to add the button and in such case, the template override needs to be edited. :idea:

Jan
If you find Phoca extensions useful, please support the project
edelweb
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 17 Jul 2024, 12:03

Re: Phoca PDF not working

Post by edelweb »

Hi Jan, Phoca PDF work in the Joomla standard template an not in mine. That's OK for now, this is a good plugin.
I do not see my logo in the header on the PDF though. Is that pending when you receive my PayPal contribution to the project?
Thanks for your feedback.
Rich
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48287
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca PDF not working

Post by Jan »

Hi, sorry, I don't understand? If the logo is not displayed in the header, check if the path to the logo is correct in header options. Check if the logo is image which is supported to be displayed in PDF.

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