blog-banner

Change the PDF template generated by TCPDF

    TCPDF Template pdf

    Downloading PDF from a site has almost become a fashion to share some content related to the site. This information can be an e-book, certificate, catalog, letter and the guess goes on. But one of my recent projects had the feature of allowing users (only authorized users) to download a certificate.

    Print module was the ultimate choice to get this job done. But I had to make a few template level changes in this print module to have border, background color, finish works, and more to get the look of a certificate. After searching for quite some time, I have had no straightforward answer from any of the results. But was provided with a clue., them_print_pdf_tcpdf_content.

    1. /**
    2. * Implements theme_print_pdf_tcpdf_content()
    3. **/
    4. function theme_print_pdf_tcpdf_content(&$vars) {
    5.   return function_print_pdf_tcpdf_content($vars);
    6. }

    Place the above piece of code in your theme's template file, and replace them with your theme's name.  The return function should have all your styles.

    Note: The style above refers not to any CSS-related work, but to the TCPDF library. Please refer to this to know about all the styles and formatting available in TCPDF.