-
Notifications
You must be signed in to change notification settings - Fork 22
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
In FdpiFacturx, the SetPdfVersion function is broken. #40
Comments
Hello, |
Hello, The problem occurs when i create a ZUGFeRD PDF from a PDF and a facturx.xml using Writer via "generate". The problem occurs approximately once every 30-50 times. The error message comes from the Verapdf Validator, because i validate each PDF after it is created. |
Hello Billy, I've never encountered any problems with these binary content declaration characters (Perhaps VeraPDF is stricter), but it would indeed be a good idea to improve this. ISO 32000-1:2008, Section 7.5.2 (File Header)
I'm submitting a PR. |
Fixed by #41 |
In FdpiFacturx, the SetPdfVersion function is broken.
PHP chr only accepts values from 0-255, values from 127-256 are generated via rand.
Therefore, from time to time the PDF is not valid, error: The aforementioned EOL marker shall be immediately followed by a % (25h) character followed by at least four bytes, each of whose encoded byte values shall have a decimal value greater than 127
Original:
$this->PDFVersion .= "\n" . '%' . chr(rand(128, 256)) . chr(rand(128, 256)) . chr(rand(128, 256)) . chr(rand(128, 256));
New:
$this->PDFVersion .= "\n" . '%' . chr(rand(127, 255)) . chr(rand(127, 255)) . chr(rand(127, 255)) . chr(rand(127, 255)); // chr 0-255
The text was updated successfully, but these errors were encountered: