Bonjour,

Je souhaite interfacé wkhtmltopdf avec le script PHP WkHtmlToPdf en local. Mais, je n'y arrive pas du tout.
Voici ce que j'ai fait :
  1. J'ai installé wkhtmltopdf (ubuntu 20)
  2. J'ai installé php-cli
  3. J'ai installé via composer phpwkhtmltopdf

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
 
require 'vendor/autoload.php';
 
require 'vendor/mikehaertl/phpwkhtmltopdf/src/Pdf.php';
 
use mikehaertl\wkhtmlto\Pdf;
 
// You can pass a filename, a HTML string, an URL or an options array to the constructor
$pdf = new Pdf('01.html');
 
// On some systems you may have to set the path to the wkhtmltopdf executable
$pdf->binary = '/user/local/bin/wkhtmltopdf';
 
if (!$pdf->saveAs('01.pdf')) {
    $error = $pdf->getError();
    // ... handle error here
}
?>
Or, rien ne se passe, pas de PDF généré et aucun message d'erreur
Quelqu'un pourrai t-il m'aider ?