Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing CSS with wkhtmltopdf 0.12.6 #315

Closed
nook24 opened this issue Apr 26, 2021 · 0 comments
Closed

Missing CSS with wkhtmltopdf 0.12.6 #315

nook24 opened this issue Apr 26, 2021 · 0 comments

Comments

@nook24
Copy link

nook24 commented Apr 26, 2021

Since wkhtmltopdf 0.12.6 it is required to pass the option --enable-local-file-access.

With CakePdf you can already set this flag via config/bootstrap.php for example:

Configure::write('CakePdf', [
    'engine' => [
        'className' => 'CakePdf.WkHtmlToPdf',
        'binary'    => '/usr/local/bin/wkhtmltopdf',
        'options'   => [
            'print-media-type' => true,
            'outline'          => true,
            'dpi'              => 96,
            'enable-local-file-access' => true, // <-- This is the important part
        ],
    ],
]);

Without this option wkhtmltopdf will not load any images or css files.


This is not a bug report. The idea behind this issue is that people with the same problem can find this information via search engines.
Sources:

@ADmad ADmad closed this as completed in 0790bf8 Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant