Hi Support,
This will be a more technical post...
I have a PDF where UTF-16BE with BOM is used to define named destination keys in the `/Dests` name tree, for example:
```pdf
1 0 obj
<<
/Metadata 2 0 R
/Names <<
/Dests 3 0 R
>>
>>
3 0 obj
<<
/Names [
<FEFF006E00640031> [ 4 0 R /XYZ 0 841.889764 null ]
<FEFF006E00640032> [ 6 0 R /XYZ 0 841.889764 null ]
<FEFF006E00640033> [ 7 0 R /XYZ 0 841.889764 null ]
]
>>
```
However, a bookmark referencing the first named destination uses a regular ASCII string for its `/D` entry:
```pdf
9 0 obj
<<
/Next 10 0 R
/A <<
/D (nd1)
/S /GoTo
>>
>>
```
So, although both represent the same textual value (`nd1`), their underlying byte sequences are different.
PDF-XChange Editor has no problem resolving this bookmark: it finds the named destination and displays its properties correctly, despite the different encodings.
ISO 32000-1, Section 7.9.6 (Name Trees), states: "any encoding of the keys may be used as long as it is self-consistent; keys shall be compared for equality on a simple byte-by-byte basis."
PDF-XChange Editor appears to handle this case successfully, even though the byte sequences do not match.
My question / feature request:
When saving the PDF, would you consider normalizing the `/D` entries in Go-To actions so that their encoding matches the corresponding named destination keys in the Name Tree?
In this example, that would mean saving `(nd1)` as a UTF-16BE string with BOM, consistent with the corresponding Name Tree key.
This would ensure consistent encoding and avoid potential compatibility issues with stricter PDF parsers.
-žarko
Ensure Matching Encoding Between Name Tree Keys and Go-To References
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
zarkogajic
- User
- Posts: 1561
- Joined: Thu Sep 05, 2019 12:35 pm
-
Sean - PDF-XChange
- Site Admin
- Posts: 1386
- Joined: Wed Sep 14, 2016 5:42 pm
Re: Ensure Matching Encoding Between Name Tree Keys and Go-To References
Hi Zarko,
I have sent your request to the development team for review.
Kind regards,
I have sent your request to the development team for review.
Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
-
zarkogajic
- User
- Posts: 1561
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Ensure Matching Encoding Between Name Tree Keys and Go-To References
Hi Support,
I did some more tests and noted this (matching) would actually be done upon saving IF I add more named destinations.
However, if named destinations are not "dirty" - they will be saved as-is in the document (even if the document is "dirty" when saved).
So, actually proposing to do the matching encoding, when saving, even if destinations were not touched.
-žarko
I did some more tests and noted this (matching) would actually be done upon saving IF I add more named destinations.
However, if named destinations are not "dirty" - they will be saved as-is in the document (even if the document is "dirty" when saved).
So, actually proposing to do the matching encoding, when saving, even if destinations were not touched.
-žarko
-
Sean - PDF-XChange
- Site Admin
- Posts: 1386
- Joined: Wed Sep 14, 2016 5:42 pm
Re: Ensure Matching Encoding Between Name Tree Keys and Go-To References
Hi Zarko,
Okay, thanks for the additional information—the development team will review it when they come to your case.
Kind regards,
Okay, thanks for the additional information—the development team will review it when they come to your case.
Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623