xrow/pdfpreview-ls

generate preview images of pdf files

Installs: 5 572

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 14

Forks: 2

Open Issues: 0

Type:ezpublish-legacy-extension

2.0.2 2017-09-27 14:07 UTC

This package is auto-updated.

Last update: 2021-11-15 20:13:15 UTC


README

<code>
/*
    PDF preview for eZ Publish
    Copyright (C) 2014  xrow GmbH, Hannover Germany, http://xrow.com

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
*/

### BEGIN INIT INFO
# Provides:          pdfpreview
# Depends:		     imagemagick + ghostscript
# OS:			     Linux, FreeBSD, Windows
# Version:		     > eZ 4.x
# Developed:	     Björn Dieding  ( bjoern [at] xrow [dot] de )
# Short-Description: PDF Preview image generator
# Description:       Generates an image from a single PDF page  
# Resources:	     http://projects.ez.no/pdfpreview
### END INIT INFO
</code>

#### Setup ####

install imagemagick + ghostscript + activate extension + run autoloads + clear cache

allow to access your "cache/pdfpreview" folder in your htaccess example:

RewriteRule ^var/([^/]+/)?(storage/images(-versioned)?|original/video|original/text|cache/public|cache/pdfpreview|storage/cam-cache)/.* index_cluster.php

Add a attribute with the identifier "preview_page_number" of the datatype "integer" to the file class

#### Usage ####

pathtofile|pdfpreview( width, height, attribute_id, attribute_version, pdfpage )

example:

<code>
{if $node.object.data_map.file.content.mime_type|eq('application/pdf')}
    <img src={$node.object.data_map.file.content.filepath|pdfpreview( 88, 88, 13234, 5, 1 )|ezroot()} alt="Preview">
{/if}
</code>

### Deleting the Preview Images ####

php bin\php\ezcache.php --clear-id=pdfpreview --purge

#### Troubleshooting ####

Look into the debug output
For further information contact service [at] xrow [dot] de