ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EEI_Tcpdf plugin

October 12, 2010 1:04pm

Subscribe [6]
  • #1 / Oct 12, 2010 1:04pm

    _xammax_

    31 posts

    Hello
    I’ve update a plugin of mine (former was EE_Tcpdf), it print output in PDF (thanks to TCPDF library) on the fly directly from templates using simple HTML markup.

    Changes:

    - user guide (installation, use, etc.)
    - cache tag param
    - no more TCPDF lib. included
    - tested with TCPDF 5.8.034
    - ... more ...

    Plugin homepage (hosted on Bitbucket.org)
    Direct download
    Issues tracker

    If you have time and patience please give it a try, any feedback is really appreciated.

  • #2 / Feb 10, 2011 4:41pm

    jamestowers

    53 posts

    Hi xammax,

    I cant seem to get this to work properly, the template just seems to ignore the tags and just display a normal page. Any idea why that might be?

  • #3 / Feb 10, 2011 4:55pm

    _xammax_

    31 posts

    Hi xammax,

    I cant seem to get this to work properly, the template just seems to ignore the tags and just display a normal page. Any idea why that might be?

    Hi, do you have enabled hooks on your related file (I mean: ./system/expressionengine/config/config.php) and set the correct path of the TCPDF lib (I mean: $config[‘eei_tcpdf_lib_path’] = ‘...’)?

    Anyway I send u a PM where to find the full user guide for this addon ...

  • #4 / Feb 10, 2011 5:05pm

    jamestowers

    53 posts

    Thanks for the quick reply!
    Yes I have enabled hooks and set the path,

    I have the tcpdf library in /tcpdf and my config file is /system/expressionengine/config so i have set the path as ../tcpdf - this seems to work fine as in the control panel it says System > All seems fine.

    I have also read all the instructions and done as it says.

    :-(

  • #5 / Feb 10, 2011 6:03pm

    _xammax_

    31 posts

    Yes I have enabled hooks and set the path ...
    ... CUT ...

    Just for note: due to a tcpdf lib path misconfig, now solved.

    For future help request please use this: http://bitbucket.org/age38dev/eei_tcpdf/issues

  • #6 / May 17, 2011 2:42pm

    _xammax_

    31 posts

    Hello
    I’ve update a plugin of mine (former was EE_Tcpdf), it print output in PDF (thanks to TCPDF library) on the fly directly from templates using simple HTML markup.

    ... CUT ...

    New version 0.0.5:

    - Support for NSM Addon Updater
    - New tag “header” to disable page header
    - New tag “footer” to disable page footer
    - New tags “margin-left” and “margin-right” to specify the related values
    - New tags “allow-perms”, “allow-pswd”, “allow-owner” and “allow-mode” to create protected PDF file (see here  for more info - note: at this moment $pubkeys is not implemented)

    Download from here.
    User guide.

    Any feedback is really appreciated.

  • #7 / Sep 15, 2011 1:40pm

    DanL

    56 posts

    I’m having the same problem with this, I’ve read the user instructions several times, checked my paths, checked the config additions, but nothing happens on the page.  Is it supposed to pop-up a download dialogue with the PDF?

    All I get is a normal template render and nothing else.

  • #8 / Sep 16, 2011 5:18am

    _xammax_

    31 posts

    I’m having the same problem with this, I’ve read the user instructions several times, checked my paths, checked the config additions, but nothing happens on the page.  Is it supposed to pop-up a download dialogue with the PDF?

    All I get is a normal template render and nothing else.

    Hi DanL
    when you use the plugin you can:

    - (or) simple print out the page in pdf format on the client web browser
    - (or) force client to save the page in pdf format on his/her computer (via browser standard dialog)
    - (or) save the pdf produced on server side and then redirect the client to somewhere

    When “nothing happens” usually is due to a misconfig of the plugin requirements (hooks, path, etc.) or tcpdf library not correct installation (less common) ...

    In other terms, please (re)try to follow these steps:

    - use the latest plugin version (0.0.6) and the latest tcpdf lib.
    - go to CP > Addons > Plugins > EEI_Tcpdf and see/check if all works well (you’ll see some fonts related error here if something goes wrong)
    - double check if $config[‘eei_tcpdf_lib_path’] value is correct (must be the full phys. path where you’ve placed the tcpdf lib.) in the file expressionengine/config/config.php
    - be sure that the tcpdf lib. folder is browsable and it cache folder has RW permissions
    - double check if you have enable hooks in expressionengine/config/config.php file (I mean: $config[‘enable_hooks’] = TRUE;)
    - double check hook instructions in expressionengine/config/hooks.php - simple try to put this in the php file:

    $hook['display_override'] = array(
      'class'    => 'EEI_Tcpdf',
      'function' => 'output',
      'filename' => 'pi.eei_tcpdf.php',
      'filepath' => 'third_party/eei_tcpdf'
    );

    - set the value of 4 for the EE var $config[‘log_threshold’] ... this produce a lot of log message on EE log, so you can easy see where the problem start ...
    - write this simple code on your web template:

    <h1>hello world</h1>
    {exp:eei_tcpdf:params language="eng" title="This is the title" }

    Should works (I’ve confirm from users using from the earlier EE 2 version to the latest) ... If not, please contact me in private: I can easily help you to install and use it w/o any obbligations ...

    ps: please use this https://bitbucket.org/age38dev/eei_tcpdf/issues for future (public) issues

  • #9 / Nov 02, 2011 7:05am

    _xammax_

    31 posts

    New version available:

    - support for pdf template (via FPDI)
    - support for background image
    - support for server side file saving

    Latest version here: http://bitbucket.org/age38dev/eei_tcpdf/get/tip.zip
    Latest user guide here: http://www.age38dev.com/eei_tcpdf_userguide.html

    Any feedback is really appreciated.

  • #10 / Nov 10, 2011 5:30am

    kate1975

    11 posts

    Hi Max,

    I trying to install this too and I just followed your detailed instructions from above.

    This is what error I get.

    A PHP Error was encountered

    Severity: Warning

    Message: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set

    Filename: tcpdf/tcpdf.php

    Line Number: 7512
    TCPDF ERROR: Some data has already been output, can’t send PDF file

  • #11 / Nov 10, 2011 12:21pm

    _xammax_

    31 posts

    Hi kate1975

    This is what error I get.

    A PHP Error was encountered

    Severity: Warning

    Message: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set

    Filename: tcpdf/tcpdf.php

    Line Number: 7512

    this specific issue (safe_mode/open_basedir) is related to php settings/TCPDF lib. ...

    Now I update the user guide with a chapter named “Know limitations” with this, but let me look in deep how to solve this problem ...

    Really thank you for report this issue.

    PS: if you find other probs please post here: https://bitbucket.org/age38dev/eei_tcpdf/issues

     

  • #12 / Nov 10, 2011 1:07pm

    _xammax_

    31 posts

    This is what error I get.

    A PHP Error was encountered

    Severity: Warning

    Message: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set

    Filename: tcpdf/tcpdf.php

    Line Number: 7512

    Well, I confirm this prob. is related to safe_mode and open_basedir (for your confirmation simple google with “tcpdf safe_mode open_basedir”)

    If you can set for your php installation:


    safe_mode = Off; // sorry, just in php.ini or httpd.conf

    *** AND/OR ***

    open_basedir must not be set

    If you can’t/don’t want to do so, a very quickly (and brutal workaround) is going to tcpdf/tcpdf.php file, line 7512 and comment the istruction like this:

    // curl_setopt($cs, CURLOPT_FOLLOWLOCATION, true);

    This solve the problem.

    Thank again for put your time in this.

     

  • #13 / Nov 10, 2011 3:46pm

    kate1975

    11 posts

    I actually got it to work without any changes except my printable page got alot simpler. I stripped out all the design and left only the text. The pdf button now works great. PDF link at the bottom of the page.

    http://www.drinkyourcarbs.com/site/eat/eat/P4

    I guess I have another mystery.How can I get rid of the code at the bottom of the PDF file?


    Thanks for your great plugin!

    Kate

  • #14 / Nov 10, 2011 3:57pm

    _xammax_

    31 posts

    ... CUT ...

    I stripped out all the design and left only the text.

    ... CUT ...

    Yes, you can to do so ... but in case of more complex design please follow my instructions above (or just wait for the new version - 0.1.1 - that take care of safe_mode/open_basedir ... I’m currently work on this issue at this moment)

    I guess I have another mystery.How can I get rid of the code at the bottom of the PDF file?

    Simple avoid to put javascript code on the web template (but again: I’ll take care of this on next release)

    Thanks for your great plugin!

    Thank you too for your time & patience.

     

  • #15 / Nov 10, 2011 4:36pm

    kate1975

    11 posts

    Excellent! Thanks again.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases