phpgearbox / pdf

A PDF builder using HTML or DOCX templates.
MIT License
180 stars 112 forks source link

Unrecognised document type! #9

Open tibortoth9182 opened 7 years ago

tibortoth9182 commented 7 years ago

Hey!

Firstly, I got the "same String class" error, but i fixed that.

Than i got this: Fatal error: Uncaught exception 'RuntimeException' with message 'Unrecognised document type!' in C:\xampp\htdocs\gyak\IBC\PDFGear\vendor\gears\pdf\src\Pdf.php:133 Stack trace: #0 C:\xampp\htdocs\PDFGear\vendor\gears\pdf\src\Pdf.php(161): Gears\Pdf->__construct('/dir/document.d...', Array) #1 C:\xampp\htdocs\PDFGear\index.php(4): Gears\Pdf::convert('/dir/document.d...', 'document.pdf') #2 {main} thrown in C:\xampp\htdocs\PDFGear\vendor\gears\pdf\src\Pdf.php on line 133

My code: <?php require('vendor/autoload.php'); Gears\Pdf::convert('document.docx', 'document.pdf'); ?>

Did I something wrong?

Hiros101 commented 7 years ago

In my case it happen due to wrong path to import file, so just check if file exists and path is correct.