I can create the link to external page, but the zoom is always page fit.
Thank you for letting us know that this is important for you.
You could modify the generated Destination, or replace completely.
What zoom did you want to set?
We would like to use something like CreateXYZ, with the z zoom set as 0.
I’m trying to create the destination object myself, but I’m still new for pdftron and not sure how to do it with the remote go to.
Thanks a lot for the quick response.
Actually, I just figure out something myself:
Obj objFileSpec = doc.createIndirectDict(); objFileSpec.putName("Type", "Filespec"); objFileSpec.putString("F", destinationFile); FileSpec fileSpec = new FileSpec(objFileSpec);
Action gotoRAction = Action.createGotoRemote(fileSpec, 2, true); Obj objdest = doc.createIndirectArray(); objdest.pushBackNumber(2); objdest.pushBackName("XYZ"); objdest.pushBackNumber(0); objdest.pushBackNumber(0); objdest.pushBackNumber(0); gotoRAction.getSDFObj().put("D", objdest);
Just want to make sure is the code clear? Any suggestion to clean it up?
The code you posted looks great, and should work as expected.
The only clarification to point out, in case you, or anyone else reading this post is unaware, is that for a Remote Go-To the page numbers start at zero (normally in the API page numbers start at 1). So in your code, the value of 2 means the 3rd page of the remote PDF. This applies to createGoToRemote and when you push back the page number manually.