Skip to main content

Via PDF Generator Component

The PDF Generator component provides a flexible and user-friendly way to automate PDF-related tasks, directly within the Joomla backend. These automations allow you to automatically generate, update, or manage PDFs based on specific actions performed on your content, helping to ensure that your documents are always up to date without manual intervention.

Creating a New Automation

  1. Log in to your website's admin panel.
  2. In the admin panel, navigate to the Components menu and select PDF Generator.
  3. In the dropdown menu, click on Automations to access the automations management section.
  4. Click on New to begin creating a new automation.

Automation Details

When creating an automation, you’ll need to complete the following fields:

  • Title (Required): Enter a descriptive name for the automation. This will help you easily identify the automation's purpose within the list.
  • Task (Required): Select the task that will trigger the automation. You can choose from the following options:
    • After Saving Content: Triggered after content is saved in Joomla (e.g., when a new article is created or an existing one is updated).
    • After Changing Content State: Triggered when the content's state (such as published, unpublished, archived) changes.
    • After Deleting Content: Triggered when content is deleted.
  • Action (Required): Choose the action that the automation will perform when the selected task is triggered. The available actions depend on the task selected (more options may be added in the future):
    • For "After Saving Content":
      • Create or Update File: Automatically generates a new PDF file or updates any existing files based on the saved content. This ensures that your PDFs are always synchronized with the latest content changes.
    • For "After Changing Content State":
      • Change File State: Updates the state of the associated PDF file(s) to match the new content state. For example, if an article is unpublished, the corresponding PDF(s) will also be unpublished.
    • For "After Deleting Content":
      • Remove File: Deletes the PDF file(s) associated with the content that was removed, ensuring that no outdated or unnecessary files remain in your system.
warning

Whenever a file is unpublished, it is automatically removed from any catalogs in which it is used. However, please note that this action does not automatically regenerate the catalog. To ensure the catalog reflects these changes, you may need to set up a scheduled task or use the force catalog (re)generation option in your automation ( see details below).

Fine-Tuning the Automation

In addition to the basic fields like Title, Task, and Action, you will need to fine-tune your automation with additional options that allow you to control what content is affected, how the PDF files are generated, and when certain actions are triggered.

These fields provide flexibility and are essential for tailoring automations to your site's specific needs. Here are the options:

  • Data Type (Required): Choose the data type based on the support plugin you are using:
    • Joomla: Choose this option if you want the automation to apply to standard Joomla content (articles).
    • FLEXIcontent: Choose this option if you are using the FLEXIcontent extension. This allows you to automate tasks related to FLEXIcontent types such as movies, blog posts, or other custom types.
  • Content Type (Required): This option allows you to narrow down the automation to specific content types or categories within your chosen data type:
    • For Joomla: You can select a specific category to which the automation will apply, or choose "All" to apply the automation to all content categories across the entire site.
    • For FLEXIcontent: You can select a specific FLEXIcontent type (e.g., "Movie", "Blog Post", or any other custom type) that the automation will affect. This enables more granular control over which content triggers the automation.
  • Template: Here, you select the template that will be used to generate or locate the PDF file(s). The template determines the design and structure of the PDF. You can choose from any templates you have set up in the PDF Generator component, compatible with the chosen data and content type.
  • Force Catalog (Re)generation: This option forces the automation to regenerate the entire catalog of PDFs related to the selected content type, even if some files already exist. Be cautious when using this option, especially if your catalog includes a large number of files, as it may cause performance issues.
warning

Regenerating a large catalog can be resource-intensive and may impact your site's performance, particularly if executed frequently or during high-traffic periods. If you're automating tasks that involve many files, consider using a scheduled task instead of forcing regeneration within the automation. Scheduled tasks can help distribute the load more efficiently over time, ensuring that your site remains responsive.

Also, be aware that any catalogs related to the target file(s) will be impacted by your automation. If a file belongs to multiple catalogs, and you choose to force catalog (re)generation, all of the associated catalogs will be affected. This can result in a significant increase in processing time and load, depending on the number of catalogs involved. Make sure to carefully assess the potential impact before using this option, especially in complex or large-scale setups.

Additional Fields for "Create or Update File" Action

When you select the "Create or Update File" action in your automation, several additional fields become available. These fields allow you to customize the PDF generation process further and tailor the resulting files to meet specific requirements. Below are the options specific to this action:

  • Only if Published: Enable this option if you only want the automation to create or update PDF files for content that is currently published. If the content is unpublished, the automation will not trigger the creation or update of any associated files. This helps ensure that only publicly visible content generates corresponding PDFs.
  • Set as Default File: When creating a file, you have the option to set it as the default file. This feature comes into play when you want to display a download button in the frontend of your website, typically achieved using a module. If you use the "autoload file" option in the module, the default file will be automatically retrieved and displayed when multiple files are associated with the content being viewed. By default, if no other file was found for the associated content (if applicable) the file will be marked as default file.
  • Pagination: Decide whether you want to include pagination in your PDF file.
  • Header: Select a header template to include at the beginning of your PDF file.
  • Header Height: Specify the height of the header section in your PDF file. This option allows you to control the space reserved for header content.
  • Footer: Choose a footer template to append at the end of your PDF file.
  • Footer Height: Set the height of the footer section in your PDF file. Similar to the header height, this option provides control over the footer space.
  • (Re)generate File: This option forces the automation to regenerate the file even if it already exists. Enabling this ensures that any updates or changes to the content or template are reflected in the PDF file. However, use this option with caution in scenarios where there are many files, as frequent regeneration could lead to performance issues.
  • Add to Catalog: Enable this option if you want the newly created or updated file to be added to a catalog. Once enabled, additional catalog-related options will appear to fine-tune how and where the file is added within the catalog.
  • Catalog: When the Add to Catalog option is enabled, you must specify which catalog the file should be added to. Select the appropriate catalog from the list of existing catalogs. If a catalog is not specified, the file will not be added.
  • File Order: This field allows you to specify the order of the file within the selected catalog. You can leave this field blank to add the file to the end of the catalog, or you can specify the position where the file should be inserted by selecting another file from the catalog. If a file is selected, the new file will be inserted before the chosen file.

