r100424 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100423‎ | r100424 | r100425 >
Date:15:44, 21 October 2011
Author:vitalif
Status:deferred
Tags:
Comment:
Branch original PdfHandler.
Modified paths:
  • /branches/vitalif/extensions/PdfHandler (added) (history)

Diff [purge]

Index: branches/vitalif/extensions/PdfHandler/CreatePdfThumbnailsJob.class.php
@@ -0,0 +1,123 @@
 2+<?php
 3+
 4+class CreatePdfThumbnailsJob extends Job {
 5+ /**
 6+ * Flags for thumbnail jobs
 7+ */
 8+ const BIG_THUMB = 1;
 9+ const SMALL_THUMB = 2;
 10+
 11+ /**
 12+ * Construct a thumbnail job
 13+ *
 14+ * @param $title Title: Title object
 15+ * @param $params Associative array of options:
 16+ * page: page number for which the thumbnail will be created
 17+ * jobtype: CreatePDFThumbnailsJob::BIG_THUMB or CreatePDFThumbnailsJob::SMALL_THUMB
 18+ * BIG_THUMB will create a thumbnail visible for full thumbnail view,
 19+ * SMALL_THUMB will create a thumbnail shown in "previous page"/"next page" boxes
 20+ *
 21+ */
 22+ public function __construct( $title, $params ) {
 23+ parent::__construct( 'createPdfThumbnailsJob', $title, $params );
 24+ }
 25+
 26+ /**
 27+ * Run a thumbnail job on a given PDF file.
 28+ * @return bool true
 29+ */
 30+ public function run() {
 31+ if ( !isset( $this->params['page'] ) ) {
 32+ wfDebugLog('thumbnails', 'A page for thumbnails job of ' . $this->title->getText() . ' was not specified! That should never happen!');
 33+ return true; // no page set? that should never happen
 34+ }
 35+
 36+ $file = wfLocalFile( $this->title ); // we just want a local file
 37+ if ( !$file ) {
 38+ return true; // Just silently fail, perhaps the file was already deleted, don't bother
 39+ }
 40+
 41+ switch ($this->params['jobtype']) {
 42+ case self::BIG_THUMB:
 43+ global $wgImageLimits;
 44+ // Ignore user preferences, do default thumbnails
 45+ // everything here shamelessy copied and reused from includes/ImagePage.php
 46+ $sizeSel = User::getDefaultOption( 'imagesize' );
 47+
 48+ // The user offset might still be incorrect, specially if
 49+ // $wgImageLimits got changed (see bug #8858).
 50+ if ( !isset( $wgImageLimits[$sizeSel] ) ) {
 51+ // Default to the first offset in $wgImageLimits
 52+ $sizeSel = 0;
 53+ }
 54+ $max = $wgImageLimits[$sizeSel];
 55+ $maxWidth = $max[0];
 56+ $maxHeight = $max[1];
 57+
 58+ $width_orig = $file->getWidth( $this->params['page'] );
 59+ $width = $width_orig;
 60+ $height_orig = $file->getHeight( $this->params['page'] );
 61+ $height = $height_orig;
 62+ if ( $width > $maxWidth || $height > $maxHeight ) {
 63+ # Calculate the thumbnail size.
 64+ # First case, the limiting factor is the width, not the height.
 65+ if ( $width / $height >= $maxWidth / $maxHeight ) {
 66+ $height = round( $height * $maxWidth / $width );
 67+ $width = $maxWidth;
 68+ # Note that $height <= $maxHeight now.
 69+ } else {
 70+ $newwidth = floor( $width * $maxHeight / $height );
 71+ $height = round( $height * $newwidth / $width );
 72+ $width = $newwidth;
 73+ # Note that $height <= $maxHeight now, but might not be identical
 74+ # because of rounding.
 75+ }
 76+ $transformParams = array( 'page' => $this->params['page'], 'width' => $width );
 77+ $file->transform( $transformParams );
 78+ }
 79+ break;
 80+
 81+ case self::SMALL_THUMB:
 82+ global $wgUser;
 83+ $sk = $wgUser->getSkin();
 84+ $sk->makeThumbLinkObj( $this->title, $file, '', '', 'none', array( 'page' => $this->params['page'] ) );
 85+ break;
 86+ }
 87+
 88+ return true;
 89+ }
 90+
 91+
 92+ public static function insertJobs( $upload, $mime, &$error ) {
 93+ global $wgPdfCreateThumbnailsInJobQueue;
 94+ if ( !$wgPdfCreateThumbnailsInJobQueue ) {
 95+ return true;
 96+ }
 97+ if (!MimeMagic::singleton()->isMatchingExtension('pdf', $mime)) {
 98+ return true; // not a PDF, abort
 99+ }
 100+
 101+ $title = $upload->getTitle();
 102+ $uploadFile = $upload->getLocalFile();
 103+ if ( is_null($uploadFile) ) {
 104+ wfDebugLog('thumbnails', '$uploadFile seems to be null, should never happen...');
 105+ return true; // should never happen, but it's better to be secure
 106+ }
 107+
 108+ $metadata = $uploadFile->getMetadata();
 109+ $unserialized = unserialize( $metadata );
 110+ $pages = intval( $unserialized['Pages'] );
 111+
 112+ $jobs = array();
 113+ for ($i = 1; $i <= $pages; $i++) {
 114+ $jobs[] = new CreatePdfThumbnailsJob( $title,
 115+ array( 'page' => $i, 'jobtype' => self::BIG_THUMB )
 116+ );
 117+ $jobs[] = new CreatePdfThumbnailsJob( $title,
 118+ array( 'page' => $i, 'jobtype' => self::SMALL_THUMB )
 119+ );
 120+ }
 121+ Job::batchInsert( $jobs );
 122+ return true;
 123+ }
 124+}
