HTML2PDF User manual - Text element setup

Posted on July 24, 2012 by ext4mage There have been 0 comments

Text element setup

Under the text element you setup the text that you need in your final PDF. It comes in 4 types:

  • Header – the top of each PDF page
  • Footer – the bottom of each PDF page
  • Main – the general text for the PDF, this is where all you main text should go
  • Cross sell – this is the text for the cross sell element in the pdf’s

All text elements can be used in many different templates, for example can you use the same header in all types of template for all stores types. The input field for the content is a WYSIWYG editor, like the one you know from Magento CMS, and that makes the editing of the content very easy even if you do not HTML or PHP.

You can make a page-break by using the inbuilt editor function – translated into <!—pagebreak-->

Remember to include the product table variable, to tell the system where in you main text your product table should be inserted. And also include the cross_sell variable if you want to show cross sell element. HTML2PDF User manual - edit text element

Field description:

  • Type – select the type of text this is, option are header, footer and main
  • Text content – the field to type in the content. See more about using variables and formatting in the sections Using variables and Using formatting

Design your PDF with tables and not div or anything like that. The PDF generator works best with table layouts, so build like that to avoid problems. Also inline style with padding and spacing do not always have the wanted effect, so try to avoid using that.

PNG images can be used but can give performance problems – use gif or jpg images instead

Making Cross-sell text element

You can include a list of cross-sell items into your PDF. The list of products is based upon the items in the order, so the products have to have cross-sell items for anything to show. The cross-sell element is build up in paragraphs, so each section will only be shown if there is a product there.

For each product that you want to show, you will have to start with the tag {{cross_x_start}} (replace the x with product number) and end with the tag {{cross_x_end}}. This way the extension will only show everything in between the two tags if there is a product.

HTML2PDF User manual - edit cross-sell element


Under ext4mage->help you can see all the variables that can be used in the cross-sell element. In help you will only see the first 4 items in the cross-sell. You can set up in the template how many items should be collect for that specific template.

HTML2PDF User manual - cross-sell help element


The HTML2PDF extension for Magento
See more about the magento extension HTML2PDF

This post was posted in Manual and was tagged with html2pdf, magento, pdf layout, manual