Tag Archives: pdf layout

  • HTML2PDF User manual - Table element setup

    Posted on July 24, 2012 by ext4mage

    Table element setup

    In this step you setup a product table. The first screen you will see, is a list of all the tables that exist, you are now able to edit one of them or make a new table from scratch.

    If you will make a new from an existing, open the old and change Title and click Save As

    General – element information

    Either way you choose the first screen you will see is the one below; here you setup the general stuff about the table in hand. HTML2PDF User manual - edit table general info

    Field description:

    • Table style – general style elements the use in whole table
    • Header style – style elements that will be added to the header of each column
    • Even product row style – style elements that will be used in even rows in the table
    • Odd product row style – style elements that will be used in odd rows in the table
     

    Using cellspacing and borders in you tables can conflict, so if the borders are missing cellspacing could be the sinner. In this case use cellpadding instead.

     

    The row style will be implemented on the <tr> object, so write you style with that in mind

     

    Table columns

    The next thing you want to setup in your table is the different column. There is no limit in the module of how many columns that you can have.

    On each column you have to decide how the different product type information shall be shown. The 4 types of product types can be handled like described in this table:

    Default Bundle Downloadable Virtual
    Do not show X X X
    Use default format X X
    Use custom format X X X X
     

    The screen for setting up the column is as below HTML2PDF User manual - edit table column

    Field description:

    • Custom style – general style elements for this column
    • Width – the width of the column in percent
    • Sort order – in which order this column shall be shown, from left to right
    • XX product format – how to show the product type, see the table above
    • Product format – the content of the column for the product, html code can be used.
    • Option format – if product has options this is the content for options, html code can be used
    • Bundle itemsgroup format – bundle product have groups of item, this field set how that should be shown, html code can be used
    • Bundle item format – the content to be shown with each product item in the bundle group, html code can be used.
     
     
     

    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, pdf layout, manual

  • HTML2PDF User manual - Text element setup

    Posted on July 24, 2012 by ext4mage

    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

  • HTML2PDF User manual - Template setup

    Posted on July 24, 2012 by ext4mage

    Template setup

    This is the master of the HTML2PDF module; here you collect the different elements into the final template used for printing the PDF.

    When you press print in the different screen in Magento, then the active template based on type and store is selected. If no templates is present for the PDF type and store the default Magento PDF layout will be chosen. Are there multiple templates which are matching, the template to be chosen random.

    First screen you will see when editing a template is the general tap, here you setup main information about the template in hand.

    HTML2PDF User manual - edit general part of template element

    Field description:

    • Type – select the type of print the template should be applied to, can be Order, Invoice, Shipment and Credit Memo.
    • Store view – Select the stores that this template shall be active for
    • Number of cross-sell items – Is the number of cross-sell items that should be collected, still only the ones defined in the cross-sell text element will be shown
    • Active from – Set an date from which this template should be used, can be empty
    • Active to – Set a date until which this template should be used, can be empty
     

    In the next tab you select the text and table elements that should be used in this templateHTML2PDF User manual - edit the text element used in template

    The last tab contains information about the general style and setup of the template in hand. HTML2PDF User manual - edit the style of the template element

    It is still possible to set a different font, font-size and color within the single text element. But not all font-types are supported.

     
     
     

    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, pdf layout, manual

  • HTML2PDF User manual - Example explained

    Posted on July 24, 2012 by ext4mage

    Example explained

    In the HTML2PDF module when just installed is examples of templates. Below is the example for the invoice template’s main text, here you can see that both variables and formatting are used. Make notice of the way tables are used in the examples, if you would do the same with div or similar it would not work. Use the templates as inspiration or as the base of you own templates, just use save as function so the original is not overwritten. HTML2PDF User manual - example of a PDF template

    Notice the way cellspacing and cellpadding is used in the inline tables of the example. Use this way and not style padding or margin elements

    Below is the invoice example in a PDF reader, here you can see all the variables change to real values.

    HTML2PDF User manual - the PDF from the example template

     
     
     

    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, pdf layout, manual

  • HTML2PDF User manual - Development mode

    Posted on July 24, 2012 by ext4mage

    Development mode

    The HTML2PDF module has an inbuilt function to set it in development mode this is very useful when making a template. You set the module into development mode in system settings.

    Be aware that development mode affects the entire module, so it is not possible to print any PDF’s in this mode. Alternative you can also set the module to inactive, so Magento PDF’s are used, and then use the preview function in the template screen.

    When in development mode the code breaks, and prints the templates information and html directly to the screen. The first thing you see is a long list of text like the on below, it contains 2 types of print-out.

    • The first Variable in template is the variable function being performed, you can see the variable code and then the Magento code that is translated into, and finally the real value it produces.
    • Second is the inline code, here you see the code being processed after all variables have been translated into real values. The next line is the html code after the processing, this is the code that will be used in to PDF generator

    HTML2PDF User manual - development mode printout

    If it is still not showing in the PDF as in the development mode print-out, then check the html code to see if anything here is wrong

    Last in the print-out the header, main and footer text is printed out in html. This is the final html code that is being sent to the PDF generator.

    HTML2PDF User manual - development mode printout all

    If everything is looking fine in the development print-out, but not showing up in the PDF then check the html is well-formatted. Even if you are missing an end </b> can break the PDF generator.

     
     
     

    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, pdf layout, manual, debugging

  • Put a background image on the pdf

    Posted on May 23, 2012 by ext4mage

    Want to have an image as the background of the PDF

    If you want to set an image as the background of the complete PDF, this can be done by doing it this way. First of be clear that this will overwrite the header function.

    In the file lib/ext4magehtml2pdf/ext4magehtml2pdf.php find the method Header() and put in the code below

    $this->SetAutoPageBreak(false);
    $img_file = Mage::getBaseDir('media') . DS . 'wysiwyg' . DS . 'briefpapier.jpg';
    $this->Image($img_file, 0, 0, 210, 297, '', '', '', 2, 300, '', false, false, 0);
    $this->setPageMark();
    $this->SetAutoPageBreak(true, 30);
    

    Related product:
      HTML2PDF extension


    This post was posted in Guides and was tagged with magento, design, pdf layout

  • Add a due date on the invoice pdf

    Posted on May 23, 2012 by ext4mage

    Want to add a date that is x days from invoice date to the invoice PDF

    If you have a need to print a date to your invoice, order, shipping or creditmememo PDF, that is based on a variable date and then x days in the future. This is then a solution to do this in the HTML2PDF module text element.

    Example:
    Due date (invoice date + 14 days) - you can do this like this (formatted with data medium - look in help->formatting)

    ##format_date_medium date( 'Y-m-d H:i:s' , strtotime ( '+14 day' , strtotime ('{{invoice_data_created_at}}')))##
     
     

    Related product:
      HTML2PDF extension


    This post was posted in Guides and was tagged with html2pdf, magento, design, pdf layout

7 Item(s)