Error Visual on invoice

Bug targets customer billings.
Hello, since the upgrade after the v1.3.16 version from Cloudron we have this that appears if we go to a higher version.

@Waffleuncle

This is a known issue currently, to work around this in your .env file

PDF_GENERATOR=hosted_ninja

and then run /update?secret=secret from your browser to refresh the cache.

2 Likes

Thanks issue is now fixed :smiley:

I’m not following the fix. How exactly do I run “/update?secret=secret” and where do I put “PDF_GENERATOR=hosted_ninja” in the .env file?

@sparktech

There should already be a line which says PDF_GENERATOR=snappdf

you’ll want to swap snappdf with hosted_ninja

to refresh the cache, you’ll want to enter into your browser

https://yourdomain.com/update?secret=secret

After this the pdfs should start generating again.

1 Like

Hi @david any news on a fix if we want to use snappdf?

And could you give more info about using hosted_ninja in terms of security and privacy?

@Steph

The work around to continue using snappdf is to download and install chrome headless

https://gist.github.com/ipepe/94389528e2263486e53645fa0e65578b

After this, you’ll need to update a .env variable

SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable

This will make Snappdf use headless chrome (instead of chromium bundled with snap)

In regards to hosted_ninja, these are our servers which run snappdf, we have open sourced the code we use for the server here:

We don’t store anything on our side at all, we simply convert whatever URL is provided to us into a PDF

		$snappdf = new \Beganovich\Snappdf\Snappdf();

		$pdf = $snappdf
		    ->setUrl($request->input('url'))
		    ->waitBeforePrinting(100)
		    ->generate();

    	return Response::make(base64_encode($pdf), 200, [
		    'Content-Type' => 'application/pdf',
		    'Content-Disposition' => 'inline; filename="ninja.pdf"'
		]);

Thanks @david, works like a charm. And thank you also for your transparency regarding hosted-pdf :slight_smile: Keep up the good work!

1 Like