Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Live demo: print invoice -> pdf error on android mobile

Post Reply
MarFraWare
Posts: 1
Joined: Mon Dec 07, 2015 1:47 pm

Live demo: print invoice -> pdf error on android mobile

Unread post by MarFraWare »

Hello,

testing the live demo on a mobile/tablet i press the 'print invoice' on the invoice form: this result in a incorrect pdf document.
Contents of pdf is (text): <b>FPDF error:</b> Incorrect orientation:
On PC desktop i get a real correct pdf.

Android 4.2.2 and 5.1.1. Chrome and Android Explorer (popup blocker disabled)

Regards, Marcel
Fike
Posts: 79
Joined: Thu Oct 20, 2011 9:13 pm

Re: Live demo: print invoice -> pdf error on android mobile

Unread post by Fike »

I had the same issue.

I tracked the problem and I found that it was due to a double download of dynamically generated content on android devices as mentioned in this post:

https://code.google.com/p/android/issues/detail?id=1978

In this version of nuBuilder, the hash data required to create the pdf file is erased after the fisrt download call for the file. Therefore on the second download call there are no hash data available to generate the pdf file.

I was able to make it work by replacing line 20 of nurunpdf.php file from:

Code: Select all

nuRunQuery("DELETE FROM zzzsys_debug WHERE zzzsys_debug_id = ? ", array($jsonID));
to:

Code: Select all

nuRunQuery("DELETE FROM zzzsys_debug WHERE deb_added < DATE_SUB(NOW(), INTERVAL 2 DAY)");
This will keep the required hash data to create the pdf file on the database for 2 days. Of course, the disadvantage is that there will be a lot of unnecessary data stored on the database.

I hope someone finds a better solution for this problem with this information.

KInd regrads,

Fike
Post Reply