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

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

Postby MarFraWare » Mon Dec 07, 2015 10:24 pm

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
MarFraWare
 
Posts: 1
Joined: Mon Dec 07, 2015 10:17 pm

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

Postby Fike » Tue Apr 12, 2016 6:20 am

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
Fike
 
Posts: 79
Joined: Fri Oct 21, 2011 4:43 am


Return to General