Property changes on: branches/vitalif/extensions/PdfHandler/CreatePdfThumbnailsJob.class.php
___________________________________________________________________
Added: svn:eol-style
1125 + native
Index: branches/vitalif/extensions/PdfHandler/PdfHandler_body.php
@@ -0,0 +1,231 @@
 2+<?php
 3+/**
 4+ * Copyright © 2007 Martin Seidel (Xarax) <jodeldi@gmx.de>
 5+ *
 6+ * Inspired by djvuhandler from Tim Starling
 7+ * Modified and written by Xarax
 8+ *
 9+ * This program is free software; you can redistribute it and/or modify
 10+ * it under the terms of the GNU General Public License as published by
 11+ * the Free Software Foundation; either version 2 of the License, or
 12+ * (at your option) any later version.
 13+ *
 14+ * This program is distributed in the hope that it will be useful,
 15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 17+ * GNU General Public License for more details.
 18+ *
 19+ * You should have received a copy of the GNU General Public License along
 20+ * with this program; if not, write to the Free Software Foundation, Inc.,
 21+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 22+ * http://www.gnu.org/copyleft/gpl.html
 23+ */
 24+
 25+class PdfHandler extends ImageHandler {
 26+
 27+ function isEnabled() {
 28+ global $wgPdfProcessor, $wgPdfPostProcessor, $wgPdfInfo;
 29+
 30+ if ( !isset( $wgPdfProcessor ) || !isset( $wgPdfPostProcessor ) || !isset( $wgPdfInfo ) ) {
 31+ wfDebug( "PdfHandler is disabled, please set the following\n" );
 32+ wfDebug( "variables in LocalSettings.php:\n" );
 33+ wfDebug( "\$wgPdfProcessor, \$wgPdfPostProcessor, \$wgPdfInfo\n" );
 34+ return false;
 35+ }
 36+ return true;
 37+ }
 38+
 39+ function mustRender( $file ) {
 40+ return true;
 41+ }
 42+
 43+ function isMultiPage( $file ) {
 44+ return true;
 45+ }
 46+
 47+ function validateParam( $name, $value ) {
 48+ if ( in_array( $name, array( 'width', 'height', 'page' ) ) ) {
 49+ return ( $value <= 0 ) ? false : true;
 50+ } else {
 51+ return false;
 52+ }
 53+ }
 54+
 55+ function makeParamString( $params ) {
 56+ $page = isset( $params['page'] ) ? $params['page'] : 1;
 57+ if ( !isset( $params['width'] ) ) {
 58+ return false;
 59+ }
 60+ return "page{$page}-{$params['width']}px";
 61+ }
 62+
 63+ function parseParamString( $str ) {
 64+ $m = false;
 65+
 66+ if ( preg_match( '/^page(\d+)-(\d+)px$/', $str, $m ) ) {
 67+ return array( 'width' => $m[2], 'page' => $m[1] );
 68+ }
 69+
 70+ return false;
 71+ }
 72+
 73+ function getScriptParams( $params ) {
 74+ return array(
 75+ 'width' => $params['width'],
 76+ 'page' => $params['page'],
 77+ );
 78+ }
 79+
 80+ function getParamMap() {
 81+ return array(
 82+ 'img_width' => 'width',
 83+ 'img_page' => 'page',
 84+ );
 85+ }
 86+
 87+ protected function doThumbError( $width, $height, $msg ) {
 88+ return new MediaTransformError( 'thumbnail_error',
 89+ $width, $height, wfMsgForContent( $msg ) );
 90+ }
 91+
 92+ function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
 93+ global $wgPdfProcessor, $wgPdfPostProcessor, $wgPdfHandlerDpi;
 94+
 95+ $metadata = $image->getMetadata();
 96+
 97+ if ( !$metadata ) {
 98+ return $this->doThumbError( @$params['width'], @$params['height'], 'pdf_no_metadata' );
 99+ }
 100+
 101+ if ( !$this->normaliseParams( $image, $params ) ) {
 102+ return new TransformParameterError( $params );
 103+ }
 104+
 105+ $width = $params['width'];
 106+ $height = $params['height'];
 107+ $srcPath = $image->getPath();
 108+ $page = $params['page'];
 109+
 110+ if ( $page > $this->pageCount( $image ) ) {
 111+ return $this->doTHumbError( $width, $height, 'pdf_page_error' );
 112+ }
 113+
 114+ if ( $flags & self::TRANSFORM_LATER ) {
 115+ return new ThumbnailImage( $image, $dstUrl, $width,
 116+ $height, $dstPath, $page );
 117+ }
 118+
 119+ if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
 120+ return $this->doThumbError( $width, $height, 'thumbnail_dest_directory' );
 121+ }
 122+
 123+ $cmd = '(' . wfEscapeShellArg( $wgPdfProcessor );
 124+ $cmd .= " -sDEVICE=jpeg -sOutputFile=- -dFirstPage={$page} -dLastPage={$page}";
 125+ $cmd .= " -r{$wgPdfHandlerDpi} -dBATCH -dNOPAUSE -q ". wfEscapeShellArg( $srcPath );
 126+ $cmd .= " | " . wfEscapeShellArg( $wgPdfPostProcessor );
 127+ $cmd .= " -depth 8 -resize {$width} - ";
 128+ $cmd .= wfEscapeShellArg( $dstPath ) . ")";
 129+ $cmd .= " 2>&1";
 130+
 131+ wfProfileIn( 'PdfHandler' );
 132+ wfDebug( __METHOD__ . ": $cmd\n" );
 133+ $retval = '';
 134+ $err = wfShellExec( $cmd, $retval );
 135+ wfProfileOut( 'PdfHandler' );
 136+
 137+ $removed = $this->removeBadFile( $dstPath, $retval );
 138+
 139+ if ( $retval != 0 || $removed ) {
 140+ wfDebugLog( 'thumbnail',
 141+ sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
 142+ wfHostname(), $retval, trim( $err ), $cmd ) );
 143+ return new MediaTransformError( 'thumbnail_error', $width, $height, $err );
 144+ } else {
 145+ return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page );
 146+ }
 147+ }
 148+
 149+ function getPdfImage( $image, $path ) {
 150+ if ( !$image ) {
 151+ $pdfimg = new PdfImage( $path );
 152+ } elseif ( !isset( $image->pdfImage ) ) {
 153+ $pdfimg = $image->pdfImage = new PdfImage( $path );
 154+ } else {
 155+ $pdfimg = $image->pdfImage;
 156+ }
 157+
 158+ return $pdfimg;
 159+ }
 160+
 161+ function getMetaArray( $image ) {
 162+ if ( isset( $image->pdfMetaArray ) ) {
 163+ return $image->pdfMetaArray;
 164+ }
 165+
 166+ $metadata = $image->getMetadata();
 167+
 168+ if ( !$this->isMetadataValid( $image, $metadata ) ) {
 169+ wfDebug( "Pdf metadata is invalid or missing, should have been fixed in upgradeRow\n" );
 170+ return false;
 171+ }
 172+
 173+ wfProfileIn( __METHOD__ );
 174+ wfSuppressWarnings();
 175+ $image->pdfMetaArray = unserialize( $metadata );
 176+ wfRestoreWarnings();
 177+ wfProfileOut( __METHOD__ );
 178+
 179+ return $image->pdfMetaArray;
 180+ }
 181+
 182+ function getImageSize( $image, $path ) {
 183+ return $this->getPdfImage( $image, $path )->getImageSize();
 184+ }
 185+
 186+ function getThumbType( $ext, $mime, $params = null ) {
 187+ global $wgPdfOutputExtension;
 188+ static $mime;
 189+
 190+ if ( !isset( $mime ) ) {
 191+ $magic = MimeMagic::singleton();
 192+ $mime = $magic->guessTypesForExtension( $wgPdfOutputExtension );
 193+ }
 194+ return array( $wgPdfOutputExtension, $mime );
 195+ }
 196+
 197+ function getMetadata( $image, $path ) {
 198+ return serialize( $this->getPdfImage( $image, $path )->retrieveMetaData() );
 199+ }
 200+
 201+ function isMetadataValid( $image, $metadata ) {
 202+ return !empty( $metadata ) && $metadata != serialize( array() );
 203+ }
 204+
 205+ function pageCount( $image ) {
 206+ $data = $this->getMetaArray( $image );
 207+ if ( !$data ) {
 208+ return false;
 209+ }
 210+ return intval( $data['Pages'] );
 211+ }
 212+
 213+ function getPageDimensions( $image, $page ) {
 214+ $data = $this->getMetaArray( $image );
 215+ return PdfImage::getPageSize( $data, $page );
 216+ }
 217+
 218+ function getPageText( $image, $page ) {
 219+ $data = $this->getMetaArray( $image, true );
 220+ if ( !$data ) {
 221+ return false;
 222+ }
 223+ if( !isset( $data['text'] ) ) {
 224+ return false;
 225+ }
 226+ if( !isset( $data['text'][$page - 1] ) ) {
 227+ return false;
 228+ }
 229+ return $data['text'][$page - 1];
 230+ }
 231+
 232+}
