mikehaertl / phpwkhtmltopdf

A slim PHP wrapper around wkhtmltopdf with an easy to use and clean OOP interface
MIT License
1.6k stars 238 forks source link

Blocked access to file #379

Closed strtob closed 2 years ago

strtob commented 2 years ago

Hi,

I'm new with wkhtmltopdf.

Unfortunately, I'm suffering from this error:

Loading pages (1/6) [> ] 0% [======> ] 10% Warning: Blocked access to file Warning: Blocked access to file Warning:

I've tried to set the option "enable-local-file-access" => true but phpwkhtmltopdf tell me, that this option not exist.

A helping idea, I would appreciate!

Thanks a lot... Toby

mikehaertl commented 2 years ago

You must pass the options in a wrong way. The library does not restrict any options and enable-local-file-access works fine for me. You should not use true as value, though, but simply pass it like this:

<?php
$pdf = new Pdf([
    'enable-local-file-access',
    // ...
]);