Cannot create or view PDF

I have just performed a brand new install on Ubuntu 22.04 via docker compose.
After creating an invoice, if I click the “View PDF” , it gets an error
XMLHttpRequest error.
The preview of the PDF in the window shows the PDF file.

The env file has
APP_DEBUG=false
REQUIRE_HTTPS=false
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES=‘*’

Hi,

It may help to change to the hosted_ninja PDF generator.

Being very new to this app, what PDF generator can be used and how would it be set up?

Using hosted_ninja doesn’t require any setup

Do you mean the Free Plan at https://invoicing.co/
or
Download the app from https://www.invoiceninja.org/

In your .env file above you have this line:

PDF_GENERATOR=snappdf

I’m suggesting you change it to:

PDF_GENERATOR=hosted_ninja

Okay.
will try that tomorrow morning.

Thanks l

Thanks, that now works.

Now to compare this with Crater to see which one suits my circumstances best.

Hey Hillel, I did change it to hosted_ninja in the .env. However I am still facing the same XMLHttpRequest error. These are my settings

APP_DEBUG=“false”
REQUIRE_HTTPS=“false”
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=hosted_ninja
TRUSTED_PROXIES=‘*’

is there anything wrong with these settings?

I’d expect REQUIRE_HTTPS to be true, is the app running behind SSL?

No I don’t have a domain to get SSL, I am learning to use invoice_ninja so I have just deployed it in ec2

It may explain the error.

Will be able to do a workaround instead of getting a domain? Since it is for testing purposes?

If you can post the error details from the network tab in the browser it may help.


Here you go, also i tried to self sign certificate, didnt work.

@david do you know a way to workaround this without a valid cert?

User a .test domain ie. ninja.test

1 Like

I am not able to comprehend

can you be more specific @david

Which http port are you connecting over? 80 or 443?

From the limited screen shots it looks like you are connecting over https but the backend is configured on http

If you are running on a public network, and do not want to use a proper domain, then move this installation to a local environment where you can by pass all of this.

You can use the .test tld locally and you will not have any of these issues.