This article describes how to install Phoca PDF component in Joomla! 1.6, 1.7, 2.5

 

In Joomla! 2.5 the PDF feature is not more included. If you want to create PDF documents from your articles, you should install Phoca PDF component and Phoca PDF Content plugin. However, it''s not as easy as it looks. Joomla! 2.5 does not include links to PDF in article views and there is no event which allows you to insert PDF link through some plugin. It means, some of core Joomla! 2.5 content files needs to be edited (using system plugin to find place in Joomla! 2.5 where to insert PDF link was depreciated because of low efficiency).

 

Download

Download Phoca PDF component from the Phoca PDF download site. You get a ZIP file. Login into your Joomla! administration site and follow these steps:

Go to Extension Manager (Extensions - Extension Manager - Install). You can:

  • Upload Package File - select the Phoca PDF component ZIP file from your disc and click onUpload File & Install.
  • Install from Directory - you can upload Phoca PDF component ZIP file into your server directory and install it from this directory
  • Install from URL - you can install it from another URL.

After the ZIP package will be uploaded you get a screen with follwing options:

 

Full Install

Select this method in case you want to use Phoca PDF Content Plugin. Phoca PDF Installation process will try to do the following actions:
  • Install core Phoca PDF component
  • Backup the following core Joomla! content files:
    • components/com_content/views/article/tmpl/default.php to components/com_content/views/article/tmpl/default.php.bak
    • components/com_content/views/category/tmpl/blog_item.php to components/com_content/views/category/tmpl/blog_item.php.bak
    • components/com_content/views/featured/tmpl/default_item.php to components/com_content/views/featured/tmpl/default_item.php.bak
  • Copy the following Phoca PDF content and document files:
    • from administrator/components/com_phocapdf/files/pdf/pdf.php to libraries/joomla/document/pdf/pdf.php
    • from administrator/components/com_phocapdf/files/com_content/views/article/view.pdf.php to components/com_content/views/article/view.pdf.php
    • from administrator/components/com_phocapdf/files/com_content/views/article/tmpl/default.php to components/com_content/views/article/tmpl/default.php
    • from administrator/components/com_phocapdf/files/com_content/views/category/tmpl/blog_item.php to components/com_content/views/category/tmpl/blog_item.php
    • from administrator/components/com_phocapdf/files/com_content/views/featured/tmpl/default_item.php to
      components/com_content/views/featured/tmpl/default_item.php
This method will overwrite core Joomla! files. This can be successfull only if permissions and ownership of files and folders are set correctly on the server. After installation, please check if the above listed files were created on your server. If you are using template which overrides content view files, you need to modify the content files in your template by yourself. See the following installation method (Custom Install). It is recommended to backup your Joomla! files before using this method.

 

 

 

Custom Install

Select this method in case you don''t want to use Phoca PDF Content Plugin or you will modify core Joomla! content files by yourself e.g. because your template overrides content view files. No modifications will be done to core Joomla! files. Phoca PDF Installation process will try to do the following actions
  • Install core Phoca PDF component
  • Copy the following Phoca PDF document files:
    • from administrator/components/com_phocapdf/files/pdf/pdf.php to libraries/joomla/document/pdf/pdf.php
    • from administrator/components/com_phocapdf/files/com_content/views/article/view.pdf.php to components/com_content/views/article/view.pdf.php
If you will use this method and you want to use Phoca PDF content plugin, you need to customize the core Joomla! content files.

 

Customizing Joomla! core content files:

 

Edit the following file (if your template overrides Joomla! content files, you need to edit this file in your template''s folder):

components/com_content/views/article/tmpl/default.php

line cca 34

 

FROM:

<?php if ($params->get(''access-edit'') ||  $params->get(''show_print_icon'') || $params->get(''show_email_icon'')) : ?>
<ul class="actions">
<?php if (!$this->print) : ?>

TO:

<?php$phocaPDF = false;if (JPluginHelper::isEnabled(''phocapdf'', ''content'')) {
include_once(JPATH_ADMINISTRATOR.DS.''components''.DS.''com_phocapdf''.DS.''helpers''.DS.''phocapdf.php'');
$phocaPDF = PhocaPDFHelper::getPhocaPDFContentIcon($this->item, $params);
}?>
<?php if ($params->get(''access-edit'') || $params->get(''show_print_icon'') || $params->get(''show_email_icon'') || $phocaPDF) : ?>
<ul class="actions">
<?php echo $phocaPDF; ?>
<?php if (!$this->print) : ?>

 

Edit the following files (if your template overrides Joomla! content files, you need to edit these files in your template''s folder):

components/com_content/views/category/tmpl/blog_item.php

components/com_content/views/featured/tmpl/default_item.php

line cca 31

 

FROM:

<?php if ($params->get(''show_print_icon'') || $params->get(''show_email_icon'') || $canEdit) : ?>
<ul class="actions">
<?php if ($params->get(''show_print_icon'')) : ?>

TO:

<?php$phocaPDF = false;if (JPluginHelper::isEnabled(''phocapdf'', ''content'')) {
include_once(JPATH_ADMINISTRATOR.DS.''components''.DS.''com_phocapdf''.DS.''helpers''.DS.''phocapdf.php'');
$phocaPDF = PhocaPDFHelper::getPhocaPDFContentIcon($this->item, $params);}?>
<?php if ($params->get(''show_print_icon'') || $params->get(''show_email_icon'') || $canEdit || $phocaPDF) : ?>
<ul class="actions">
<?php echo $phocaPDF; ?>
<?php if ($params->get(''show_print_icon'')) : ?>

 

 

Upgrade

Select this method in case you want to upgrade core Phoca PDF component files. No modifications will be done to core Joomla! files.

 

 
None of the above displayed methods installs Phoca PDF Content Plugin. Phoca PDF Content Plugin needs to be installed and enabled in Plug-in Manger.

 

Be aware, some of templates override content files, it means, the files to display content (article) are not used from com_content area but from template area. For example:

components/com_content/views/article/tmpl/default.php

is stored in:

templates/your-template/html/com_content/article/default.php

Then the template file needs to be overriden.

 

Using Joomla! cache system plugin

If Joomla! cache system plugin is enabled on your site, don''t set PDF Destination parameter to value: Inline Browser in Phoca PDF Content Plugin parameters. Use Inline Browser (Popup) instead (which is default). Cache system plugin does not create correct cache file if Inline Browser parameter is set.