-
-
Notifications
You must be signed in to change notification settings - Fork 579
Description
This issue reports multiple problems with the keywords command, mostly related to CJK text and Acrobat interoperability. Tested with pdfcpu v0.8.0 on Windows and Linux. The test files are attached at the end.
1. Add a keyword 你好 to empty.pdf. The listed keyword is `}:
$ pdfcpu keywords add empty.pdf 你好
optimizing...
$ pdfcpu keywords list empty.pdf
optimizing...
`}
2. empty-12-3.pdf contains 2 keywords added with Acrobat, 1 2 and 3, and they can be correctly listed by pdfcpu. Add another keyword 4, and rename the file to empty-12-3-4.pdf. The keywords can be listed as expected by pdfcpu, but not in Acrobat:
$ pdfcpu keywords add empty-12-3.pdf 4
optimizing...
$ mv empty-12-3.pdf empty-12-3-4.pdf
$ pdfcpu keywords list empty-12-3-4.pdf
optimizing...
1 2
3
4
3. empty-你好.pdf contains a keyword 你好 added with Acrobat. Then add a keyword world. The keywords listed by pdfcpu are OK, but not in Acrobat:
4. Try again with the original empty-你好.pdf, and add a keyword 世界. The keywords listed by pdfcpu and by Acrobat are both incorrect:
$ pdfcpu keywords add empty-你好.pdf 世界
optimizing...
$ pdfcpu keywords list empty-你好.pdf
optimizing...
你好
■L
5. empty-opt.pdf is a size-optimized version of empty.pdf, and it passes strict validation. But a panic happens when adding a keyword.
$ pdfcpu validate -m strict empty-opt.pdf
validating(mode=strict) empty-opt.pdf ...
validation ok
$ pdfcpu keywords add empty-opt.pdf hello
optimizing...
unexpected panic attack: runtime error: invalid memory address or nil pointer dereference


