-
Notifications
You must be signed in to change notification settings - Fork 131
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
Problem with nested fields with numeric field names #260
Comments
I'm hesitant to download arbitrary ZIP files from unknown sources. Could you maybe better add the relevant information here? A code example would also help. |
GitHub didn't allow me to upload XFDF files but allowed ZIP. Go figure. XFDF output from v0.9.2:
XFDF output from v0.10.3:
|
Can you please also provide a simple code example that I can use to reproduce the issue? Especially including the format of the data array. |
By the way, even v0.9.2 output looks strange (nested field tags), although, I am not an expert on XFDF. |
Your field names contain dots |
Version 0.9.2 output works with pdftk, so, I am not going to complain, but whatever version 0.10.3 outputs doesn't work (some fields are not filled). |
[DELETED] |
Sorry, forget what I wrote above. This will not work. The real problem is that you use numeric field names. |
Unfortunately I see no way to fix this without breaking things. The main problem is really that your field names are numbers. If you can somehow at least avoid a field with name Background: If you have field names like this:
this gets converted internally into this:
But this is the same as the syntax that we use for fields with multiple values:
They must be handled differently. So we check if a key with value There is no fix for this. |
I don't understand. The old version (0.9.2) is working fine... |
I can't control what my users use as a field names. Regardless, this sounds like a design issue in the php-pdftk library. I use another library which has no problems whatsoever with the same PDF file. IMHO, dismissing this issue as a user problem is unreasonable. Would you consider a pull request if I was to fix it? |
The problem started with implemenation of #148 in 0.10.2 where we added support for multi-value fields. But let me have another look, maybe we can still find a workaround somehow. |
@maxguru I've prepared a fix. Can you help testing this? See MR above for branch |
Thanks for the quick fix! It does produce the desired output for the case I described above. However, give me some time to test it with a large number of different PDF files. |
…d-names Issue #260 Fix nested fields with numeric field names
I've now created release 0.10.4 containing this fix. Let me know if there's still an issue. |
It seems to be working fine. Thanks! |
I seem to have found a big issue with the newer version (0.10.3). I narrowed it down to issues with XFDF generator.
See files generated by the two versions:
xfdf.zip
Version 0.10.3 generate files that don't work fully with pdftk-java (some fields are not filled).
The text was updated successfully, but these errors were encountered: