User Tools

Site Tools


PDF Printouts


PDF printouts are meant to give customers printable version of their Gift Certificates. PDFs are stored as template settings in ugiftcert_pdf table in Magento database. Before you can apply certain look to your PDFs you need to create it in Admin > Customers > Gift Certificates > PDF Printout Settings


When you navigate to above page, you will be presented with a list of all currently existing pdf templates. By default Gift Certificate module comes with 4 pre-generated templates. Use them as starting points for your custom templates.


When you click “Add New” button you will be taken to PDF template details page.

Settings have 4 sections:

  1. Main PDF Settings
  2. Page Settings
  3. Text Settings
  4. Image Settings

Bellow we'll explain what each of those settings mean.

How PDF templates work

Constructing PDF templates in Magento is very different from say CMS page content writing. PDF page is not structured document as HTML page is and nesting elements in one another or styling them is not as easy.

PDF pages have fixed sizes, they are meant to be printed and must have dimensions. All elements on the page are placed using absolute coordinates which begin from lower left corner of the page. If you set x and y of an element to be 0, the element will be displayed in page bottom left corner.

It is up to template editor to figure out exact placement of each editable element.

Text can be displayed in different fonts, sizes and color. To simplify template configuration, we set font per page. There are few choices that are guaranteed to work on all PDF readers - Courier, Helvetica and Times New Roman. Any other font has to be provided as separate file and be embedded in PDF file to guarantee its correct display. This also increases PDF file size, and in case of Unicode fonts, that can be many MegaBytes. Therefore we only allow 3 common options plus the font that Magento bundles (the one used for invoices)

Size and color can be changed per text setting.

Each template can have multiple number of images assigned to it.

Note that more images assign the larger result file will be.

Last image added will be top most.


Available settings:

Main PDF Settings


Here you set template title, font to use and which units you will be using in the rest of the settings.

Units can be “Points” (default in PDF measurement), “Inches”(72 points in an Inch) and “Millimeters”(2.83 points in a millimeter)

Page Settings


In page settings you set page dimensions. You use units defined in Main settings and just set the values for page size here.

Text Settings


Text settings are used to display various Gift Certificate properties in PDF template. You can see which properties you can use in the drop-down menu under Field column. Template column allows to wrap field content in some other text and apply some basic formatting. For the purpose sprintf syntax is used.

Next columns are used to position content on the PDF file, refer to How PDF templates work for details.

Font size, here you set font size in points. NOTE Font size is always in points regardless of what you have chosen in Main settings for unit.

Color, set required color here. Clicking in the box should enable simple color chooser to help with selecting correct color.

Images Settings

In image settings, you can upload images you want to use either as background or details for the template. You can use multiple images. Images will be stacked in order they are added.

As for text, you can set position of the image but you can also set its width and height, so that it fits in the template. Note that too big difference with actual image dimensions will cause deterioration of the image. Try to use images with 150 and more PPI.

Applying templates

Templates can be assigned either to specific certificates or to products.

Gift Certificate

To assign it to certificate, open the certificate, scroll towards end of “Gift Certificate Info” sections and in “Certificate PDF Template” select template you want to use.

Gift Certificate Template


To assign template to product, open product for editing, navigate to GC Settings section, and in “GC PDF Template” select template you want to use.


Giftcert Pro add-on

In Gift Certificate Pro add on, you will also have “Personalization options” table where you can add combinations of PDF and Email templates to be presented to customer to choose from.

ugiftcert-2/pdfprintout.txt · by jamby77