You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 24, 2020. It is now read-only.
<?php
//include('autoload.php');
include('h2p/autoloader.php');
use H2P\Converter\PhantomJS;
use H2P\TempFile;
$filename = time();
$converter = new PhantomJS();
$input = new TempFile('<html>THIS IS A TEST</html>', 'html'); // Make sure the 2nd parameter is 'html'
// Convert destination accepts H2P\TempFile or string with the path to save the file
$converter->convert($input, $filename.'.pdf');
?>
The PDF is generated but it's 0 KB and Adobe Reader says it's corrupted when trying to open it.
My application is currently running on Windows 10 (via XAMPP) and I've put PhantomJS.exe (version 2.1) in h2p/bin/win32 folder.
No error are reported, even in console.
The PHP page that is running the script is placed in the root.
I'm using this simple code to generate a PDF:
The PDF is generated but it's 0 KB and Adobe Reader says it's corrupted when trying to open it.
My application is currently running on Windows 10 (via XAMPP) and I've put PhantomJS.exe (version 2.1) in h2p/bin/win32 folder.
No error are reported, even in console.
The PHP page that is running the script is placed in the root.
Any suggestion?