jhove
jhove copied to clipboard
Invalid destination object - unhelpful error offsets reported
Dev Effort
1D
Description
The attached file sample.pdf fails validation with the repeated error message:
ErrorMessage: edu.harvard.hul.ois.jhove.module.pdf.PdfInvalidException: Invalid destination object Offset: 965640 ErrorMessage: edu.harvard.hul.ois.jhove.module.pdf.PdfInvalidException: Invalid destination object Offset: 965640 ErrorMessage: edu.harvard.hul.ois.jhove.module.pdf.PdfInvalidException: Invalid destination object Offset: 965640 ErrorMessage: edu.harvard.hul.ois.jhove.module.pdf.PdfInvalidException: Invalid destination object Offset: 965640 ErrorMessage: edu.harvard.hul.ois.jhove.module.pdf.PdfInvalidException: Invalid destination object Offset: 965640 ErrorMessage: edu.harvard.hul.ois.jhove.module.pdf.PdfInvalidException: Invalid destination object Offset: 965640 ErrorMessage: edu.harvard.hul.ois.jhove.module.pdf.PdfInvalidException: Invalid destination object Offset: 965640
First of all, it doesn't make much sense that the error message is repeated. Furthermore, is it possible that the error is a bug? Neither can I find an object starting at Offset 965640, nor do I see an object being pointed to at that offset in either of the crossreference tables. I assume that the validation error is actually a JHOVE bug. Could you please check this? I have several files with the same buggy behavior, all coming from the same producer.
After looking into the file, they do appear to be valid error messages... if opaque ones. The document is using some link annotations which point to named destinations (in this case "WEBend-a1" and "WEBend-a2") that don't appear in the document's destination index (its Name Dictionary), and so can't be resolved.
At a guess, I'd say they are the superscript numbers by the authors' names, which are clickable but don't navigate anywhere. The message is repeated seven times because JHOVE found seven different instances of the problem. The message could be a bit more specific — and changes to that effect are currently awaiting integration into the next release — but what is misleading is the offset, which you'd rightly expect to point to each instance.
Thanks a lot for the analysis! With your pointer I found the annotations and could reproduce. Makes sense.
Would the correct offset reported be that of the Name Dictionary or that of the /Dests entry with the invalid objects? I'd assume the later - but the reported offset seems to be far off then? And did I understand correctly that this bug should stay open to fix the offset reporting?
If the error was reported based purely on an analysis of the Name Dictionary, then I'd think the offset of the offending dictionary would be appropriate, but since the error is discovered and reported for each instance, I'd expect the offset to point to each instance.
I think it's worth keeping this issue open, it being a good example of the problem. I've been wanting more helpful offsets since I started using JHOVE myself.