PDF view is not working

Passed couple of days I’ve been trying to run invoice ninja on a local machine but it didn’t work due to errors after errors. So in the end I download the latest release and build it as a laravel app. That seem to do the job but now I am having a new issue. The PDF previews are not working.

Hey there!

Thanks for reporting this back to us. Can you please check your logs?

You can find them in: storage/logs/laravel.log file.

Thanks!

Hey ben,
here are the logs:

Um, I don’t see any errors there. Can you check if PDFs are generated fine?

You should be able to find them in public/storage/xxxx/xxxx/invoices.

Thanks!

yeah there is a pdf file but when I open it, it says Format Error: Not a PDF or corrupted.

All right, I need to know what you use to generate your PDFs.

Can you tell me the output for this (execute in the root of Invoice Ninja directory):

cat .env | grep PHANTOM

Here is the output

PHANTOMJS_PDF_GENERATION=true
PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address'
PHANTOMJS_SECRET=secret
PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs

One problem could be that Invoice Ninja isn’t using the public domain and second, that demo key is overloaded for the day.

Please read our docs on this:

https://invoiceninja.github.io/selfhost.html#phantom-js

I have phantom js installed on my machine and binary link pasted in the env file. Shouldn’t that be taking care of pdf generation?