-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[qt] generated PDF does not pass the PDF validations #1573
Comments
First of all, thank you for the very detailed and comprehensive bug report! I wish all bug reports were like this 👍 I think the following patch for the patched QT should fix the issue you mentioned:
However, the following errors are still coming, and I don't really have a clue why they are being generated:
|
@lindi2: any updates? otherwise I will commit the above changes and close the issue. |
@ashkulz I don't have build environment setup right now. Did you start getting those other validation errors when you updated QT? I don't get them with the exact versions listed in the report. |
@lindi2: I am getting them on the updated QT while testing on Windows. I don't think there has been a change in the relevant code for a long time... can you check after compiling with the latest code? |
@ashkulz I can put that to my todo list but it'll take some time to setup the build system. |
let me see if I can build and upload a new development snapshot, will take a day or two for compiling all the combinations. |
@lindi2: setting up a development environment is very simple, see INSTALL.md. Either way, a new development snapshot is available and linked from the website. |
@ashkulz sure, I just need to find the time to do it :) Anyways, wkhtmltox-0.12.1-b3e000e_linux-wheezy-amd64.tar.xz generates the following validation errors here: 1.1 : Body Syntax error, Second line must contains at least 4 bytes greater than 127 Could git bisect be used to figure out which commit created these? Does git bisect work sensibly with git submodules (I'm assuming that qt is a git submodule)? |
Are you saying you didn't get any other errors with 0.12.0? |
That's right. With wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz I only get those two validation errors. Anyways, I got a VM for building wkhtmltopdf now and built b3e000e which gives me The filehello.pdf is not valid, error(s) : just like with the static binary as expected. |
There aren't any changes to the PDF rendering code, let me recompile |
Build instructions seem to have changed between these two versions so it's not exactly trivial to git bisect I guess? |
Verified, just two errors reported for 0.12.0. Bisection is not straightforward because QT is a submodule and the changes are on two separate branches (rebased with the wkhtmltopdf-specific patches). I'll look at it over the weekend. |
It looks like you start getting these errors as soon as you add the missing |
1.1 : Body Syntax error, Second line must contains at least 4 bytes greater than 127
|
If you can give me explanations like that, I think we can crack this very soon 👍 I've added a potential fix in the issue1573 branch, am compiling and testing it right now. |
I already made such a patch and tested that it works. Working on more patches at the moment. |
Great 👍 I'll wait for a pull request from you, then. |
Is there some way to incrementally rebuild only changed files? "scripts/build.py wheezy-amd64" doesn't seem to pick up my changes to qt/src/gui/painting/qprintengine_pdf.cpp |
You'll have to do it manually, I'm afraid. What I do is |
Couldn't figure out how to do incremental builds so had to wait a while for full builds. Does wkhtmltopdf/qt#6 look ok to you? |
I've implemented incremental builds in 3995b6e, let me know if it works for you. |
Using the latest version solved my problems. I haven't investigated, but I found a bug in my haml file, that was the basis for the pdf. I accidentally put the body tag inside the head tag. A html validator pointed out that I was generating invalid html. Solved this bug and installed the latest wkhtmltopdf, and things are working for me. |
The issues are with the upstream Qt PDF generation code, so will have to be fixed/pushed upstream first. Considering that it works fine in most viewers, it is not a high priority as such 😄 |
Steps to reproduce:
Expected results:
6) output of wkhtmltopdf passes the PDF validator
Actual results:
6) the PDF validator complains:
The filehello.pdf is not valid, error(s) :
1.1 : Body Syntax error, Second line must contains at least 4 bytes greater than 127
1.0 : Syntax error, Object (9:0) at offset 326 does not end with 'endobj'.
More info:
The text was updated successfully, but these errors were encountered: