No PDF live view and unable to download PDF

Hello

For some reason, I am unable to get a live view or download PDF’s anymore. This only happened when I tried to switch to the React version. It gave me a white screen with nothing loading, I then ran this command from another topic (Enabling React results in a blank screen)
UPDATE accounts SET set_react_as_default_ap = 0; and I was back to the Flutter app. However since then, no PDF options work.

Below is a snip of console log I get from the time the application loads.

I have cleared cache as well when reloading.

Snip of .env file as well
image

Hi,

Is the APP_URL value correct in the .env file?

  • If it contains /index.php it usually means mod_rewrite needs to be enabled
  • If it contains /public it means the /public folder should be assigned as the web root instead

Hi @hillel

This is the value:

> APP_URL="https://admin.jtrict.co.za/ninja/public"

I suggest checking that mod_rewrite is enabled and mapping /public as the web root.

mod rewrite is enabled, and I made the public_html/admin/ninja/public to be the web root.
But now I get this error

Making the public_html/admin the root again fixes it.

Once you set /public as the web root you’ll need to update the APP_URL value to remove /public

I have done that, the application loads but the PDF isn’t working still :frowning:

What error are you seeing in the browser console?

When trying to view an invoice, it gives me this error
500: cURL error 28: Failed to connect to pdf.invoicing.co port 443 after 127444 ms: Couldn’t connect to server (see libcurl - Error Codes) for https://pdf.invoicing.co/api/

Are you able to reach this URL: https://pdf.invoicing.co

Yes I am

Even using the react app, it tells me “Something went wrong” when trying to view / download a PDF

@david do you have any suggestions?

It really strange because it was working perfectly fine until I tried to switch to React and when that displayed a white screen, I used your SQL command to get it back to Flutter and then the PDF’s stopped working…

Hi @hillel and @david , I was doing some testing around…

While in debug mode, when I set the PDF_GENERATOR on the .env file

to snappdf, i get the below error

image

When it is set to phantom, i get the below error

image

When it is set to hosted_ninja, i get the below error

are you able to test your server connectivity to https://pdf.invoicing.co?

For SnapPDF it may help to run:

vendor/bin/snappdf download

Hi @david

This is my php script to test connectivity to https://pdf.invoicing.co

When the file is in this location, it works and is able to connect

image
image

However when the file is in the ninja folder, it isn’t able to connect


image

So it seems some config is wrong when in the ninja folder…
Does that shed any light on where the error could be ?

@hillel I am unable to run that command as this is a shared hosted site…

I think you want to put that file in the public/ dir, not the root one.

Hi @david

Connectivity is a success in the public dir