How to read Named Destination?

14 views
Skip to first unread message

Ryan

unread,
May 15, 2020, 3:13:48 PM5/15/20
to PDFTron PDFNet SDK
Question:

We are trying to parse Actions and Destinations, but it is unclear how to parse Named actions.

Answer:

Action.GetDest() is only valid for GoTo Actions.

For Named there are 4 possible values from the N key.

Action action = // ...
if(action.GetType() == Action.Type.e_Named)
{
 SDF
.Obj n = action.GetSDFObj().FindObj("N");
 
if(n != null && n.IsName())
 
{
 
switch(n.GetName())
 
{
 
case "NextPage" : /* */ break;
 
case "PrevPage" : /* */ break;
 
case "FirstPage" : /* */ break;
 
case "LastPage" : /* */ break;
 
}
 
}
}


Reply all
Reply to author
Forward
0 new messages