From EPubExport

Jump to: navigation, search



Download of the preferred archive file can be done from here. Currently there are tar.gz, bz2, rar and zip archives.

SVN is also availble. Trunk is in


To install this extension, extract the file in the extensions folder, then add the following to LocalSettings.php:


Directory tree should be as follow:

                 |     |
                 |     +-> EPub.php
                 |     +-> EPubChapterSplitter.php
                 |     +-> Zip.php
	          |     |
	          |     +-> LICENSE
	          |     +-> DejaVuSans.ttf
	          |     +-> DejaVuSans-Bold.ttf
	          |     +-> DejaVuSans-BoldOblique.ttf
	          |     +-> DejaVuSans-Oblique.ttf
                 +-> ePubExport.i18n.alias.php
                 +-> ePubExport.i18n.php
                 +-> ePubExport.php
                 +-> ePubExport_body.php

User-defined CSS file

Site administrator may change the default epub CSS to another file. In LocalSettings.php, just bellow the "require_once("$IP/extensions/ePubExport/ePubExport.php");" line, add $wgePubExportProperties['css_file'] = your_css_file_name.

For example:

$wgePubExportProperties['css_file'] = "$IP/ebook.css";

A good way to start is to copy the Default CSS file and modify it.

Embedding Fonts

For non-english wiki sites, as there is no way to know what will be the reading device, and if it has the font for the specific language or not, it is always a good idea to embed the fonts in the epub file. It does increase the size of the file, but it is readable.

ePubExport come with DejaVuSans fonts that support many languages. In order to embed these fonts in the epub file, the following configuration is required, because the font will not be embedded by default.

In LocalSettings.php, just below the "require_once("$IP/extensions/ePubExport/ePubExport.php");" line, add

$wgePubExportProperties['embed_fonts'] = true;
Supported Languages

The DejaVuSans fonts cover the following languages:

  Afar, Abkhazia, Afrikaans, Akan, Aragonese, Arabic, Asturian/Bable/Leonese/Asturleonese, Avaric, Aymara, 
  Azerbaijani in Azerbaijan, Azerbaijani in Iran, Bashkir, Byelorussian, Berber in Algeria,  Berber in Morocco, 
  Bulgarian, Bislama, Edo or Bini, Bambara, Breton, Bosnian, Buriat (Buryat), Catalan, Chechen, Chamorro, 
  Mari (Lower Cheremis / Upper Cheremis), Corsican, Crimean Tatar/Crimean Turkish, Czech, Kashubian, 
  Old Church Slavonic, Chuvash, Welsh, Danish, German, Ewe, Greek, English, Esperanto, Spanish, Estonian, Basque, 
  Persian, Fanti, Fulah (Fula), Finnish, Filipino, Fijian, Faroese, French, Friulian, Frisian, Irish, Scots Gaelic, 
  Galician, Guarani, Manx Gaelic, Hausa, Hawaiian, Hebrew, Hiri Motu, Croatian, Upper Sorbian, Haitian/Haitian Creole, 
  Hungarian, Armenian, Herero, Interlingua, Indonesian, Interlingue, Igbo, Inupiaq (Inupiak, Eskimo), Ido, Icelandic, 
  Italian, Inuktitut, Javanese, Georgian, Kara-Kalpak (Karakalpak), Kabyle, Kikuyu, Kuanyama/Kwanyama, Kazakh, Greenlandic, 
  Kanuri, Kurdish in Armenia, Kurdish in Iraq, Kurdish in Iran, Kurdish in Turkey, Kumyk, Komi (Komi-Permyak/Komi-Siryan), 
  Cornish, Kwambi, Kirgiz, Latin, Luxembourgish (Letzeburgesch), Lezghian (Lezgian), Ganda, Limburgan/Limburger/Limburgish, 
  Lingala, Lao, Lithuanian, Latvian, Malagasy, Marshallese, Maori, Macedonian, Mongolian in Mongolia, Moldavian, Malay, 
  Maltese, Nauru, Norwegian Bokmal, Low Saxon, Ndonga, Dutch, Norwegian Nynorsk, Norwegian (Bokmal), Ndebele, South, 
  Northern Sotho, Navajo/Navaho, Chichewa, Occitan, Oromo or Galla, Ossetic, Papiamento in Netherlands Antilles, 
  Papiamento in Aruba, Polish, Portuguese, Quechua, Rhaeto-Romance (Romansch), Rundi, Romanian, Russian, Kinyarwanda, Yakut, 
  Sardinian, Scots, North Sami, Selkup (Ostyak-Samoyed), Sango, Serbo-Croatian, Secwepemctsin, Slovak, Slovenian, Samoan, 
  South Sami, Lule Sami, Inari Sami, Skolt Sami, Shona, Somali, Albanian, Serbian, Swati, Sotho, Southern, Sundanese, Swedish, 
  Swahili, Tajik, Turkmen, Tagalog, Tswana, Tonga, Turkish, Tsonga, Tatar, Twi, Tahitian, Tuvinian, Uighur, Ukrainian, Uzbek, 
  Venda, Vietnamese, Volapuk, Votic, Walloon, Sorbian languages (lower and upper), Wolof, Xhosa, Yapese, Yiddish, Yoruba, 
  Zhuang/Chuang and Zulu

User-defined fonts

If the default fonts ars not fit or not support the wiki language, it is possible to embed another fonts. To do so, the $wgePubExportProperties['embed_fonts'] property must be set to true.

Then, specify the fonts source as follows:

$wgePubExportProperties['fonts'][] = _font_1_src_;
$wgePubExportProperties['fonts'][] = _font_2_src_;
$wgePubExportProperties['fonts'][] = _font_3_src_;

Font license is embedde as follows:

$wgePubExportProperties['font_license'] = _license_src_;

For example:

   $wgePubExportProperties['embed_fonts'] = true;
   $wgePubExportProperties['css_file'] = "$IP/ebook.css";
   $wgePubExportProperties['fonts'][] = '$IP/extensions/ePubExport/fonts/DejaVuSans.ttf';
   $wgePubExportProperties['fonts'][] = '$IP/extensions/ePubExport/fonts/DejaVuSans-Bold.ttf';
   $wgePubExportProperties['fonts'][] = '$IP/extensions/ePubExport/fonts/DejaVuSans-BoldOblique.ttf';
   $wgePubExportProperties['fonts'][] = '$IP/extensions/ePubExport/fonts/DejaVuSans-Oblique.ttf';
   $wgePubExportProperties['font_license'] = '$IP/extensions/ePubExport/fonts/LICENSE';

NOTE: Using user-defined font require user-defined CSS. ePubExport does not enforce that, but it won't work without CSS that defines and use the user-defined fonts.


Export Current Page

In order to export current page, click the "Export as ePub" link at the "toolbox" menu, and save the file.

Export Group of Pages

  1. In order to export group of pages in a single epub file, click the "Special pages" link at the navigation menu. then choose the "ePub Export" (found under "Page tools" section).
  2. In the first text area, enter a list of one or more pages to export to ePub, one page name per line.
  3. In the second text area, you may add a description to the epub file.
  4. Choose a name for your file and press "Make ePub" to download the file.
Personal tools