Jump to content

Blank PDF invoices


ffeingol

Recommended Posts

We've having a heck of a time with PDF invoices in V4.x. We're using a slightly modified version of Sparky's PDF invoice template (we just display a custom client column on the invoice).

 

If an order comes in or you save an invoice to PDF it works great. When we run invoicing or may run credit cards we get blank PDF's. If you open up one of the 'blank' PDF's and look at the properties of the PDF it says that there are 80ish pages that are .4 in x .4 in.

 

I've already tried tech support from both WHMCS and Sparky and so far no one has been able to come up with a solution so I figured asking the community just could not hurt.

 

TIA for any thoughts or suggestions.

Link to comment
Share on other sites

I was still waiting to hear back from you. As I had told you it is not the custom template at fault. There is nothing in the template that can cause small pages of .4in

 

It has to be with tcpdf.php or the way that the batch (or loop) is done or outputed.

 

More than likely the output is generated with the S command (S: return the document as a string. name is ignored.) so it could be generating too large of a string resulting in the error.

 

PHP imposes no boundary on the size of a string; the only limit is the available memory of the computer on which PHP is running. I believe that it is restricted to 1024 bytes max per line though from what I have googled. This could be a possibility.

 

A google search on "variable string length php hardening" and "tcpdf blank pages" returns some interesting reading.

Link to comment
Share on other sites

Sparky,

 

Yes, I meant no offense to your product or support (it's been great). I just posted this to see if anyone else in the community is running into the same problem.

None taken... I also would like to see this solved. I cannot replicate it but the evidence speaks for itself.

Link to comment
Share on other sites

  • 3 weeks later...

i cranked mine up to 500 MB + for testing - which still didn't help.

 

definitely not alone - theres a number of people on the forum with similar problems.

 

Mine started out as a cron memory error - Sparky initially gave me some updated files etc - and it seemed to stop the memory issue.

 

But then i found when multiple invoices were generated - the first one came out perfectly fine. all others came out as a little white square.

 

Sparky mentioned the version whmcs uses for pdf is fairly out of date. so that could be the problem.

 

But using the default invoice works fine - so im looking down the track that the template that sparky provides must use a function or technique thats causing the issues for me.

 

now just to find what hes using thats causing the issue!

Link to comment
Share on other sites

This is great to hear. Misery loves company :-)

 

We currently have our memory set to 512MB and we can crank out about 180 invoices before it blows on memory. As you say the first couple of PDF's come out fine then the small blank square. I've done quit a bit of experimenting and have not narrowed down the issue.

 

We had WHMCS support update TCPDF to the latest (at the time) version and that got us 'further' (up to the 180 ish level) of invoices but it's still not 'right'. We do 1st of the month billing and will be cranking out somewhere between 800 - 1,000 invoices per month so this is getting to be a huge issue.

 

The biggest problem is that this is almost impossible to test w/o actually running invoices. With that scenario we really only have two testing opportunities per month (when invoices run and when credit cards run). It will take a very long time to debug at that rate.

 

Thank you very much for sharing your info and please if anyone else is having this issue please chime in. WHMCS support though we were the only ones with this issue.

Link to comment
Share on other sites

yep i hear you its a pain to try and debug - at least i have the luxury of billing every day so i only have to wait generally 24 hours to test ...lol

 

now to try and find what function sparky uses that would be killing it.

 

im going to just start chopping various elements out until i find the cause with his template.

Link to comment
Share on other sites

as a note sparky i also upped the limits via php hardening config.

 

for post and get variables - to LARGE figures. my logs are not catching any error either.

 

I guess the script thinks its completed correctly.

 

But it has to be something specific to the template as the normal default template works fine.

Link to comment
Share on other sites

Hi Guys,

Just a thought... do both of you happen to have $pageformat set to "LETTER"?

 

if so try it with it set back to the default "A4"

Could explain the .4" x .4" blank page

 

EDIT:

Also one other thing to try

change 'PrintScaling' => 'AppDefault', to 'PrintScaling' => 'None',

Edited by sparky
Link to comment
Share on other sites

@sparky,

 

We are set to 'letter'. I'll let oempire try the changes first :-) If we switch to A4 it makes the invoices look a bit funny as the aspect ratio of the paper is quite different.

Lets try and rule this posibility out first and then we'll deal with the paper layout later.

Link to comment
Share on other sites

  • 3 weeks later...
sparky i started chopping vaious things out each night. to try and find a fix.

 

and when i finally removed the include call, and moved all the include data into the template it works fine. :D

I wouldnt have thought that would cause the problem!!

Could someone else please try that as well to see if it solves it on their system as well... open a ticket and I'll incorporate the included file for you in the script to try it.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated