PDF Phantom JS not working


It worked in the beginning but it stopped whithout any explanation.
In the log of “laraval.log” I can see this message.

production.ERROR: There was an error generating the PDF with Phantom JS {“exception”:"[object] (App\Exceptions\PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /home/public_html/invoice/app/Utils/PhantomJS/Phantom.php:150)

Thanks for your help.


Are you using the anonymous key? It may help to create an account.


Be careful in editor, because PDF Preview functionality after every change refreshes and take credit from daily amount*. I got bamboozled by this too.

*anonymous key ~ 100, free account ~ 500, credits refreshes every hour by some amount (500/24 I guess)

1 Like

That’s a good point. FYI… we plan to add an option to hide the preview.

1 Like

I dont think I did a 100 pdf in less than an hour. But I will create a key.
That said it is the morning after and still have error messages about the PDF.


I owe you guys an apology. As soon I created a free api key and added it to my .env it worked.

im using the free API key for 500 PDFs per day for a while now and i think that they dont calcutale like 100 PDFs =100PDFs, they remove the number of PDFs from your daily allocation depending on how much time or how much bandwidth or size of your PDF, IM NOT SURE WHICH COMBINATION IF NOT ONLY 1 APPLIES, i have actually seen that they can remove 28 from your daily allocation after you have previewed just 1 PDF, may anyone who knows better correct me here.

Remember: When creating an invoice you will see the preview of the invoice being updated with every tiny little change you make, a second or two after you stop typing. You can see the updating at the top end of the preview (the blue, moving slider). Every such update counts towards your allowance.

To be honest. The 500 can go very quick when you try to write an invoice.
Is it possible to disable the preview or only have show on command when writing an invoice ?


We plan to add an option to disable the live preview.

From Phantomjs Cloud:

The Free Plan provides a Daily Subscription of 0.05 Credits. Using an average Page Cost of 2 seconds and 50Kb, this equals 500 Pages/Day. If each page you request takes more time/data, then you will get fewer than 500 Pages/Day. If your pages take less time/data, then you will get more than 500 Pages/Day.

Thanks that helped me! :+1:

Thank you so much for that Clarification, i kind of knew iw works that way but dont know the correct way to put it, ONE THIN I HAVE DONE TO VERIFY AND SEE FOR MYSELF HOW THAT AFFECTS MY PDF DAILY LALLOCATIONWAS:
i logged into my free account at Phantomjs website, and i press the refresh button, i then go to my invoice ninja and view an invoice, i then switch tabs and check the old number then refresh and compare the number deducted, THIS GAVE ME A BIT OF CAUTIOUSNESS NOW THAT I KNOW HOW MUCH IS REMOVED EACH TIME I VIEW.
does a Free alternative exist for V5 self hosted whitelabel? i have read about SnapPDF but then im using cPanel, or should open a new topic on this?


If you have a white label license, you can use hosted_ninja

This is fast, and gives you unlimited PDFs

1 Like

For some reason. I am getting this screen when trying to view the invoice. I can’t download the invoice and clients can’t see the invoice as well. It’s like the pdf is corrupt:

thank you for your responce, How do i go about using the Hosted Ninja? and does it have additional cost? if yes its how much.

You can use it by setting hosted_ninja as the PDF renderer.

It’s free to use if you’ve purchased a white label license.