This documentation is specific for PDFCatalog 2.x.x branch. Documentation for the older 1.x.x branch can be found in the Old Documentation folder.

PDF Product Catalog for WooCommerce Documentation

Thank you for purchasing PDF Catalog Generator for WooCommerce. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks you!

Intro

PDF Product Catalog for WooCommerce (or PDFCatalog for short) is a WordPress/WooCommerce plugin which allows users of your WooCommerce store to download its entire product catalog in PDF (or per category) with a single click. PDF catalogs can be customized extensively via the admin panel allowing you to change templates, colors, text and visibility of elements (e.g. Price, SKUs, Variations etc). It comes with 5 PDF templates but if you want you can create your own to suit your needs with simple HTML and CSS.


Features

  • Widget for PDF Download Buttons
  • User Roles restrictions
  • (Optional) High Resolution images in PDF
  • Shortcode to add PDF Download Buttons to any Post or Page
  • WPML Support for Multilingual stores
  • 5 PDF Catalog Templates included.
  • Create your own PDF templates in HTML.
  • Create your own Header/Footer in HTML.
  • Generate per Category PDF and/or Complete Store catalog.
  • 4 pages of admin options to fine tune your catalog content and design.
  • Tested with stores with more than 1000 products.
  • Pure PHP Solution (no need to install any plugins / does not use external services).
  • Hide / Show catalog elements (e.g. SKU, descriptions, prices).
  • Optionally render shortcodes in product descriptions.
  • Upload your own logo.
  • Support for UTF8 catalogs (non-latin characters in PDF)
  • Customize catalog text.
  • New Change template via shortcode
  • Include product images in catalog.
  • Support for product variations.
  • Customize colors from Admin Panel.
  • Hyperlinks in PDF for each product
  • Caching for increased performance (catalogs are only generated once)
  • Automatic page numbering.
  • Header / Footer on each page.
  • Send PDF to browser or force download option.
  • Customise which categories appear in catalogs.
  • PDF Font Subsetting
  • JPEG Quality Settings
  • Full Documentation included.
  • Tested with WordPress 3.8, 3.8, 3.9, 4.0, 4.1 4.2 and WooCommerce 2.1.x, 2.2.x and 2.3.x

Installing

