Open MarcelloDM opened 2 years ago
After installing by Composer, I tried to run the script generate.sh by shell/dos. The execution failed. PDFs are generate but not correctly encoded on opening as follow (i.e. about.php):
Every test php file into the examples directory references to the autoload.php and all *.php files as follow:
require_once dirname(__FILE__).'/../vendor/autoload.php';
include dirname(__FILE__).'/res/about.php';
We need to change path locations in every php script file by using escape characters " \\ ":
require_once dirname(__FILE__, 5).'\\vendor\\autoload.php';
include dirname(__FILE__).'\\res\\*.php';
$html2pdf->pdf->AddPage();
We need to add $html2pdf->pdf->AddPage();
to generation pdf script file before writeHTML() method.
After changing, all PDFs works.
The method dirname(__FILE__)
returns a simple string and Windows does not consider "/" as path separator among files
The PHP doc here.
I get the error by by running example scripts .ps1 and .sh to test located in the module path ..
\vendor\spipu\html2pdf\test
. _Any other got this problem? Thanks in advance.