-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] XML from PDF not been found #135
Comments
Hi @PrimeGhostDE, I'm really not sure if and how I can help with this. Obviously this doesn't seem to be a problem with my library, so I'm leaning towards opening an issue at smalot/pdfparser. Which may well be that the XML is not embedded correctly in the PDF - but that's just a guess. Sometimes it helps to use the validator of the ZUGFeRD community and/or VeraPDF. Best regards. |
Hi HorstOeko, currently i am facing the issue that it seems not to be an embeddedFile: Dump of $filespec->getDetails(); array:7 [ The XML is some sort of "Filespec" type. Edit: exception: "horstoeko\zugferd\exception\ZugferdUnknownXmlContentException" How can i check the Syntax for the XML? (oder bin ich auf dem Holzweg?!) |
XML of the File:
|
If I use ZugferdDocumentReader::readAndGuessFromContent(file_get_contents(Storage::path('temp/factur-x.xml'))); on the XML it is working.... So I expect a problem asside the extraction of the XML -.- |
Hi @PrimeGhostDE,
I'm glad you were able to get to grips with the problem. But anyway: The PDF is embedded incorrectly - and even the best PDF parser can't change that... :-) I can try to implement a certain fallback when I get the chance. Would you be so kind as to send me the original PDF by e-mail via Mail? Many thanks and best regards |
Thank you :)
returns empty string. So i might have been wrong with "$embeddedFiles = $pdfParsed->getObjectsByType('EmbeddedFile'); returns an empty array." |
Hi @PrimeGhostDE, Once again: everything works great. All tests are green - including the PDF tests. I can't do anything here. The problem is not with my library. Without exception, all valid PDF files are read correctly. The XML is embedded incorrectly - I'm sticking to that. So please tell me how I can help you... Kind regards |
I have send you a test invoice via E-Mail :-) |
Hi @PrimeGhostDE, I have just debugged with the help of your file. As I had already suspected several times, this file is not correctly mounted as an embedded file. Unfortunately, there is nothing I can do here and I can only recommend that you contact the service provider. That's all I can think of at the moment... Appendix: As you can see, there is no embedded file. You can - of course - make an issue to smalot/pdfparser. I've put that PDF to the Validator of the ZUGFeRD-Community... With the following result.... Das XML ist nicht valide. Profil: urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended Details Das ZUGFeRD-PDF ist nicht valide. Signatur: unknown Can we close this issue? Kind regards |
Hi @horstoeko, thank you very much for checking the invoice. The main problem for me was that the XML is not being extracted from the pdf. Kind regards |
Hi @PrimeGhostDE, So. Thank you for the information. What is the screenshot supposed to tell me? Unfortunately, I don't understand it. Can we close this issue? Kind regards |
Hi @horstoeko,
The main problem for me was that the XML is not being extracted from the pdf. in ZugferdDocumentPdfReader line 90
Is this a problem you can help me to fix? Kind regards PS: i opened up a ticket in SMALOT / PDFParser: The Field that the Validation Tool, you copied the result from, was correctly formed. The Documentation can be downloaded here: https://www.awv-net.de/upload/ferd/ZF23_DE.zip With the given examples there from, your library is working correctly. |
Hi @PrimeGhostDE,
No. This is not part of my library - I use a external lib
Very good.
???? I don't think we're getting anywhere here. Besides, we are now mixing up two completely different topics. I will close this issue now as I don't know how to help and can't provide a fix. Kind regards |
Describe the bug
Invoices from Sage as E-Rechnung (Type: Zugferd 2.2 / 2.1) are not recognized as E-Rechnung but also Acrobat PDF-Reader and https://belegmeister.de/zugferd-e-rechnungen-online-anzeigen/ have found an XML inside. The PDF and the XML can be opened from Acrobat PDF Reader.
To Reproduce
The Invoice itself is difficult to send because private Information is inside. (Please PM me if needed)
ZugferdDocumentPdfReader::readAndGuessFromFile(Storage::path($dokument->path . '/' . $dokument->filename)) returns null.
No Error is thrown.
ZugferdDocumentPdfReader:
$attachmentIndex is 0 when in_array($filespecDetails['F'], ZugferdDocumentPdfReader::ATTACHMENT_FILENAMES) is found [factur-x.xml]
$embeddedFiles = $pdfParsed->getObjectsByType('EmbeddedFile'); returns an empty array.
so $returnValue = ZugferdDocumentReader::readAndGuessFromContent($embeddedFile->getContent()); is been done on empty data.
So far i am sure, that there might be a problem in smalot/pdfparser. (Going to open there an issue asap)
But if you do have any further steps to check i am very welcome about.
Expected behavior
return of valid object
Additional information:
The text was updated successfully, but these errors were encountered: