Knp Snappy Bundle Options
Asked Answered
I

2

9

I'm using KnpSnappyBundle for my Symfony project and I'm trying to define some options in my config file. However if I set, for example:

knp_snappy:
    pdf:
        enabled:    true
        binary:     /usr/local/bin/wkhtmltopdf
        options:    [ 'no-outline' ]

I get an error: The option '0' does not exist.

How do I define options for the bundle?

Impuissant answered 29/1, 2013 at 16:47 Comment(0)
I
15

Well, that was kinda dumb of me. YAML to the answer:

knp_snappy:
    pdf:
        enabled:    true
        binary:     /usr/local/bin/wkhtmltopdf
        options:
            no-outline: true
Impuissant answered 30/1, 2013 at 10:0 Comment(0)
R
0

The answer is:

knp_snappy:
    pdf:
        enabled: true
        binary: /path/to/wkhtmltopdf
        options:
            - { name: 'page-size', value: 'A4' }
Ringo answered 29/3, 2017 at 17:20 Comment(1)
This is very similar to the accepted answer, could you add a short description to explain the difference? Thank you!Landy

© 2022 - 2024 — McMap. All rights reserved.