Yazi PDF preview not working

Yazi is a terminal-based file manager (TUI) that I use heavily because it’s fast and lets me navigate files and folders without needing a mouse. (…and I really dislike the OSX Finder)

Yazi can render previews for images and PDF files, but in my case, PDF previews weren’t showing up. Yazi requires Poppler for PDF previewing–and it was already installed on my system–the previews still didn’t work.

So I began debugging by running yazi --debug, which provides detailed information about your Yazi installation. Under the Dependencies section, I noticed a suspicious message:

pdftoppm      : ExitStatus(unix_wait_status(25344)),"pdftoppm version 4.0...
Continue reading “Yazi PDF preview not working”

Testing PDF creation with headless chrome and PHP

I had the task the other day to use a headless chrome to generate PDF files from websites in a PHP app.

The plan was to use chrome-php with a headless chrome to generate the PDF.

Usually you would install chrome/chromium on a linux server via apt and just run chrome from the PATH with chrome.
Since i was on shared hosting i was not sure if this was possible since i was not allowed to run apt commands.
So i tried to use Puppeteer which ships a headless chrome executable and use just this directly.
I installed Puppeteer with npm locally and uploaded the chrome executable to the shared hosting.
Puppeteer will place the headless chrome in the .cache dir in your home directory, f.e.:

~/.cache/puppeteer/chrome/linux-113.0.5672.63/chrome-linux64/chrome

Upload:

scp -r ~/.cache/puppeteer/chrome/linux-113.0.5672.63/chrome-linux64 me@sharedhosting:/usr/home/test

Continue reading “Testing PDF creation with headless chrome and PHP”