Documentation · ViewHelper reference

XSD schema file | vhs master

Media / PdfThumbnailViewHelper

Converts the provided PDF file into a PNG thumbnail and renders the according image tag using Fluid's standard image ViewHelper thus implementing its arguments. For PDF documents with multiple pages the first page is rendered by default unless specified. /

  • Tag usage example

    <v:media.pdfThumbnail src="[mixed]" relative="1" width="NULL" height="NULL" maxW="123" maxH="123" minW="123" minH="123" format="NULL" quality="123" treatIdAsReference="1" canvasWidth="123" canvasHeight="123" canvasColor="NULL" crop="NULL" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" usemap="NULL" ismap="''" alt="NULL" srcset="[mixed]" srcsetDefault="123" path="NULL" minWidth="123" minHeight="123" maxWidth="123" maxHeight="123" density="123" background="NULL" rotate="123" page="123" forceOverwrite="1">
    	<!-- tag content - may be ignored! -->
    </v:media.pdfThumbnail>
  • Inline usage example

    {v:media.pdfThumbnail(src: [mixed], relative: 1, width: 'NULL', height: 'NULL', maxW: 123, maxH: 123, minW: 123, minH: 123, format: 'NULL', quality: 123, treatIdAsReference: 1, canvasWidth: 123, canvasHeight: 123, canvasColor: 'NULL', crop: 'NULL', class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL', usemap: 'NULL', ismap: '''', alt: 'NULL', srcset: [mixed], srcsetDefault: 123, path: 'NULL', minWidth: 123, minHeight: 123, maxWidth: 123, maxHeight: 123, density: 123, background: 'NULL', rotate: 123, page: 123, forceOverwrite: 1)}

Arguments

Argument Description Type
accesskey

Keyboard shortcut to access this element

string
alt

Equivalent content for those who cannot process images or who have image loading disabled.

string
background

Fill background of resulting image with this color (for transparent source files)

string
canvasColor

Background color of an optional canvas to place the image on (hex triplet).

string
canvasHeight

Height of an optional canvas to place the image on.

integer
canvasWidth

Width of an optional canvas to place the image on.

integer
class

CSS class(es) for this element

string
crop

Information generated by the backend's graphical cropping UI

string
density

Canvas resolution for rendering the PDF in dpi (higher means better quality)

integer
dir

Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

string
forceOverwrite

Forcibly overwrite existing converted PDF files

boolean
format

Format of the processed file - also determines the target file format. If blank, TYPO3/IM/GM default is taken into account.

string
height

Height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

string
id

Unique (in this file) identifier for this HTML element.

string
ismap

Specifies that its img element provides access to a server-side image map.

string
lang

Language for this element. Use short names specified in RFC 1766

string
maxH

Maximum Height of the image. (no upscaling)

integer
maxHeight

DEPRECATED: Use maxH instead

integer
maxW

Maximum Width of the image. (no upscaling)

integer
maxWidth

DEPRECATED: Use maxW instead

integer
minH

Minimum Height of the image.

integer
minHeight

DEPRECATED: Use minH instead

integer
minW

Minimum Width of the image.

integer
minWidth

DEPRECATED: Use minW instead

integer
onclick

JavaScript evaluated for the onclick event

string
page

Optional page number to render as thumbnail for PDF documents with multiple pages

integer
path

DEPRECATED: Use src instead

string
quality

Quality of the processed image. If blank/not present falls back to the default quality defined in install tool.

integer
relative

If FALSE media URIs are rendered absolute. URIs in backend mode are always absolute.

boolean
rotate

Number of degress to rotate resulting image by (caution: very slow if not multiple of 90)

integer
src

Path to the media resource(s). Can contain single or multiple paths for videos/audio (either CSV, array or implementing Traversable).

mixed
srcset

List of width used for the srcset variants (either CSV, array or implementing Traversable)

mixed
srcsetDefault

Default width to use as a fallback for browsers that don't support srcset

integer
style

Individual CSS styles for this element

string
tabindex

Specifies the tab order of this element

integer
title

Tooltip text of element

string
treatIdAsReference

When TRUE treat given src argument as sysfilereference record. Applies only to TYPO3 6.x and above.

boolean
usemap

A hash-name reference to a map element with which to associate the image.

string
width

Width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

string
Required attribute

Revision history

commit 2bb7515b35b4c5e4956fe31eb53bef7f79dd890a
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Thu Nov 28 23:15:57 2013 +0100

    [FEATURE] Add PDF thumbnail viewhelper

commit 67362ef888b294d00e8400d657bfdea1497744a6
Author: Cedric Ziel <*****@cedric-ziel.com>
Date:   Sat Nov 30 16:34:00 2013 +0100

    [TASK] Add "pdf" prefix to generated PDF thumbnails
    
    This adds a dead-simple pdf prefix to the generated filename.
    That way, one is able to simply delete all vhs-pdf-* files
    from typo3temp without much hassle after fiddeling with ImageMagick

commit d2e531da034976e6db1478eef5a8478595fd16fe
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Jan 5 00:45:10 2014 +0100

    [TASK] Migrate to using namespace core class names

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit 911bc98465b77beda94f69f283123591bc316271
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sat Jun 7 22:44:57 2014 +0200

    [BUGFIX] Remove already defined Arguments from PdfThumbnailViewHelper

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to license.md file