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.

Johnfmarko (talkcontribs)

Yes I'm totally stuck with a similar problem. Everything looks ok (binaries there and Special:Version shows the pdfhandler extension installed). I have tried your explicit path solution but .pdf s don't display inline - with debug messages I do see that there is message to the effect that the particular pdf I am trying to display can't be displayed inline. I don't suppose you have a "test.pdf" that is guaranteed to display inline? Or an idea of why some pdfs are ineligible for display? TY!

School4schools (talkcontribs)

Wish I could help you with that. For me the problem was about the paths, which had to be set at server root and not account root. Make sure you're setting it there, and if you don't have access to server root you'll have to get help from your host. Feel free to contact me. You can find me via my user name on the www. Good luck!

Reply to ""0 × 0 pixel""