Topic on Extension talk:PdfHandler

School4schools (talkcontribs)

Have all packages installed (using AlmaLinux v8.9.0) along with poppler-utils.

Software:

MediaWiki  1.41.0
PHP        8.1.27 (fpm-fcgi)
ICU        69.1
MariaDB	   10.6.17-MariaDB
Lua        5.1.5
Pygments   2.16.1

Output "which gs convert pdfinfo pdftotext" returns:

/bin/gs
/bin/convert
/bin/pdfinfo
/bin/pdftotext

PDFs uploaded still read "0 x 0 px". However on the server, using

/pdfinfo "path/filename.pdf"

shows the file size ("612 x 79s pgs (letter)

I have run suggested maintenance scripts ("refreshImageMetadata.php -f" and "rebuildImages.php")

What am I doing wrong?

School4schools (talkcontribs)

Finally resolved this issue through many frustrations. Turns out the problem was that default paths didn't work:

$wgPdfProcessor (default = "gs")
    path to your ghostscript implementation
$wgPdfPostProcessor (default = "convert")
    path to your imagemagick convert
$wgPdfInfo (default = "pdfinfo")
    path to your pdfinfo
$wgPdftoText (default = "pdftotext")
    path to your pdftotext

I'm on Linux (cPanel) and installed ghostwriter, imagemagick via standard distro system (xpdf is another story -- contact me if you're stuck on it). It finally worked when I added paths to them in localsettings.php as per:

$wgPdfProcessor = '/usr/bin/gs';
$wgPdfPostProcessor = '/usr/bin/convert';
$wgPdfInfo = '/usr/bin/pdfinfo';
$wgPdftoText = '/usr/bin/pdftotext';

These paths are to the root directory via WHM, which is not available on a shared hosting cPanel account that has only an "account" homepage.

Please contact me if you're stuck w/ this (or xpdf-utils), as it can be very frustrating trying to figure out the assumed technical knowledge in instructions.

Reply to ""0 × 0 pixel""