PDF Product Catalog can be installed like any other Wordpress plugin. It can either be done through the admin panel or via FTP.
  1. Open the Admin Panel and sign in (usually at http://www.yoursite.com/wp-admin/)
  2. From the sidebar pick Plugins → Add New → Upload
  3. Click Choose file and select the ZIP file of the plugin (the one you get after you unpack the file your downloaded from CodeCanyon).
  4. Activate PDFProductCatalog from the Installed Plugins page.
  • Connect via FTP to the server where your Wordpress site is hosted.
  • Browse to the wp-content/plugins/ folder.
  • Upload the whole pdfcatalog folder from the plugin package.
  • In the Wordpress admin panel, go to the Installed Plugins page and activate PDFProductCatalog.
  • Updating

    You can update to newer versions of PDFCatalog by re-installing the plugin with either of the above methods. If you have modified any of the built-in templates, first back up the templates/pdf folder in the plugin directory before re-installing. All other settings and custom templates will be preserved.



    Widget

    The quickest way to add download buttons to your site is to use the Widget. Head to Appearance -> Widgets page in your WordPress admin panel. Once you have our plugin installed you will see an extra option under Available Widgets titled PDF Catalog Download Button. Drag and drop it on one of your side bars on the right to activate it. From the same page you can change Widget settings which allows you to pick which buttons to show and their titles.


    Shortcode

    Using the PDF Catalog short code you can insert PDF download buttons in any Post or Page (or even product description) on your site. Here are some examples of the short code tags which you can customise accordingly:

    Example Tag Description
    [pdfcatalog] Will render a button with title 'Download Catalog' which will link to your store's complete PDF catalog.
    [pdfcatalog]Download our store catalog in PDF[/pdfcatalog] Will render a button with title 'Download our store catalog in PDF' which will link to your store's complete PDF catalog.
    [pdfcatalog slug="hoodies"]Download HOODIES Catalog[/pdfcatalog] Will render a button with title 'Download HOODIES Catalog' which will link to the Hoodies category catalog.
    [pdfcatalog slug="hoodies" template="basiclist"]Download HOODIES Catalog[/pdfcatalog] Will render a button with title 'Download HOODIES Catalog' which will link to the Hoodies category catalog. By using the template attribute, it will override the template chosen in the plugin's settings.
    [pdfcatalog catid="10"]Download %name% Catalog[/pdfcatalog] The title of this button contains the variable %name% which will be replaced by the name of product category with ID 10. It will also be linked to the same category's PDF Catalog. You may also use the word 'current' as an ID, the plugin will attempt to automatically detect which category is being accessed and create a button for it.
    [pdfcatalog catid="10" class="mybutton"]Download %name% Catalog[/pdfcatalog] The same as above but the button will also receive the CSS class mybutton. You can use this method to customize the look of individual buttons.
    [pdfcatalog catid="17" children="true"]Download PDF catalog for category and its children[/pdfcatalog] This shortcode generate a button which creates a single PDF containing the specified category followed by its child categories (if they exist)
    [pdfcatalog catids="17,20,30,8"]Download PDF catalog for these cool categories[/pdfcatalog] This shortcode generate a button which creates a single PDF containing all the categories specified by the catids attribute. Only the specified categories will be included (their child categories will be ignored).
    [pdfcatalog template="basiclist"]Download PDF catalog with Basic List as template[/pdfcatalog] Adding the template option overrides the template selected in the plugin's settings and uses the one specified here. The template name should match the folder name of the template.

    You can find PDFProductCatalog's options pages under the Settings menu in the Wordpress Admin Panel.
    There are 5 pages of options change: Template, Colors, Header/Footer, Categories, Cache.

    Template

    This settings page allows you to pick what and how it is presented in the PDF version of your store's catalog.

    PDF Catalog Template


    Option Description
    Template Use this option to choose a template you want to use for the PDF catalogs. There are currently 5 templates bundled with this plugin which are described below:

    • Basic Product List

      This is the most basic template. Essentially its a plain list of products similar to what you could have produced using Excel. This template is ideal for B2B stores or stores with products that don't have images (or images are not relevant to the product).


    • Thumbnail List

      This is the default template. Products are listed one per row with photo on the left side and description on the right side. It can display all fields if required.


    • 2 Column Grid

      Products are presented in rows of two with photo and description underneath.


    • 3 Column Grid

      Products are presented in rows of three with photo and description underneath.


    • 4 Column Grid

      Products are presented in rows of four with photo and description underneath.


    Render HTML

    If enabled this option will send to the user an HTML version of the catalog instead of PDF. The purpose of this is to assist template developers in debugging their templates. If you don't plan creating your own PDF Catalog Templates than leave this option unchecked at all times.


    Included Catalog Elements


    This section allows you to to toggle visibility of different catalog elements. For example if you don't want the PDF catalog to include product prices then just uncheck the Show Prices option here.

    The following options are available:


    Option Description
    Product SKU
    Prices
    Description
    Render Shortcodes If you enable this option any shortcodes found in the product descriptions will be processed. In most cases this should be left disabled especially if the shortcodes generate interactive javascript based content.
    Variations

    When this option is enabled the catalog will include a list of all variation attributes for each product.

    Category Title This option removes the category names from the top of the catalog pages.
    Product Counts The number of products in each category will be included at the end of the product list when this option is enabled.
    Header/Footer Lines When enabled, separating lines will be added between the footer and header of each PDF page.

    Paging


    Option Description
    Description Character Limit This option allows you to truncate long product descriptions to a specific number of maximum characters. Enter 0 if you want the full descriptions to be included.
    Start Category on a New Page

    This option affects the full site catalog only. It forces a new page to be added to the PDF file at the beginning of each category. It does this to avoid a new category product list starting on the same page right after the previous category's product list.


    Appearance & Colors


    Colors


    The colors settings page allows you to change colors of different elements on the PDF catalog. Use the color picker to choose your colors and keep in mind that users might want to print out your store's catalog which mean you should try to keep a good contrast between colors. You can see a screen shot of the color options below, their names are self explanatory.



    Image Settings


    Option Description
    Image Resolution

    By default PDF catalogs are using the same image resolution used by your current theme for product images. This sometimes can be too low for PDF (especially if you want to pint out the catalog). You can use this option to set it to a higher resolution. Keep in mind that, the higher the resolution the slower the process, the larger the PDF output files will be, and the more memory it will require to generate them, so be careful with this option.

    WordPress does not automatically resize old images, it only resizes them when they are first uploaded, so if you change this option you should also install an image rebuilding plugin. There are several free plugins that do this job out there but we recommend AJAX Thumbnail Rebuild since we tested it and works well.

    JPEG Quality

    This option affects the way JPEG images are compressed. The lower the value the less emphasis is given on the image quality. Higher values means better quality but larger file size.


    Header/Footer

    These settings page allow you to customize the header and footer which appears on every page of the generated PDF catalogs.

    Header and footer design can be customized using HTML templates as of version 1.1.2. Refer to the Template Customisation section of this documentation for more information.

    Option Description
    Logo Upload your own logo. Click on Choose Image to choose an image to use as a logo on the PDF catalog's header. The logo will be scaled appropriately to fit the available area. Works best with square logos but any dimensions will work.
    Title The title of the file. Appears on theh header. Defaults to #store# Catalog. The variable #store# automatically gets replaced by your store's name.
    Subheading Appears under the catalog title. You can use the variable #dategenerated# to include the last time this catalog was generated in the text.
    Bottom Text HTML text that will be added to the bottom of the catalog on the last page. Use this place to put any contact details, copyright messages etc.

    Categories & Products

    PDF Product Catalog allows you to pick which categories will be included in your store's full catalog. For example if you have categories with seasonal or clearance items you might not want to include in them in the downloaded PDF catalog. All you have to do is make sure all other categories are checked and they are not in this section. Note that all categories are unchecked by default and means that all categories will be included.

    Option Description
    Full Catalog Style

    This option affects the full catalog output. You can either pick Flat in which case categories are layed out in alphabetical order ignoring parent/child relationships between them, or Hierarchical style where categories will be grouped with their children categories in a hierarchy. Empty categories containing other categories will remain visible.


    Visibility Settings


    Option Description
    Product Visibility

    By default products which have their catalog visibility setting set to Hidden are visible in the generated PDF files. If you would like to disable this behaviour, select this option.

    Hide Out-of-stock Products

    Enable this option to remove any products that are marked out-of-stock from the PDF catalog.

    Hide Empty Categories

    Enable to hide categories which contain now products in Full Store Catalogs and Multiple Category Catalogs. Hiding empty categories might be undesirable in case you are using Hierarchical Catalog Style.

    Hide Parent Categories Products

    When this option is enabled products of categories which contain sub-categories will not be listed. This is especially useful for avoiding duplicated products in stores where products from sub-categories also exist in their parent category. To be used in conjunction with Hierarchical Full Catalog Style.

    Hide from roles

    All user roles are allowed to download and view PDF Catalogs by default. Using this setting you can pick which roles you don't want to have access to PDF files. These roles will not be able to see the PDF widgets, or any of the PDF shortcodes you used.


    Cache

    These settings affect the performance of this plugin.

    Option Description
    Force file download When a user clicks on the PDF download buttons his browser the PDF file will be opened immediately, and depending on the setup this means he will be navigating away from your store. On the other hand if you enable this option the PDF file will be sent to the user's browser as a file download and the user will be prompted to save the PDF file instead.
    Redirect to PDF File Enable this option if you have trouble downloading PDF files. Depending on your web server / PHP configuration sending the PDF file through PHP can be problematic, in that case enabling this option redirects the user to the PDF file and serves it through the web server directly.

    Intro

    Even though we included 5 PDF templates and many settings which let you customize the catalog look and feel you might want take your customisations to a whole new level by creating your own templates.

    PDF Templates are similar to WordPress Themes, they are made out of HTML mixed with special PHP tags that when execute get replaced with the content from your blog (or in this case your store products). Templates are made using simple HTML and CSS which the plugin converts to PDF on the fly. If you have experience with creating/modifying WordPress themes then you'll feel right at home - all you need to do is learn the tags that are specific to PDF Product Catalog. Catalog.

    You can keep templates separate from the plugin which will allow you to upgrade the plugin in the future without losing any of your modifications. In order to do that you must include the PDF template in your WordPress theme or child theme folder. Create a folder named pdf in your child theme's folder and add any custom PDF Templates in it. The plugin will automatically detect them and they will appear in the Template tab of its settings.


    Pre-requisites

    • Knowledge of basic HTML/CSS
    • Be comfortable with editing HTML that contains PHP tags
    • A text editor
    • A little creativity!


    Quick Start

    If you want to quickly make your own template, the easiest and quickest approach is to duplicate one of the pre-existing template folders, edit its template.php file and start making changes until you are satisfied with the results while consulting the Template Structure guide below. It will make your life a lot easier rather than starting from scratch.

    Template Structure

    Templates are located in the /templates/pdf/ sub-folder inside the plugin folder. Each template has its own folder and is made up of a number of files that are all required. A template consists of the following files:

    Filename Description
    template.php

    This file is what tells PDF Product Catalog plugin to recognise your template. It contains the title and description of the template in the following format:

    $templates['mytemplate'] = array('My Template', 'The super cool template i just created!');
    
    mytemplate is the unique identifier of your template. It is also the folder name that the template resides in. My Template is the title as it will appear in the admin panel and the next string is the description you will see in the admin panel.

    The above example will create an entry in PDF Product Catalog's admin panel like this:

    product.php

    This is the heart of your template as it describes a product as it will be shown in PDF. Two important variables are available for use in it, the $post and $product, which are references to the current WordPress WP_Post object and the WooCommerce WC_Product object associated with that post. If this sounds confusing it is easier to look at the following example:

    <table>
        <tr nobr="true">
                <td>
                    <span style="color:<?= $titleColor ?>">
                       <?= $product->get_sku(); ?>
                    </span>
                </td>
            <td>
                <a style="color:<?= $titleColor ?>" href="<?= get_permalink($post->ID); ?>">
                   <?= $post->post_title ?>
                </a>
            </td>
                <td>
                    <span style="color:<?= $priceColor ?>">
                        <?=product->get_price_html(); ?>
                    </span>
                </td>
        </tr>
    </table>
    
    

    The above code, creates a table with 3 columns for the product. On the left column it uses the function $product->get_sku() to get the product's SKU, then it uses $post->post_title to print out the post's title (which is also the product title in WooCommerce) and finally on the third column it uses $product->get_price_html() to print out the products price nicely formatted in HTML.

    All these functions are described thoroughly in WordPress and WooCommerce documentations. Its recommended you read about Wordpress WP_Post class and WooCommerce WC_Product class if you are not already familiar with them.

    As you might have also noticed some other variables are used in this file. Those are configuration settngs specific to PDF Catalog Generator and we provide a list of them here:

    Variable Type Description
    $paperColor HTML Color Page background color
    $titleColor HTML Color Product title color
    $textColor HTML Color General text color
    $priceColor HTML Color Color used for prices
    $categoryTitleColor HTML Color Used for title categories
    $hasVariations Boolean TRUE if product has variation attributes.
    $this->options->showCategoryTitle Boolean TRUE if category titles are enabled in admin panel.
    $this->options->showCategoryProductCount Boolean TRUE if product counts are enabled in admin panel.
    $this->options->showSKU Boolean TRUE if showing SKUs is enabled in admin panel.
    $this->options->showDescription Boolean TRUE if product description should be shown.
    $this->options->showPrice Boolean TRUE if product prices should be shown.

    beforeProduct.php Use can use it to add any additional formatting before the product. This file has access to the same variables as product.php.
    afterProduct.php Use can use it to add any additional formatting after the product. This file has access to the same variables as product.php.
    row.php

    This file is a container for product.php. It can be used to lay out several products in a row (or even other) formats. For example in the case of a two column grid row.php looks like this:

    <table>
        <tr>
            <td>
                <? $pdf->product(); ?>
            </td>
            <td>
                <? $pdf->product(); ?>
            </td>
        </tr>
    </table>
    

    $pdf->product() calls beforeProduct.php, product.php, afterProduct.php and then advances to the next product.

    beforeList.php This part of the template is rendered before the product listing of a category. For the full store catalog, it is rendered before each category individually. It is mainly used to print the category title, but you may also use it to add extra layout code before the new category begins (for example if you would like to have table header before the products you should put it in this file).
    afterList.php This part of the template is rendered after the product listing of a category. For the full store catalog, it is rendered after each category individually. Mainly used to print the product count under a category list. The product count can be found in the $this->productCount variable.
    header.php
    Optional
    header.php and footer.php are not required but are available for you to customise in case you want greater flexibility for your PDF catalog header and footer which appear on every page of the catalog. If any of these two files are missing from a template the default header / footer will be used instead. None of the included templates comes with a custom header / footer. The following variables are available to these template files:
    Variable Type Description
    $logo URL The URL to the logo uploaded/selected in the PDF Catalog Header settings.
    $title Text The title as set in the PDF Catalog settings.
    $subtitle Text Same as above but for subtitle.


     

    Use one of the following methods to contact us. We'll do our best to help you if you have a problem. We are also open to suggestions, feature requests and comments so if you have any please send them.


    How to get in touch

    • Using the contact form on my user page on CodeCanyon. Click here.
    • Via email to support@brainvial.com with subject PDF Product Catalog.