diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2021-11-08 11:14:42 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2021-11-08 11:14:42 +0000 |
commit | 3f84ac0435ff4ddbc7dd3c8514fd7cae299bc0ca (patch) | |
tree | bfc659b7f99929533a6984b8328b5edc6b8ebe3a /pdf/ghostpdf.h | |
parent | c40db67210e981537efdd33d8445c29f16e4f491 (diff) | |
download | ghostpdl-3f84ac0435ff4ddbc7dd3c8514fd7cae299bc0ca.tar.gz |
PDF interpreters - fix Outline preservation
Bug #704698 "After PDF2PDF operation the outlines (bookmarks) are all links to first page"
There are two different problems; with pdfi the Outline reading code did
not expect the Dests tree to have leaf nodes which were simple arrays
rather than dictionaries containing a /D key and an array value.
Fix the first case by simply using the array.
The PostScript-based PDF interpreter seems to have expected that the
array containing leaf nodes in a name tree would be sorted, and was
performing a binary chop to locate the required Name. There is no such
requirement in PDF. Because the input file has a large (~3,600 entry)
name tree, and the tree has a totally flat structure, the binary chop
resulted in many failures to locate the Dest.
Fixed by replacing the binary search with a linear search. Slower but at
least it gets the correct answer.
Diffstat (limited to 'pdf/ghostpdf.h')
0 files changed, 0 insertions, 0 deletions