I have the following problem when I call $reader->extractXML($pdfFile);.
The PDF is attached.
What could be causing the problem?
Unable to get Factur-X Xml from PDF : Exception: Invalid PDF data: missing %PDF header. in /home/www-data/vendor/smalot/pdfparser/src/Smalot/PdfParser/RawData/RawDataParser.php:945
Stack trace:
Hello @JanickSYSL,
You should use Reader to extract data from pdf content and not from pdf filename.
See : \Atgp\FacturX\Reader::extractXML(pdfBinary)
@param string $pdfBinary content of the PDF invoice
I have the following problem when I call $reader->extractXML($pdfFile);.
The PDF is attached. What could be causing the problem?
Unable to get Factur-X Xml from PDF : Exception: Invalid PDF data: missing %PDF header. in /home/www-data/vendor/smalot/pdfparser/src/Smalot/PdfParser/RawData/RawDataParser.php:945 Stack trace:
0 /home/www-data/vendor/smalot/pdfparser/src/Smalot/PdfParser/Parser.php(103): Smalot\PdfParser\RawData\RawDataParser->parseData('/out/EN16931_Ei...')
1 /home/www-data/vendor/atgp/factur-x/src/Reader.php(35): Smalot\PdfParser\Parser->parseContent('/out/EN16931_Ei...')
2 /home/www-data/_imap_zugferd.php(61): Atgp\FacturX\Reader->extractXML('/out/EN16931_Ei...')
3 /home/www-data/_imap_zugferd.php(35): extractZUGFeRDXML('/out/EN16931_Ei...', '/out/')
4 /home/www-data/.php(21): _imap_zugferd('{cas.hostedsolu...', 'operating@syslo...', '---------...', '/out/')
5 {main}
EN16931_Einfach.pdf