Open alejoblue opened 3 years ago
Just run the composer on your theme folder, then use the require command at the top of your functions.php
Then you should be able to use the class
Hello, I tried but I have this error :
Fatal error: Uncaught Error: Class 'Spipu\Html2Pdf\Html2Pdf' not found in C:\xampp\htdocs\wordpress\wp-content\plugins\agence\agence.php:12
There my code :
<?php
/**
* Plugin Name: Agence Plugin
*/
use Spipu\Html2Pdf\Html2Pdf;
add_action('init', 'generate_pdf');
function generate_pdf()
{
$html2pdf = new Html2Pdf();
$html2pdf->writeHTML('<h1 style="color:pink;">CodeWall PDF</h1> <br/> <p>Convert this HTML to PDF please!</p>');
$html2pdf->output('myPdf.pdf, F');
}
Thanks
I juste missed to write this
require_once 'vendor/autoload.php';
I juste missed to write this
require_once 'vendor/autoload.php';
It did worked ?
I used the same code than you (I've just changed the path of require_once). It doesn't give a pdf file : https://zupimages.net/up/21/49/lj9n.png
I don't think so ^^ I changed for Dompdf and it's work well.
^^ thanks
Hey there! I can't find a way to install html2pdf on a wordpress site. Is there a plugin or how can i do it manually?
After installation how can I make it work with Contact Form 7 plugin?
thanks in advanced