Property changes on: branches/vitalif/extensions/PdfHandler/PdfHandler_body.php
___________________________________________________________________
Added: svn:eol-style
1233 + native
Index: branches/vitalif/extensions/PdfHandler/PdfHandler.i18n.php
@@ -0,0 +1,798 @@
 2+<?php
 3+/**
 4+ * Internationalisation file for extension PdfHandler.
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+$messages = array();
 11+
 12+$messages['en'] = array(
 13+ 'pdf-desc' => 'Handler for viewing PDF files in image mode',
 14+ 'pdf_no_metadata' => 'Cannot get metadata from PDF',
 15+ 'pdf_page_error' => 'Page number not in range',
 16+);
 17+
 18+/** Message documentation (Message documentation)
 19+ * @author Purodha
 20+ * @author The Evil IP address
 21+ */
 22+$messages['qqq'] = array(
 23+ 'pdf-desc' => '{{desc}}',
 24+);
 25+
 26+/** Afrikaans (Afrikaans)
 27+ * @author Naudefj
 28+ */
 29+$messages['af'] = array(
 30+ 'pdf_no_metadata' => 'Kan nie metadata uit PDF kry nie',
 31+ 'pdf_page_error' => 'Bladsynommer kom nie in dokument voor nie',
 32+);
 33+
 34+/** Gheg Albanian (Gegë)
 35+ * @author Mdupont
 36+ */
 37+$messages['aln'] = array(
 38+ 'pdf-desc' => 'Mbajtës për shikimin PDF files në imazh mode',
 39+ 'pdf_no_metadata' => 'Nuk mund të merrni nga metadata PDF',
 40+ 'pdf_page_error' => 'numrin e faqes nuk është në varg',
 41+);
 42+
 43+/** Arabic (العربية)
 44+ * @author Meno25
 45+ */
 46+$messages['ar'] = array(
 47+ 'pdf-desc' => 'متحكم لرؤية ملفات PDF في نمط صورة',
 48+ 'pdf_no_metadata' => 'لم يمكن أخذ معلومات ميتا من PDF',
 49+ 'pdf_page_error' => 'رقم الصفحة ليس في النطاق',
 50+);
 51+
 52+/** Egyptian Spoken Arabic (مصرى)
 53+ * @author Meno25
 54+ */
 55+$messages['arz'] = array(
 56+ 'pdf-desc' => 'متحكم لرؤية ملفات PDF فى نمط صورة',
 57+ 'pdf_no_metadata' => 'لم يمكن أخذ معلومات ميتا من PDF',
 58+ 'pdf_page_error' => 'رقم الصفحة ليس فى النطاق',
 59+);
 60+
 61+/** Bashkir (Башҡортса)
 62+ * @author Assele
 63+ */
 64+$messages['ba'] = array(
 65+ 'pdf-desc' => 'PDF файлдарҙы рәсемдәр рәүешендә ҡарау өсөн эшкәртеүсе ҡорал',
 66+ 'pdf_no_metadata' => 'PDF-тан мета-мәғлүмәтте алыу мөмкин түгел',
 67+ 'pdf_page_error' => 'Бит һаны биттәр һанынан ашҡан',
 68+);
 69+
 70+/** Belarusian (Taraškievica orthography) (‪Беларуская (тарашкевіца)‬)
 71+ * @author EugeneZelenko
 72+ * @author Jim-by
 73+ */
 74+$messages['be-tarask'] = array(
 75+ 'pdf-desc' => 'Апрацоўшчык для прагляду PDF-файлаў у выглядзе выяваў',
 76+ 'pdf_no_metadata' => 'Немагчыма атрымаць мэта-зьвесткі з PDF-файла',
 77+ 'pdf_page_error' => 'Нумар старонкі паза дыяпазонам',
 78+);
 79+
 80+/** Bulgarian (Български)
 81+ * @author DCLXVI
 82+ * @author Turin
 83+ */
 84+$messages['bg'] = array(
 85+ 'pdf_no_metadata' => 'невъзможно е да бъдат извлечени метаданни от PDF',
 86+ 'pdf_page_error' => 'Номерът на страница е извън обхвата',
 87+);
 88+
 89+/** Bengali (বাংলা)
 90+ * @author Wikitanvir
 91+ */
 92+$messages['bn'] = array(
 93+ 'pdf_no_metadata' => 'পিডিএফ থেকে মেটাডেটা পাওয়া যায়নি',
 94+ 'pdf_page_error' => 'পাতার নম্বর সীমার মধ্যে নেই',
 95+);
 96+
 97+/** Breton (Brezhoneg)
 98+ * @author Fulup
 99+ */
 100+$messages['br'] = array(
 101+ 'pdf-desc' => 'Maveg evit gwelet ar restroù PDF e mod skeudenn',
 102+ 'pdf_no_metadata' => 'Dibosupl tapout meta-roadennoù digant ar restr PDF',
 103+ 'pdf_page_error' => "N'emañ ket niverenn ar bajenn er skeuliad",
 104+);
 105+
 106+/** Bosnian (Bosanski)
 107+ * @author CERminator
 108+ */
 109+$messages['bs'] = array(
 110+ 'pdf-desc' => 'Uređivač za pregled PDF datoteka u modu za slike',
 111+ 'pdf_no_metadata' => 'Ne mogu se naći metapodaci u PDFu',
 112+ 'pdf_page_error' => 'Broj stranice nije u rasponu',
 113+);
 114+
 115+/** Catalan (Català)
 116+ * @author Aleator
 117+ */
 118+$messages['ca'] = array(
 119+ 'pdf-desc' => 'Gestor per a visualitzar arxius PDF en mode imatge',
 120+ 'pdf_no_metadata' => "No s'han pogut obtenir metadades del PDF",
 121+ 'pdf_page_error' => "Número de pàgina fora d'abast",
 122+);
 123+
 124+/** Chechen (Нохчийн)
 125+ * @author Sasan700
 126+ */
 127+$messages['ce'] = array(
 128+ 'pdf-desc' => 'Хьажа аттон кечйо PDF-хlумнаш суьрта куьцехь',
 129+ 'pdf_no_metadata' => 'схьацаэцало чура бух оцу PDF',
 130+ 'pdf_page_error' => 'Агlон терахь дозан чулацамца дац',
 131+);
 132+
 133+/** Czech (Česky)
 134+ * @author Matěj Grabovský
 135+ * @author Mormegil
 136+ */
 137+$messages['cs'] = array(
 138+ 'pdf-desc' => 'Ovladač pro prohlížení PDF souborů jako obrázků',
 139+ 'pdf_no_metadata' => 'Nelze získat metadata z PDF',
 140+ 'pdf_page_error' => 'Číslo stránky není v rozsahu',
 141+);
 142+
 143+/** Welsh (Cymraeg)
 144+ * @author Lloffiwr
 145+ */
 146+$messages['cy'] = array(
 147+ 'pdf-desc' => 'Teclyn i weld ffeiliau PDF ar lun delwedd',
 148+ 'pdf_no_metadata' => "Yn methu cael y metadata o'r PDF",
 149+ 'pdf_page_error' => "Nid yw'r rhif hwn oddi mewn i ystod rhifau'r tudalennau",
 150+);
 151+
 152+/** Danish (Dansk)
 153+ * @author Peter Alberti
 154+ */
 155+$messages['da'] = array(
 156+ 'pdf-desc' => 'Håndtering af PDF-visning i billedtilstand',
 157+ 'pdf_no_metadata' => 'Kan ikke hente metadata fra PDF',
 158+ 'pdf_page_error' => 'Sidetallet er større end antallet af sider i dokumentet',
 159+);
 160+
 161+/** German (Deutsch)
 162+ * @author Kghbln
 163+ * @author Raimond Spekking
 164+ */
 165+$messages['de'] = array(
 166+ 'pdf-desc' => 'Stellt eine Schnittstelle zur Ansicht von PDF-Dateien im Bildermodus bereit',
 167+ 'pdf_no_metadata' => 'Keine Metadaten im PDF vorhanden.',
 168+ 'pdf_page_error' => 'Seitenzahl außerhalb des Dokumentes.',
 169+);
 170+
 171+/** Zazaki (Zazaki)
 172+ * @author Aspar
 173+ */
 174+$messages['diq'] = array(
 175+ 'pdf-desc' => 'şuxulnayoxo ke dosyayê PDFyan modê mocnayiş de mocneno',
 176+ 'pdf_no_metadata' => 'PDF ra metadata nêgeriyeno',
 177+ 'pdf_page_error' => 'numreyê peli benate de niyo',
 178+);
 179+
 180+/** Lower Sorbian (Dolnoserbski)
 181+ * @author Michawiki
 182+ */
 183+$messages['dsb'] = array(
 184+ 'pdf-desc' => 'Źěłowy rěd za woglědowanje PDF-datajow we wobrazowem modusu',
 185+ 'pdf_no_metadata' => 'Metadaty njedaju se z PDF dobyś',
 186+ 'pdf_page_error' => 'Bokowe cysło zwenka wobcerka',
 187+);
 188+
 189+/** Greek (Ελληνικά)
 190+ * @author Omnipaedista
 191+ */
 192+$messages['el'] = array(
 193+ 'pdf-desc' => 'Διαχειριστής για την εμφάνιση αρχείων PDF σε μορφή εικόνας',
 194+ 'pdf_no_metadata' => 'Αδύνατη η απόκτηση μεταδεδομένων από PDF',
 195+ 'pdf_page_error' => 'Αριθμός σελίδας εκτός ορίου',
 196+);
 197+
 198+/** Esperanto (Esperanto)
 199+ * @author Yekrats
 200+ */
 201+$messages['eo'] = array(
 202+ 'pdf-desc' => 'Ilo por vidi PDF-dosierojn en bilda reĝimo',
 203+ 'pdf_no_metadata' => 'Ne povas preni metadatenon el PDF',
 204+ 'pdf_page_error' => 'Paĝnombro ekster valida intervalo',
 205+);
 206+
 207+/** Spanish (Español)
 208+ * @author Sanbec
 209+ */
 210+$messages['es'] = array(
 211+ 'pdf-desc' => 'Manejador para ver archivos PDF en modo imagen',
 212+ 'pdf_no_metadata' => 'No se obtuvieron metadatos del PDF',
 213+ 'pdf_page_error' => 'Número de página fuera de rango',
 214+);
 215+
 216+/** Estonian (Eesti)
 217+ * @author Pikne
 218+ */
 219+$messages['et'] = array(
 220+ 'pdf-desc' => 'Töötleja PDF-failide piltidena kuvamiseks',
 221+ 'pdf_no_metadata' => 'Ei õnnestu PDF-faili meta-andmeid saada',
 222+ 'pdf_page_error' => 'Leheküljenumber pole vahemikus.',
 223+);
 224+
 225+/** Persian (فارسی)
 226+ * @author Ebraminio
 227+ * @author Huji
 228+ * @author Sahim
 229+ * @author Wayiran
 230+ */
 231+$messages['fa'] = array(
 232+ 'pdf-desc' => 'گرداننده‌ای برای مشاهده فایل های پی‌دی‌اف در حالت تصویر',
 233+ 'pdf_no_metadata' => 'نمی‌توان فراداده‌ها را از پی‌دی‌اف گرفت',
 234+ 'pdf_page_error' => 'شماره صفحه در محدوده نیست',
 235+);
 236+
 237+/** Finnish (Suomi)
 238+ * @author Nike
 239+ * @author Vililikku
 240+ */
 241+$messages['fi'] = array(
 242+ 'pdf-desc' => 'Käsittelijä PDF-tiedostojen katsomiseen kuvatilassa.',
 243+ 'pdf_no_metadata' => 'Metatietojen hakeminen PDF-tiedostosta epäonnistui',
 244+ 'pdf_page_error' => 'Sivunumero ei ole alueella.',
 245+);
 246+
 247+/** French (Français)
 248+ * @author Crochet.david
 249+ * @author Grondin
 250+ * @author Verdy p
 251+ */
 252+$messages['fr'] = array(
 253+ 'pdf-desc' => 'Gestionnaire permettant de visualiser les fichiers PDF en mode image',
 254+ 'pdf_no_metadata' => 'Impossible d’obtenir les métadonnées du fichier PDF',
 255+ 'pdf_page_error' => 'Le numéro de page est hors de l’étendue.',
 256+);
 257+
 258+/** Franco-Provençal (Arpetan)
 259+ * @author ChrisPtDe
 260+ */
 261+$messages['frp'] = array(
 262+ 'pdf-desc' => 'Utilitèro por vêre los fichiérs PDF en fôrma émâge.',
 263+ 'pdf_no_metadata' => 'Pôt pas avêr les mètabalyês du fichiér PDF.',
 264+ 'pdf_page_error' => 'Lo numerô de pâge est en defôr de la portâ.',
 265+);
 266+
 267+/** Galician (Galego)
 268+ * @author Alma
 269+ * @author Toliño
 270+ */
 271+$messages['gl'] = array(
 272+ 'pdf-desc' => 'Manipulador para ver ficheiros PDF no modo de imaxe',
 273+ 'pdf_no_metadata' => 'Non se puideron obter os metadatos do PDF',
 274+ 'pdf_page_error' => 'O número da páxina non está no rango',
 275+);
 276+
 277+/** Ancient Greek (Ἀρχαία ἑλληνικὴ)
 278+ * @author Omnipaedista
 279+ */
 280+$messages['grc'] = array(
 281+ 'pdf_no_metadata' => 'Ἀδύνατον τὸ ἀποκομίζειν μεταδεδομένα ἐκ PDF',
 282+ 'pdf_page_error' => 'Ἀριθμὸς δέλτου ἐκτὸς ἐμβελείας',
 283+);
 284+
 285+/** Swiss German (Alemannisch)
 286+ * @author Als-Holder
 287+ */
 288+$messages['gsw'] = array(
 289+ 'pdf-desc' => 'Schnittstell fir d Aasicht vu PDF-Dateien im Bilder-Modus',
 290+ 'pdf_no_metadata' => 'Kei Metadate im PDF vorhande.',
 291+ 'pdf_page_error' => 'Sytezahl usserhalb vum Dokumänt.',
 292+);
 293+
 294+/** Hebrew (עברית)
 295+ * @author Rotemliss
 296+ * @author YaronSh
 297+ */
 298+$messages['he'] = array(
 299+ 'pdf-desc' => 'טיפול בצפייה בקובצי PDF במצב תמונה',
 300+ 'pdf_no_metadata' => 'לא ניתן לאחזר את נתוני המסמך מה־PDF',
 301+ 'pdf_page_error' => 'מספר הדף אינו בטווח',
 302+);
 303+
 304+/** Hindi (हिन्दी)
 305+ * @author Kaustubh
 306+ */
 307+$messages['hi'] = array(
 308+ 'pdf-desc' => 'चित्र मोड में पीडीएफ फ़ाईल देखनेके लिये आवश्यक प्रणाली',
 309+ 'pdf_no_metadata' => 'पीडीएफ से मेटाडाटा ले नहीं पायें',
 310+ 'pdf_page_error' => 'पन्ने का क्रमांक सीमामें नहीं हैं',
 311+);
 312+
 313+/** Croatian (Hrvatski)
 314+ * @author Ex13
 315+ */
 316+$messages['hr'] = array(
 317+ 'pdf-desc' => 'Program za gledanje PDF datoteka u slikovnom modu',
 318+ 'pdf_no_metadata' => 'Nije moguće dobiti metapodatke iz PDF',
 319+ 'pdf_page_error' => 'Broj stranice nije u opsegu',
 320+);
 321+
 322+/** Upper Sorbian (Hornjoserbsce)
 323+ * @author Michawiki
 324+ */
 325+$messages['hsb'] = array(
 326+ 'pdf-desc' => 'Program za wobhladowanje datajow PDF we wobrazowym modusu',
 327+ 'pdf_no_metadata' => 'W PDF žane metadaty njejsu.',
 328+ 'pdf_page_error' => 'Ličba strony zwonka dokumenta.',
 329+);
 330+
 331+/** Hungarian (Magyar)
 332+ * @author Dani
 333+ */
 334+$messages['hu'] = array(
 335+ 'pdf-desc' => 'PDF fájlok megjelenítse képként',
 336+ 'pdf_no_metadata' => 'nem sikerült lekérni a PDF metaadatait',
 337+ 'pdf_page_error' => 'Az oldalszám a tartományon kívül esik',
 338+);
 339+
 340+/** Interlingua (Interlingua)
 341+ * @author McDutchie
 342+ */
 343+$messages['ia'] = array(
 344+ 'pdf-desc' => 'Gestor pro visualisar files PDF in modo de imagine',
 345+ 'pdf_no_metadata' => 'Non pote obtener metadatos ab PDF',
 346+ 'pdf_page_error' => 'Numero de pagina foras del intervallo',
 347+);
 348+
 349+/** Indonesian (Bahasa Indonesia)
 350+ * @author Bennylin
 351+ */
 352+$messages['id'] = array(
 353+ 'pdf-desc' => 'Yang menangani tampilan berkas PDF dalam mode gambar',
 354+ 'pdf_no_metadata' => 'Tidak dapat membaca metadata dari PDF',
 355+ 'pdf_page_error' => 'Nomor halaman di luar batas',
 356+);
 357+
 358+/** Italian (Italiano)
 359+ * @author Darth Kule
 360+ */
 361+$messages['it'] = array(
 362+ 'pdf-desc' => 'Gestore per la visualizzazione di file PDF in modalità immagine',
 363+ 'pdf_no_metadata' => 'Impossibile ottenere i metadati da PDF',
 364+ 'pdf_page_error' => "Numero di pagina non compreso nell'intervallo",
 365+);
 366+
 367+/** Japanese (日本語)
 368+ * @author Fryed-peach
 369+ */
 370+$messages['ja'] = array(
 371+ 'pdf-desc' => 'PDFファイルを画像風に閲覧するためのハンドラ',
 372+ 'pdf_no_metadata' => 'PDFのメタデータを得ることができません',
 373+ 'pdf_page_error' => '範囲内にないページ番号',
 374+);
 375+
 376+/** Javanese (Basa Jawa)
 377+ * @author Meursault2004
 378+ */
 379+$messages['jv'] = array(
 380+ 'pdf_no_metadata' => 'Ora bisa olèh metadata saka PDF',
 381+);
 382+
 383+/** Georgian (ქართული)
 384+ * @author BRUTE
 385+ */
 386+$messages['ka'] = array(
 387+ 'pdf_no_metadata' => 'შეუძლებელია PDF-დან მეტამონაცემების მიღება',
 388+);
 389+
 390+/** Khmer (ភាសាខ្មែរ)
 391+ * @author Chhorran
 392+ * @author Lovekhmer
 393+ * @author Thearith
 394+ * @author គីមស៊្រុន
 395+ */
 396+$messages['km'] = array(
 397+ 'pdf-desc' => 'កម្មវិធីសំរាប់បើកមើលឯកសារ PDF ជាទំរង់រូបភាព',
 398+ 'pdf_no_metadata' => 'មិនអាចទទួលយកទិន្នន័យមេតាពី PDF បានទេ',
 399+ 'pdf_page_error' => 'គ្មានលេខទំព័រ ក្នុងដែនកំណត់',
 400+);
 401+
 402+/** Korean (한국어)
 403+ * @author Kwj2772
 404+ */
 405+$messages['ko'] = array(
 406+ 'pdf-desc' => 'PDF 파일을 이미지 방식으로 볼 수 있게 하는 핸들러',
 407+ 'pdf_no_metadata' => 'PDF 파일에서 메타데이터를 추출할 수 없습니다.',
 408+ 'pdf_page_error' => '쪽수가 범위 안에 있지 않습니다.',
 409+);
 410+
 411+/** Colognian (Ripoarisch)
 412+ * @author Purodha
 413+ */
 414+$messages['ksh'] = array(
 415+ 'pdf-desc' => 'Määt et müjjelesch, PDF-Dateie wie Bellder ze beloore.',
 416+ 'pdf_no_metadata' => 'Kann de Metta-Date nit fun dä PDF-Datei holle.',
 417+ 'pdf_page_error' => 'En Sigge-Nommer es ußerhallef',
 418+);
 419+
 420+/** Luxembourgish (Lëtzebuergesch)
 421+ * @author Robby
 422+ */
 423+$messages['lb'] = array(
 424+ 'pdf-desc' => '"Programm" den et erméiglecht PDF-Fichieren als Bild ze kucken',
 425+ 'pdf_no_metadata' => 'Meta-Informatiounen aus dem PDF Dokument kënnen net gelies ginn',
 426+ 'pdf_page_error' => "D'Säitenzuel ass net an dem Beräich.",
 427+);
 428+
 429+/** Limburgish (Limburgs)
 430+ * @author Ooswesthoesbes
 431+ */
 432+$messages['li'] = array(
 433+ 'pdf-desc' => "Hanjeltj PDF-bestenj aaf en maak 't meugelik die es aafbeildjing te zeen",
 434+ 'pdf_no_metadata' => 'Kèn gein metadata vanne PDF kriege',
 435+ 'pdf_page_error' => 'paginanómmer besteit neet',
 436+);
 437+
 438+/** Lithuanian (Lietuvių)
 439+ * @author Matasg
 440+ */
 441+$messages['lt'] = array(
 442+ 'pdf-desc' => 'Įrankis PDF failų peržiūrai vaizdo režime',
 443+ 'pdf_no_metadata' => 'Nepavyko gauti metaduomenų iš PDF',
 444+ 'pdf_page_error' => 'Puslapis numeris nėra diapazone',
 445+);
 446+
 447+/** Macedonian (Македонски)
 448+ * @author Bjankuloski06
 449+ * @author Brest
 450+ */
 451+$messages['mk'] = array(
 452+ 'pdf-desc' => 'Ракувач за прегледување PDF податотеки во сликовен режим',
 453+ 'pdf_no_metadata' => 'Не може да се земат метаподатоци од PDF',
 454+ 'pdf_page_error' => 'Бројот на страница е надвор од опсег',
 455+);
 456+
 457+/** Malayalam (മലയാളം)
 458+ * @author Praveenp
 459+ * @author Shijualex
 460+ */
 461+$messages['ml'] = array(
 462+ 'pdf-desc' => 'പി.ഡി.എഫ്. പ്രമാണങ്ങൾ ചിത്രരൂപത്തിൽ കാണുന്നതിനുള്ള കൈകാര്യോപകരണം',
 463+ 'pdf_no_metadata' => 'PDF-ൽ നിന്നു മെറ്റാഡാറ്റ ലഭിച്ചില്ല',
 464+ 'pdf_page_error' => 'താളിന്റെ ക്രമസംഖ്യ പരിധിയിലധികമാണ്',
 465+);
 466+
 467+/** Marathi (मराठी)
 468+ * @author Kaustubh
 469+ */
 470+$messages['mr'] = array(
 471+ 'pdf-desc' => 'चित्र मोड मध्ये पीडीएफ संचिका पाहण्यासाठी आवश्यक प्रणाली',
 472+ 'pdf_no_metadata' => 'पीडीएफ मधून मेटाडाटा घेऊ शकत नाही',
 473+ 'pdf_page_error' => 'पान क्रमांक सीमेमध्ये नाही',
 474+);
 475+
 476+/** Malay (Bahasa Melayu)
 477+ * @author Anakmalaysia
 478+ */
 479+$messages['ms'] = array(
 480+ 'pdf-desc' => 'Pengendali untuk melihat fail PDF dalam mod imej',
 481+ 'pdf_no_metadata' => 'Metadata tidak boleh diperoleh dari PDF',
 482+ 'pdf_page_error' => 'Nombor halaman tiada dalam julat',
 483+);
 484+
 485+/** Dutch (Nederlands)
 486+ * @author Siebrand
 487+ */
 488+$messages['nl'] = array(
 489+ 'pdf-desc' => 'Handelt PDF-bestanden af en maakt het mogelijk ze als afbeeldingen te bekijken',
 490+ 'pdf_no_metadata' => 'de metadata van de PDF kan niet uitgelezen worden',
 491+ 'pdf_page_error' => 'paginanummer komt niet voor in document',
 492+);
 493+
 494+/** Norwegian Nynorsk (‪Norsk (nynorsk)‬)
 495+ * @author Harald Khan
 496+ */
 497+$messages['nn'] = array(
 498+ 'pdf-desc' => 'Handering av PDF-vising i biletmodus',
 499+ 'pdf_no_metadata' => 'Kan ikkje henta metadata frå PDF',
 500+ 'pdf_page_error' => 'Sidenummer overstig talet på sider i dokumentet',
 501+);
 502+
 503+/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
 504+ * @author Jon Harald Søby
 505+ */
 506+$messages['no'] = array(
 507+ 'pdf-desc' => 'Håndtering av PDF-visning i bildemodus',
 508+ 'pdf_no_metadata' => 'kan ikke hente metadata fra PDF',
 509+ 'pdf_page_error' => 'Sidenummer overstiger antall sider i dokumentet',
 510+);
 511+
 512+/** Occitan (Occitan)
 513+ * @author Cedric31
 514+ */
 515+$messages['oc'] = array(
 516+ 'pdf-desc' => 'Utilitari per visualizar los fichièrs PDF en mòde imatge',
 517+ 'pdf_no_metadata' => 'Pòt pas obténer las metadonadas del fichièr PDF',
 518+ 'pdf_page_error' => 'Lo numèro de pagina es pas dins la gama.',
 519+);
 520+
 521+/** Oriya (ଓଡ଼ିଆ)
 522+ * @author Psubhashish
 523+ */
 524+$messages['or'] = array(
 525+ 'pdf-desc' => 'PDF ଫାଇଲକୁ ଛବି ମୋଡ଼ରେ ଦେଖିବାର ପରିଚାଳକ',
 526+ 'pdf_no_metadata' => 'ପି.ଡ଼ି.ଏଫ.ରୁ ମେଟାଡାଟା ବାହାର କରିପାରିଲୁଁ ନାହିଁ',
 527+ 'pdf_page_error' => 'ପୃଷ୍ଠା ସଂଖ୍ୟା ସୀମା ଭିତରେ ନାହିଁ',
 528+);
 529+
 530+/** Deitsch (Deitsch)
 531+ * @author Xqt
 532+ */
 533+$messages['pdc'] = array(
 534+ 'pdf_no_metadata' => 'Keene Meta-Daade im PDF',
 535+);
 536+
 537+/** Polish (Polski)
 538+ * @author Holek
 539+ * @author Sp5uhe
 540+ */
 541+$messages['pl'] = array(
 542+ 'pdf-desc' => 'Konwerter graficznego podglądu plików PDF',
 543+ 'pdf_no_metadata' => 'nie można pobrać metadanych z pliku PDF',
 544+ 'pdf_page_error' => 'Numer strony poza zakresem',
 545+);
 546+
 547+/** Piedmontese (Piemontèis)
 548+ * @author Dragonòt
 549+ */
 550+$messages['pms'] = array(
 551+ 'pdf-desc' => 'Ël gestor për vëdde ij file PDF an manera image',
 552+ 'pdf_no_metadata' => 'as peulo nen pijesse ij metadat dal PDF',
 553+ 'pdf_page_error' => "Ël nùmer ëd pàgina a l'é pa ant ël range",
 554+);
 555+
 556+/** Western Punjabi (پنجابی)
 557+ * @author Khalid Mahmood
 558+ */
 559+$messages['pnb'] = array(
 560+ 'pdf-desc' => 'پی ڈی ایف فائلاں امیج موڈ چ ویکھن لئی ہینڈلر',
 561+ 'pdf_no_metadata' => 'پی ڈی ایف توں میٹاڈیٹا نئیں مل سکیا۔',
 562+ 'pdf_page_error' => 'صفہ نمبر ولگن چ نئیں۔',
 563+);
 564+
 565+/** Portuguese (Português)
 566+ * @author Hamilton Abreu
 567+ * @author Malafaya
 568+ */
 569+$messages['pt'] = array(
 570+ 'pdf-desc' => 'Manuseador de visionamento de ficheiros PDF em modo de imagem',
 571+ 'pdf_no_metadata' => 'não foi possível obter os metadados do PDF',
 572+ 'pdf_page_error' => 'Número de página fora do intervalo',
 573+);
 574+
 575+/** Brazilian Portuguese (Português do Brasil)
 576+ * @author Eduardo.mps
 577+ */
 578+$messages['pt-br'] = array(
 579+ 'pdf-desc' => 'Manuseador de visualização de arquivos PDF em modo de imagem',
 580+ 'pdf_no_metadata' => 'Não foi possível obter os metadados do PDF',
 581+ 'pdf_page_error' => 'Número de página fora do intervalo',
 582+);
 583+
 584+/** Romanian (Română)
 585+ * @author Stelistcristi
 586+ */
 587+$messages['ro'] = array(
 588+ 'pdf-desc' => 'Operator pentru vizualizarea fișierelor PDF în modul de imagine',
 589+ 'pdf_no_metadata' => 'Nu se poate obține metadate din PDF',
 590+ 'pdf_page_error' => 'Numărul paginii nu e în șir',
 591+);
 592+
 593+/** Tarandíne (Tarandíne)
 594+ * @author Joetaras
 595+ */
 596+$messages['roa-tara'] = array(
 597+ 'pdf-desc' => 'Gestore pe vedè le file PDF in mode immaggine',
 598+ 'pdf_no_metadata' => "Non ge pozze pigghià le metadata da 'u PDF",
 599+ 'pdf_page_error' => "Numere de pàgene fore da l'indervalle",
 600+);
 601+
 602+/** Russian (Русский)
 603+ * @author Александр Сигачёв
 604+ */
 605+$messages['ru'] = array(
 606+ 'pdf-desc' => 'Обработчик для просмотра PDF-файлов в виде изображений',
 607+ 'pdf_no_metadata' => 'невозможно получить метаданные из PDF',
 608+ 'pdf_page_error' => 'Номер страницы вне диапазона',
 609+);
 610+
 611+/** Rusyn (Русиньскый)
 612+ * @author Gazeb
 613+ */
 614+$messages['rue'] = array(
 615+ 'pdf-desc' => 'Овладач про перегляд PDF файлів як образків',
 616+ 'pdf_no_metadata' => 'Не годен обтримати метадата з PDF',
 617+ 'pdf_page_error' => 'Чісло сторінкы не є в россягу',
 618+);
 619+
 620+/** Sakha (Саха тыла)
 621+ * @author HalanTul
 622+ */
 623+$messages['sah'] = array(
 624+ 'pdf-desc' => 'PDF билэлэри ойуу курдук көрдөрөөччү',
 625+ 'pdf_no_metadata' => 'PDF-тан мета дааннайдарын ылар кыах суох',
 626+ 'pdf_page_error' => 'Сирэй нүөмэрэ диапазоҥҥа киирбэт',
 627+);
 628+
 629+/** Sinhala (සිංහල)
 630+ * @author Budhajeewa
 631+ */
 632+$messages['si'] = array(
 633+ 'pdf-desc' => 'PDF ගොනු රූප මාදිලියෙන් හසුරුවනය',
 634+ 'pdf_no_metadata' => 'PDF ගොනුවෙන් මෙටාදත්ත ගත නොහැක',
 635+ 'pdf_page_error' => 'පිටු අංකය නිවැරදි පරාසයේ නොමැත',
 636+);
 637+
 638+/** Slovak (Slovenčina)
 639+ * @author Helix84
 640+ */
 641+$messages['sk'] = array(
 642+ 'pdf-desc' => 'Obsluha zobrazovania PDF súborov v režime obrázkov',
 643+ 'pdf_no_metadata' => 'nie je možné získať metadáta z PDF',
 644+ 'pdf_page_error' => 'Číslo stránky nie je v intervale',
 645+);
 646+
 647+/** Slovenian (Slovenščina)
 648+ * @author Dbc334
 649+ */
 650+$messages['sl'] = array(
 651+ 'pdf-desc' => 'Upravljavec ogledovanja datotek PDF v slikovnem načinu',
 652+ 'pdf_no_metadata' => 'Ne morem pridobiti metapodatkov iz PDF',
 653+ 'pdf_page_error' => 'Številka strani ni v dosegu',
 654+);
 655+
 656+/** Albanian (Shqip)
 657+ * @author Olsi
 658+ */
 659+$messages['sq'] = array(
 660+ 'pdf-desc' => 'Mbajtës për pamjen e skedave PDF në mënyrën e figurave',
 661+ 'pdf_no_metadata' => 'Nuk mund të merren metadata nga PDF',
 662+ 'pdf_page_error' => 'Numri i faqes nuk është në varg',
 663+);
 664+
 665+/** Serbian (Cyrillic script) (‪Српски (ћирилица)‬)
 666+ * @author Rancher
 667+ * @author Михајло Анђелковић
 668+ */
 669+$messages['sr-ec'] = array(
 670+ 'pdf-desc' => 'Програм за прегледање PDF докумената у сликовном режиму',
 671+ 'pdf_no_metadata' => 'Не могу да преузмем метаподатке из PDF-а',
 672+ 'pdf_page_error' => 'Број страница ван опсега',
 673+);
 674+
 675+/** Serbian Latin ekavian (‪Srpski (latinica)‬)
 676+ * @author Michaello
 677+ */
 678+$messages['sr-el'] = array(
 679+ 'pdf-desc' => 'Handler za pregled PDF fajlova kao slika',
 680+ 'pdf_no_metadata' => 'Ne mogu se dobiti meta-podaci iz PDF-a',
 681+ 'pdf_page_error' => 'Broj strane izlazi van opsega',
 682+);
 683+
 684+/** Seeltersk (Seeltersk)
 685+ * @author Pyt
 686+ */
 687+$messages['stq'] = array(
 688+ 'pdf-desc' => 'Snitsteede foar dät Bekiekjen fon PDF-Doatäie in dän Bielde-Modus',
 689+ 'pdf_no_metadata' => 'Neen Metadoaten in dät PDF deer.',
 690+ 'pdf_page_error' => 'Siedentaal buute Riege.',
 691+);
 692+
 693+/** Swedish (Svenska)
 694+ * @author M.M.S.
 695+ */
 696+$messages['sv'] = array(
 697+ 'pdf-desc' => 'Hantering av PDF-visning i bildläge',
 698+ 'pdf_no_metadata' => 'Kan inte hämta metadata från PDF',
 699+ 'pdf_page_error' => 'Sidnummer överstiger antal sidor i dokumentet',
 700+);
 701+
 702+/** Tamil (தமிழ்)
 703+ * @author TRYPPN
 704+ */
 705+$messages['ta'] = array(
 706+ 'pdf_page_error' => 'பக்கத்தின் எண் குறிப்பிட்ட வரையறையில் இல்லை',
 707+);
 708+
 709+/** Telugu (తెలుగు)
 710+ * @author Veeven
 711+ */
 712+$messages['te'] = array(
 713+ 'pdf_page_error' => 'పుట సంఖ్య అవధిలో లేదు',
 714+);
 715+
 716+/** Turkmen (Türkmençe)
 717+ * @author Hanberke
 718+ */
 719+$messages['tk'] = array(
 720+ 'pdf-desc' => 'PDF faýllaryny görkeziş režiminde görkezmek üçin işleýji',
 721+ 'pdf_no_metadata' => 'PDF-den meta-maglumat alyp bolanok',
 722+ 'pdf_page_error' => 'Sahypa belgisi diapazonda däl',
 723+);
 724+
 725+/** Tagalog (Tagalog)
 726+ * @author AnakngAraw
 727+ */
 728+$messages['tl'] = array(
 729+ 'pdf-desc' => 'Tagapaghawak para sa pagtanaw ng mga talaksang PDF na nasa modalidad na panglarawan',
 730+ 'pdf_no_metadata' => 'Hindi makuha ang dato ng meta mula sa PDF',
 731+ 'pdf_page_error' => 'Wala sa sakop ang bilang ng pahina',
 732+);
 733+
 734+/** Turkish (Türkçe)
 735+ * @author Joseph
 736+ */
 737+$messages['tr'] = array(
 738+ 'pdf-desc' => 'PDF dosyalarını görüntü modunda görüntülemek için işleyici',
 739+ 'pdf_no_metadata' => "PDF'den metadata alınamıyor",
 740+ 'pdf_page_error' => 'Sayfa numarası aralıkta değil',
 741+);
 742+
 743+/** Ukrainian (Українська)
 744+ * @author Prima klasy4na
 745+ */
 746+$messages['uk'] = array(
 747+ 'pdf-desc' => 'Оброблювач для перегляду PDF-файлів в режимі зображень',
 748+ 'pdf_no_metadata' => 'Не виходить отримати метадані з PDF',
 749+ 'pdf_page_error' => 'Номер сторінки не в діапазоні',
 750+);
 751+
 752+/** Vèneto (Vèneto)
 753+ * @author Candalua
 754+ */
 755+$messages['vec'] = array(
 756+ 'pdf-desc' => 'Handler par vardar i file PDF in modalità imagine',
 757+ 'pdf_no_metadata' => 'No se riesse a recuperar i metadati dal PDF',
 758+ 'pdf_page_error' => "Nùmaro de pagina mia conpreso in te l'intervalo",
 759+);
 760+
 761+/** Vietnamese (Tiếng Việt)
 762+ * @author Vinhtantran
 763+ */
 764+$messages['vi'] = array(
 765+ 'pdf-desc' => 'Bộ xử lý để xem tập tin PDF ở dạng hình ảnh',
 766+ 'pdf_no_metadata' => 'Không thấy truy xuất siêu dữ liệu từ PDF',
 767+ 'pdf_page_error' => 'Số trang không nằm trong giới hạn',
 768+);
 769+
 770+/** Yoruba (Yorùbá)
 771+ * @author Demmy
 772+ */
 773+$messages['yo'] = array(
 774+ 'pdf_no_metadata' => 'Dátà-àtẹ̀yìnwá kó ṣe é mú láti inú PDF',
 775+);
 776+
 777+/** Cantonese (粵語) */
 778+$messages['yue'] = array(
 779+ 'pdf-desc' => '響圖像模式睇PDF檔嘅處理器',
 780+ 'pdf_no_metadata' => '唔能夠響PDF度拎metadata',
 781+ 'pdf_page_error' => '頁數唔響範圍度',
 782+);
 783+
 784+/** Simplified Chinese (‪中文(简体)‬) */
 785+$messages['zh-hans'] = array(
 786+ 'pdf-desc' => '在图像方式中PDF档的处理器',
 787+ 'pdf_no_metadata' => '无法在PDF中撷取元数据',
 788+ 'pdf_page_error' => '页数不在范围中',
 789+);
 790+
 791+/** Traditional Chinese (‪中文(繁體)‬)
 792+ * @author Mark85296341
 793+ */
 794+$messages['zh-hant'] = array(
 795+ 'pdf-desc' => '在圖片模式中 PDF 檔的處理器',
 796+ 'pdf_no_metadata' => '無法在 PDF 中擷取元數據',
 797+ 'pdf_page_error' => '頁數不在範圍中',
 798+);
 799+
