Difference between revisions of "PdfHandler"

From Wiki4Intranet
Jump to: navigation, search
(Created page with "{{Extension4info |name=PdfHandler |description en=Media handler for PDF files. That it, it allows to upload, view and embed PDFs to Wiki pages just like images. |description r...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Extension4info
 
{{Extension4info
 
|name=PdfHandler
 
|name=PdfHandler
|description en=Media handler for PDF files. That it, it allows to upload, view and embed PDFs to Wiki pages just like images.
+
|description en=Media handler for PDF files. That is, it allows to upload, view and embed PDFs to Wiki pages just like images.
 
|description ru=Медиаобработчик для PDF-файлов. То есть, поддержка загрузки PDF’ок, их постраничного просмотра и вставки страниц PDF как изображений.
 
|description ru=Медиаобработчик для PDF-файлов. То есть, поддержка загрузки PDF’ок, их постраничного просмотра и вставки страниц PDF как изображений.
 
|created=2007-08-18
 
|created=2007-08-18
 
|included=2009-10-25
 
|included=2009-10-25
|status=fixed
+
|status=fork
 +
|useful=definitely
 
}}
 
}}
 
{{ExtensionFromInfo|lang=en|name=PdfHandler}}
 
{{ExtensionFromInfo|lang=en|name=PdfHandler}}
[[Category:Incomplete extension descriptions]]
+
 
 +
== Usage ==
 +
 
 +
PdfHandler is a media handler for PDF files. It allows to upload and insert PDF’s to Wiki pages just like image files. Also it supports paged preview and inserting thumbnails of specific pages via <tt><nowiki>[[File:Book.pdf|page=2]]</nowiki></tt> syntax.
 +
 
 +
This is our (Mediawiki4Intranet) fork of the standard PdfHandler extension. Its main features are:
 +
* MUCH (~10 times) faster and accurate (font antialiasing is better) page rasterisation — Poppler (pdftocairo) is used instead of GhostScript+ImageMagick for thumbnail generation. Also only poppler-utils («pdftocairo» and «pdfinfo») are required for operation, neither ghostscript nor command-line imagemagick are needed.
 +
* Support for correct detection of PDF page orientation when used with poppler >= 0.20 or with a supplied patch.
 +
* Support for inserting thumbnails of a range of pages or even of all pages at once — just specify <tt><nowiki>[[File:Book.pdf|page=1-5]]</nowiki></tt> or <tt><nowiki>[[File:Book.pdf|page=-]]</nowiki></tt> (all pages).
 +
 
 +
== TODO ==
 +
 
 +
* When a range of pages is inserted, only the first thumbnail file is checked for being already generated. Thus if you first insert a smaller range and then a bigger one, but starting from the same page, some page thumbnails may be not generated. This needs to be fixed.
 +
 
 +
== Setup ==
 +
 
 +
First install Poppler command-line tools (pdfinfo and pdftocairo are required). In Debian they are contained in the poppler-utils package.
 +
 
 +
Then clone the extension as usual and add it to LocalSettings.php:
 +
 
 +
<code-php>
 +
require_once "$IP/extensions/PdfHandler/PdfHandler.php";
 +
</code-php>

Latest revision as of 02:17, 29 November 2015

PdfHandler is a MediaWiki extension.

Status for Mediawiki4Intranet distribution:

  • Inclusion date: 2009-10-25
  • Included version: newest available
  • Improvement status: Forked in MediaWiki4Intranet with major improvements

Usage

PdfHandler is a media handler for PDF files. It allows to upload and insert PDF’s to Wiki pages just like image files. Also it supports paged preview and inserting thumbnails of specific pages via [[File:Book.pdf|page=2]] syntax.

This is our (Mediawiki4Intranet) fork of the standard PdfHandler extension. Its main features are:

  • MUCH (~10 times) faster and accurate (font antialiasing is better) page rasterisation — Poppler (pdftocairo) is used instead of GhostScript+ImageMagick for thumbnail generation. Also only poppler-utils («pdftocairo» and «pdfinfo») are required for operation, neither ghostscript nor command-line imagemagick are needed.
  • Support for correct detection of PDF page orientation when used with poppler >= 0.20 or with a supplied patch.
  • Support for inserting thumbnails of a range of pages or even of all pages at once — just specify [[File:Book.pdf|page=1-5]] or [[File:Book.pdf|page=-]] (all pages).

TODO

  • When a range of pages is inserted, only the first thumbnail file is checked for being already generated. Thus if you first insert a smaller range and then a bigger one, but starting from the same page, some page thumbnails may be not generated. This needs to be fixed.

Setup

First install Poppler command-line tools (pdfinfo and pdftocairo are required). In Debian they are contained in the poppler-utils package.

Then clone the extension as usual and add it to LocalSettings.php:

require_once "$IP/extensions/PdfHandler/PdfHandler.php";