parameters:
    kunstmaan_media.pdf_transformer.class: 'Kunstmaan\MediaBundle\Helper\Transformer\PdfTransformer'
    kunstmaan_media.media_handler.pdf.class: 'Kunstmaan\MediaBundle\Helper\File\PdfHandler'

services:
    kunstmaan_media.imagick:
        class: 'Imagick'

    kunstmaan_media.pdf_transformer:
        class: '%kunstmaan_media.pdf_transformer.class%'
        arguments: ['@kunstmaan_media.imagick']

    kunstmaan_media.media_handlers.pdf:
        class: '%kunstmaan_media.media_handler.pdf.class%'
        parent: kunstmaan_media.media_handlers.file
        arguments: [1, '@mime_types']
        calls:
            - [ setMediaPath, [ '%kernel.project_dir%' ] ]
            - [ setPdfTransformer, [ '@kunstmaan_media.pdf_transformer' ]]
        tags:
            -  { name: 'kunstmaan_media.media_handler' }

    kunstmaan_media.command.createpdfpreview:
        class: Kunstmaan\MediaBundle\Command\CreatePdfPreviewCommand
        arguments:
            - '@doctrine.orm.entity_manager'
            - '@kunstmaan_media.pdf_transformer'
            - '%kunstmaan_media.web_root%'
            - '%kunstmaan_media.enable_pdf_preview%'
        tags:
            - { name: console.command }
