-
Notifications
You must be signed in to change notification settings - Fork 21
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
Destination with index #133
Conversation
… a page reference
@@ -236,6 +240,12 @@ private void parse(List v) { | |||
Object ob = getDestValue(0, v); | |||
if (ob instanceof Reference) { | |||
ref = (Reference) ob; | |||
} else if (ob instanceof Integer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably suggest somthing like, not point keeping the pageTree reference around:
// Dest could be a page number instead of a reference
final int idx = (int) ob;
PageTree pageTree = library.getCatalog().getPageTree();
if (idx >= 0 && idx < pageTree.getNumberOfPages()) {
ref = pageTree.getPageReference(idx);
}
Interstingly this is one of those special corners cases were the notion isn't in the specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I was tired, I was assuming we didn't have access to library in this object for some reason...
Thanks for pointing that out.
Yeah I found that quite strange, I don't know how that pdf got created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries and thank you for providing the fix!
Fixes #132