Viewing Automation Execution History

After setting up automations in the PDF Generator component, you can monitor their execution status through the List View. This feature provides additional information about each automation's execution, helping you track performance and troubleshoot any issues that may arise.

Accessing the List View

  1. Log in to your Joomla admin panel.
  2. Navigate to the Components menu and select PDF Generator.
  3. Click on Automations in the dropdown menu to access the automations management section.
  4. In the automations list, you will see a table displaying all your created automations.

Information in the List View

The List View includes several columns with details about each automation's execution. The following columns provide key information:

  • Last Execution Date: This column shows the date and time when the automation was last executed. It helps you keep track of when the automation last ran and can be useful for monitoring its regular operation.
  • Executed By: This column displays the user or process that initiated the last execution of the automation. Knowing who executed the automation can assist in auditing and troubleshooting any issues.
  • Success: This column indicates the result of the automation execution:
    • Yes: The automation completed successfully without any issues.
    • No: The automation failed to complete successfully. This may require further investigation to resolve.
    • Partial: The automation partially succeeded but encountered some issues during execution. Some steps of the automation may not have been completed as intended. Review the detailed logs or messages for more information on what went wrong.

Troubleshooting and Actions

If an automation shows a status of No or Partial:

  • Review Logs: Check the detailed logs or error messages associated with the automation to identify any problems or failures.
  • Verify Configuration: Ensure that the automation is configured correctly and that all required fields and options are properly set.
  • Re-run the Automation: You may need to manually re-run the automation to correct any issues or ensure that all steps are completed successfully.

By regularly monitoring the List View, you can efficiently manage and troubleshoot your automations, ensuring that your PDF generation processes run smoothly.

Use Cases

The automation features of the PDF Generator component for Joomla can streamline a variety of tasks related to PDF document creation and management. Here are some practical use cases that demonstrate how you can leverage these features to optimize your workflow:

Automatic PDF Generation for New Content

Scenario: You run a news website where articles are frequently published. You want each new article to automatically generate a corresponding PDF for readers who prefer offline access.

How to Set It Up:

  • Task: After Saving Content
  • Action: Create or Update File
  • Data Type: Joomla
  • Content Type: All
  • Template: Select the appropriate article template
  • Pagination: Yes
  • Header/Footer: Optional, based on your design preferences

Result: Every time a new article is saved, a PDF file is created automatically, ensuring that your content is always available in both digital and printable formats.

Update PDF When Content State Changes

Scenario: You manage a catalog of products on your e-commerce site. Whenever a product’s availability status changes (e.g., from in-stock to out-of-stock), you need to reflect this change in the product’s PDF brochure.

How to Set It Up:

  • Task: After Changing Content State
  • Action: Change File State
  • Data Type: Joomla
  • Content Type: Specific Product Categories
  • Template: Product Brochure Template
  • Force Catalog (Re)generation: Yes (or remember to (re)generate your catalog)

Result: The corresponding file’s state is updated to match the product’s new availability status, keeping your catalogs current without manual intervention.

Remove PDF for Deleted Content

Scenario: You have a membership site with downloadable resources. When a resource is removed from the site, you want to ensure that the related PDF file is also deleted to prevent access to outdated materials.

How to Set It Up:

  • Task: After Deleting Content
  • Action: Remove File
  • Data Type: Joomla
  • Content Type: Resources Category

Result: When a resource is deleted, its associated PDF file is also removed, helping you maintain a clean and accurate set of downloadable files.

Force Catalog Regeneration

Scenario: You maintain a large catalog of PDFs related to various content types. You frequently update the catalog and need to ensure that the entire catalog is refreshed to include recent changes.

How to Set It Up:

  • Task: After Saving Content
  • Action: Create or Update File
  • Data Type: Joomla or FLEXIcontent
  • Content Type: All Categories or Specific Types
  • Template: Category/Type Template
  • Force Catalog (Re)generation: Yes

Result: The automation forces the entire catalog to regenerate every time content is saved, ensuring that all PDFs and catalog entries are updated with the latest information. Be mindful of performance impacts on large catalogs.

Default File for Display Module

Scenario: You use a frontend module to display downloadable files for your users. You want one specific file to be set as the default, ensuring it is prominently featured in the module’s download options.

How to Set It Up:

  • Task: After Saving Content
  • Action: Create or Update File
  • Data Type: Joomla
  • Content Type: Specific Article or Category
  • Template: Specific Article or Category Template
  • Set as Default File: Yes

Result: The newly created or updated PDF file is set as the default, making it automatically selected and displayed in your frontend module, enhancing user experience.

The PDF Generator component offers powerful automation features to streamline PDF creation, updates, and management based on various content-related triggers. By configuring automations, you can ensure your PDFs are always synchronized with your content, whether it's creating new files, updating existing ones, or managing file states and catalogs.

To further enhance your automation capabilities and manage more complex scenarios, consider incorporating Joomla Scheduled Tasks into your workflow. Scheduled tasks allow for greater control and flexibility in executing automations at set intervals, ensuring that your PDF processes remain efficient and timely.

In the next section, we will explore how to use Joomla Scheduled Tasks for advanced automation, helping you maximize the potential of your PDF generation and management processes.