Manual:How to use DjVu with MediaWiki
From MediaWiki.org
- DjVu redirects here. This page explains how MediaWiki could work with DjVu. For help page on how to create a DjVu file from a PDF, see Creating a DjVu file
Contents
How that works ?[edit | edit source]
- Manual:$wgDjvuDump - Path of the djvudump executable.
- Manual:$wgDjvuOutputExtension - File extension for the DJVU post processor output.
- Manual:$wgDjvuPostProcessor - Path of the DJVU post processor.
- Manual:$wgDjvuRenderer - Path of the ddjvu DJVU renderer.
- Manual:$wgDjvuToXML - Path of the djvutoxml executable.
- Manual:$wgDjvuTxt - Path of the djvutxt executable.
How to install on GNU/Linux[edit | edit source]
- Install DjVuLibre :
- − Download the DjVuLibre package (which includes djvudump and ddjvu files). And, in the path :
- ./configure
- make
- make install
- − Or use aptitude or Synaptic in Debian derivatives
- − Download the DjVuLibre package (which includes djvudump and ddjvu files). And, in the path :
- install netpbm package (use aptitude or Synaptic in Debian derivatives)
- Finally, add (or modify) the code lines below in the LocalSettings.php file (not in the DefaultSettings.php):
- $wgFileExtensions[] = 'djvu';
- $wgDjvuDump = "djvudump";
- $wgDjvuRenderer = "ddjvu";
- $wgDjvuTxt = "djvutxt";
- $wgDjvuPostProcessor = "ppmtojpeg";
- $wgDjvuOutputExtension = 'jpg';
- For better thumbnails quality:
- $wgDjvuPostProcessor = "ppmtojpeg -quality=100";
How to install on Win32[edit | edit source]
- Download the DjVuLibre software (which includes djvudump.exe and ddjvu.exe files).
- Install in "C:\DjVuLibre" (for example).
- Download the NetPbm complete package (which includes pnmtojpeg.exe, pnmtopng.exe, ... files).
- Install in "C:\GnuWin32\NetPbm"
- Add "C:\GnuWin32\NetPbm\bin" to the Windows PATH Environment Variable (and reboot the computer).
- Finally, add (or modify) the code lines below in the LocalSettings.php file (not in the DefaultSettings.php):
- $wgFileExtensions[] = 'djvu';
- $wgDjvuDump = 'C:/DjVuLibre/djvudump.exe';
- $wgDjvuRenderer = 'C:/DjVuLibre/ddjvu.exe';
- $wgDjvuTxt = 'C:/DjVuLibre/djvutxt.exe';
- $wgDjvuPostProcessor = 'pnmtojpeg.exe';
- $wgDjvuOutputExtension = 'jpg';
NOTES:
- PHP needs memory to create thumbnails: this means a high memory_limit (~ 128MB) in the php.ini.
How to install on OS X[edit | edit source]
- Download the DjVuLibre package
- Copy the application DjView.app into your Applications directory.
- Install netpbm
sudo port install netpbm
- Follow last step of install on GNU/Linux
Next to do[edit | edit source]
- How to install DjVuLibre, Qt and netpbm on a server.
Problems and solutions[edit | edit source]
- If you got «Error creating thumbnail: terminate called after throwing an instance of 'DJVU::GException' ppmtojpeg: EOF / read error reading magic number» when view file, increase the $wgMaxShellMemory.
- Thumbnails of DjVu-file with non-Latin name are absent in a namespace Page. If you use extension WebStore in your own wiki, then in file $IP/extensions/WebStore/404-handler.php replace next string:
-
$rel = substr( $url, strlen( $thumbBase ) + 1 ); // plus one for slash
- by
$rel = urldecode(substr( $url, strlen( $thumbBase ) + 1 )); // plus one for slash
-
Other page[edit | edit source]
See also[edit | edit source]
Language: | English • français |
---|