Property changes on: branches/vitalif/extensions/PdfHandler/PdfHandler.i18n.php
___________________________________________________________________
Added: svn:eol-style
1800 + native
Index: branches/vitalif/extensions/PdfHandler/PdfHandler.php
@@ -0,0 +1,64 @@
 2+<?php
 3+/**
 4+ * PDF Handler extension -- handler for viewing PDF files in image mode.
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ * @author Martin Seidel (Xarax) <jodeldi@gmx.de>
 9+ * @copyright Copyright © 2007 Martin Seidel (Xarax) <jodeldi@gmx.de>
 10+ *
 11+ * This program is free software; you can redistribute it and/or modify
 12+ * it under the terms of the GNU General Public License as published by
 13+ * the Free Software Foundation; either version 2 of the License, or
 14+ * (at your option) any later version.
 15+ *
 16+ * This program is distributed in the hope that it will be useful,
 17+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 18+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 19+ * GNU General Public License for more details.
 20+ *
 21+ * You should have received a copy of the GNU General Public License along
 22+ * with this program; if not, write to the Free Software Foundation, Inc.,
 23+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 24+ * http://www.gnu.org/copyleft/gpl.html
 25+ */
 26+
 27+# Not a valid entry point, skip unless MEDIAWIKI is defined
 28+if ( !defined( 'MEDIAWIKI' ) ) {
 29+ echo 'PdfHandler extension';
 30+ exit( 1 );
 31+}
 32+
 33+$wgExtensionCredits['media'][] = array(
 34+ 'path' => __FILE__,
 35+ 'name' => 'PDF Handler',
 36+ 'author' => array( 'Martin Seidel', 'Mike Połtyn'),
 37+ 'descriptionmsg' => 'pdf-desc',
 38+ 'url' => 'http://www.mediawiki.org/wiki/Extension:PdfHandler',
 39+);
 40+
 41+// External program requirements...
 42+$wgPdfProcessor = 'gs';
 43+$wgPdfPostProcessor = 'convert';
 44+$wgPdfInfo = 'pdfinfo';
 45+$wgPdftoText = 'pdftotext';
 46+
 47+$wgPdfOutputExtension = 'jpg';
 48+$wgPdfHandlerDpi = 150;
 49+
 50+// This setting, if enabled, will put creating thumbnails into a job queue,
 51+// so they do not have to be created on-the-fly,
 52+// but rather inconspicuously during normal wiki browsing
 53+$wgPdfCreateThumbnailsInJobQueue = false;
 54+
 55+// To upload new PDF files you'll need to do this too:
 56+// $wgFileExtensions[] = 'pdf';
 57+
 58+$dir = dirname( __FILE__ ) . '/';
 59+$wgExtensionMessagesFiles['PdfHandler'] = $dir . 'PdfHandler.i18n.php';
 60+$wgAutoloadClasses['PdfImage'] = $dir . 'PdfHandler.image.php';
 61+$wgAutoloadClasses['PdfHandler'] = $dir . 'PdfHandler_body.php';
 62+$wgAutoloadClasses['CreatePdfThumbnailsJob'] = $dir . 'CreatePdfThumbnailsJob.class.php';
 63+$wgMediaHandlers['application/pdf'] = 'PdfHandler';
 64+$wgJobClasses['createPdfThumbnailsJob'] = 'CreatePdfThumbnailsJob';
 65+$wgHooks['UploadVerifyFile'][] = 'CreatePdfThumbnailsJob::insertJobs';
