Fatal Error: Call... when trying to export PDF
  • absukabsuk December 2009

    Hi,

    after installing the latest update to simleinvoice i am now getting the error msg below when i click on the export PDF of an invoice, any ideas

    Fatal error: Call to a member function node_type() on a non-object in /home/user/websites/billing.sample.co.uk/library/pdf/box.php on line 91

    cheers

    Abs

  • justinjustin January 2010

    hey abs

    think you posted this again - is this resolved for you ?

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • gourgour September 2010

    I get this errror with brand new install, iow, no old-config file issue?

  • justinjustin September 2010

    hey gour and abs

    note sure what the fix is for this one as relating to a 3rd party library we use
    - you may want to search on the html2pdf forum: http://www.tufat.com/s_html2ps_html2pdf.htm

    let us know who you go

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • gourgour September 2010


    note sure what the fix is for this one as relating to a 3rd party library we use
    - you may want to search on the html2pdf forum: http://www.tufat.com/s_html2ps_html2pdf.htm


    OK. We'll try and report back...

    Otoh, I excuse myself for complaining about the lack of bug tracker :-( -- there is one on Google code, but I'm curious whether you prefer opening tickets there or reporting here in the forums?

  • justinjustin September 2010

    re bugs
    - best is to post here in the forum

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • gourgour September 2010


    @justin
    :


    let us know who you go


    So, I did some research about this html2pdf-related error..It's not at all strange and it seems that the problem is not valid XML document.

    I've also asked in #php about it and got handful of useful tips...

    1)
    and googles homepage isnt xml, its html5, so domdocument's loadxml is
    correctly choking on the sgml content


    so I suggest not to recommend users to try with www.google.com...

    2)

    the DOM errors are simple to suppress, just use libxml_use_internal_errors(true); before processing the document,it'll make php's DOM error silently instead


    and

    So fix your XML they all look like errors i've come to expect from html2pdf the DOM errors there are more or less unrelated, your issue is that fatal error calling e_type(), which means your document contains structure that html2pdf cant handle either find a new version of html2pdf, ask their support / forums / etc, or convert to a different pdf generator library ;)


    Don't know if the above could be helpful?

    3) When I ask about the alternatives, I got following reply:

    im using html2ps atm and it works great


    and when I noted that, while evaluating some alternatives of SI, many invoicing apps have problems with Unicode, the reply was:

    not sure on unicode support, but all the others i tried were pathetic
    at even supporting basic html, let alone unicode heh


    All in all, SI is great app and it's a pity to depend on broken pdf-generating lib.

    I did some research and here are two solutions I've found:

    a) wkhtmltopdf script (http://code.google.com/p/wkhtmltopdf/) and

    b) mPDF (http://mpdf.bpm1.com/)

    I've tried last stable version 4.5 (actually, there is 4.6 update which I did not try), but there were problems with Croatian characters: šŠ đĐ čČ ćĆ žŽ.

    However, I've tried 5.0beta where everything works perfectly.

    OK, it was not thorough test of mPDF's Unicode capability, but I seriously recommend to take a look at it and consider adding support for it.



  • gourgour September 2010

    a) wkhtmltopdf script (http://code.google.com/p/wkhtmltopdf/)


    I've built wkhtmltox lib and php-extension (http://github.com/mreiferson/php-wkhtmltox) which is displayed in phpinfo.

    However, loading test script gives 500 error, but runningwkhtmltopdf works even with www.google.pdf. ;)

    Please, test (while I debug php bindings)!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories