PDFCrowd Blog

Product updates, tips & tricks

We have released a new version of our Save as PDF and Save as Image WordPress plugins.

New:

  • Added the "URL Lookup" option to select how to retrieve URLs for Conversion Mode-URL.
  • Added the "Diagnostics" option that displays useful info about the button settings.

Changed:

  • Minor text update in the plugin settings.

Fixed:

  • Minor fix in the plugin settings.

In this tutorial you will learn how to add header and footer to PDF created by Pdfcrowd API. We will use PHP for illustrative purposes, but the code would be essentially the same in all languages the API supports.

Step-by-Step Example

Let's start with instantiating the Pdfcrowd client and setting the page format to Letter:

$client = new \Pdfcrowd\HtmlToPdfClient($user_name, $api_key);
$client->setPageSize('Letter');

The next step is to design our HTML footer and header. We can use special CSS classes that will be expanded as follows:

  • pdfcrowd-page-count - the total page count of printed pages
  • pdfcrowd-page-number - the current page number
  • pdfcrowd-source-url - the source URL of the main document

We have released a new version of our Save as PDF and Save as Image WordPress plugins.

New:

  • Added the "Indicator Timeout" option to set the maximum time the progress indicator is displayed. 

Changed:

  • The "HTTP Auth User Name", "HTTP Auth Password", "Cookies", "Fail On Main URL Error" and "Fail On Any URL Error" options are taken into account in the Upload conversion mode.
  • Minor source code optimization.

Fixed:

  • Fixed saving of the plugin options.
  • Minor fix of the progress indicator.

New:

We added new methods to identify HTML documents stored in the input archive. Use these methods if the input archive contains multiple HTML documents.

We added new methods related to PDF metadata.

   HTML to PDF:

   PDF to PDF supports the same methods as HTML to PDF:

Fixed:

  • [Ruby] Fixed handling of UTF-8 options and binary input files.

New:

  • Added the "Extract Meta Tags" option, which extracts meta information from the input HTML document and adds it to the output PDF.
  • Added the "Hide parameters" button in the plugin admin settings.

Changes:

  • The default value of "Conversion Mode" has changed to "URL".