Property changes on: branches/vitalif/extensions/PdfHandler/PdfHandler.php
___________________________________________________________________
Added: svn:keywords
166 + LastChangedDate LastChangedRevision
Added: svn:eol-style
267 + native
Index: branches/vitalif/extensions/PdfHandler/PdfHandler.image.php
@@ -0,0 +1,141 @@
 2+<?php
 3+/**
 4+ *
 5+ * Copyright © 2007 Xarax <jodeldi@gmx.de>
 6+ *
 7+ * This program is free software; you can redistribute it and/or modify
 8+ * it under the terms of the GNU General Public License as published by
 9+ * the Free Software Foundation; either version 2 of the License, or
 10+ * (at your option) any later version.
 11+ *
 12+ * This program is distributed in the hope that it will be useful,
 13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 15+ * GNU General Public License for more details.
 16+ *
 17+ * You should have received a copy of the GNU General Public License along
 18+ * with this program; if not, write to the Free Software Foundation, Inc.,
 19+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 20+ * http://www.gnu.org/copyleft/gpl.html
 21+ */
 22+
 23+/**
 24+ * inspired by djvuimage from Brion Vibber
 25+ * modified and written by xarax
 26+ */
 27+
 28+class PdfImage {
 29+
 30+ function __construct( $filename ) {
 31+ $this->mFilename = $filename;
 32+ }
 33+
 34+ public function isValid() {
 35+ return true;
 36+ }
 37+
 38+ public function getImageSize() {
 39+ $data = $this->retrieveMetadata();
 40+ $size = self::getPageSize( $data, 1 );
 41+
 42+ if( $size ) {
 43+ $width = $size['width'];
 44+ $height = $size['height'];
 45+ return array( $width, $height, 'Pdf',
 46+ "width=\"$width\" height=\"$height\"" );
 47+ }
 48+ return false;
 49+ }
 50+
 51+ public static function getPageSize( $data, $page ) {
 52+ global $wgPdfHandlerDpi;
 53+
 54+ if( isset( $data['pages'][$page]['Page size'] ) ) {
 55+ $o = $data['pages'][$page]['Page size'];
 56+ } elseif( isset( $data['Page size'] ) ) {
 57+ $o = $data['Page size'];
 58+ } else {
 59+ $o = false;
 60+ }
 61+
 62+ if ( $o ) {
 63+ $size = explode( 'x', $o, 2 );
 64+
 65+ if ( $size ) {
 66+ $width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
 67+ $height = explode( ' ', trim( $size[1] ), 2 );
 68+ $height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
 69+
 70+ return array(
 71+ 'width' => $width,
 72+ 'height' => $height
 73+ );
 74+ }
 75+ }
 76+
 77+ return false;
 78+ }
 79+
 80+ public function retrieveMetaData() {
 81+ global $wgPdfInfo, $wgPdftoText;
 82+
 83+ if ( $wgPdfInfo ) {
 84+ wfProfileIn( 'pdfinfo' );
 85+ $cmd = wfEscapeShellArg( $wgPdfInfo ) .
 86+ " -enc UTF-8 " . # Report metadata as UTF-8 text...
 87+ " -l 9999999 " . # Report page sizes for all pages
 88+ wfEscapeShellArg( $this->mFilename );
 89+ $retval = '';
 90+ $dump = wfShellExec( $cmd, $retval );
 91+ $data = $this->convertDumpToArray( $dump );
 92+ wfProfileOut( 'pdfinfo' );
 93+ } else {
 94+ $data = null;
 95+ }
 96+
 97+ # Read text layer
 98+ if ( isset( $wgPdftoText ) ) {
 99+ wfProfileIn( 'pdftotext' );
 100+ $cmd = wfEscapeShellArg( $wgPdftoText ) . ' '. wfEscapeShellArg( $this->mFilename ) . ' - ';
 101+ wfDebug( __METHOD__.": $cmd\n" );
 102+ $retval = '';
 103+ $txt = wfShellExec( $cmd, $retval );
 104+ wfProfileOut( 'pdftotext' );
 105+ if( $retval == 0 ) {
 106+ $txt = str_replace( "\r\n", "\n", $txt );
 107+ $pages = explode( "\f", $txt );
 108+ foreach( $pages as $page => $pageText ) {
 109+ # Get rid of invalid UTF-8, strip control characters
 110+ # Note we need to do this per page, as \f page feed would be stripped.
 111+ $pages[$page] = UtfNormal::cleanUp( $pageText );
 112+ }
 113+ $data['text'] = $pages;
 114+ }
 115+ }
 116+ return $data;
 117+ }
 118+
 119+ protected function convertDumpToArray( $dump ) {
 120+ if ( strval( $dump ) == '' ) {
 121+ return false;
 122+ }
 123+
 124+ $lines = explode( "\n", $dump );
 125+ $data = array();
 126+
 127+ foreach( $lines as $line ) {
 128+ $bits = explode( ':', $line, 2 );
 129+ if( count( $bits ) > 1 ) {
 130+ $key = trim( $bits[0] );
 131+ $value = trim( $bits[1] );
 132+ $matches = array();
 133+ if( preg_match( '/^Page +(\d+) size$/', $key, $matches ) ) {
 134+ $data['pages'][$matches[1]]['Page size'] = $value;
 135+ } else {
 136+ $data[$key] = $value;
 137+ }
 138+ }
 139+ }
 140+ return $data;
 141+ }
 142+}
Property changes on: branches/vitalif/extensions/PdfHandler/PdfHandler.image.php
___________________________________________________________________
Added: svn:eol-style
1143 + native

Status & tagging log