Extension:ElectronPdfService

The ElectronPdfService extension provides access to the Electron Service for browser-based PDF rendering. (The [https://github.com/msokk/electron-render-service Electron Service] needs to be installed separately.)

Description
The extension provides a handy way to access the [https://github.com/msokk/electron-render-service Electron Service] via a. The Electron Service provides a new rendering method for wiki-pages as alternative to the existing rendering. The huge advantage of using the Electron Service is, that the generated PDF will contain all tables as well as rendered infoboxes and other templates which was not possible with the old method. Read more on the 3>m:WMDE Technical Wishes/Tables in PDFs|background of the motivation for the extension and the service.

And here's an example: PDF for the article about Berlin.

Ubuntu 16.04.3 (Local Install)
When installing on Ubuntu Server 16.04.3 LTS, the following configuration was needed instead:

$wgElectronPdfServiceRESTbaseURL = "http://HOSTFQDN:3000/pdf?accessKey=secret&url=http://HOSTFQDN/wiki/";

The   is the Apache rewrite URL as this installation mimics the generic variation of re-writing.

Change to whatever you use! Yes, hardcoding can be bad, but variables refused to work otherwise.

Usage

 * Once the extension is installed, the “” link in the MediaWiki sidebar will lead you to a new selection screen.


 * On the selection screen you can then choose whether you want to render your PDF using Electron (“Single Column”) or using the old 1>Offline content generator|OCG/LaTeX renderer (“Two Column”).


 * After you've chosen the desired rendering method, click the “” button to get the PDF.


 * Note: if there is no alternative rendering method available on the Wiki, “” will immediately serve you the Electron rendered PDF without showing a selection screen.

Links

 * [https://github.com/wikimedia/mediawiki-services-electron-render/blob/master/README.md Electron service documentation]
 * OCG documentation
 * Example PDF
 * Example PDF