Create NamedDestination for GoToR Link

Hi Aspose,

How to create/modify the NamedDestination for GotoR link with retaining existing magnification.
Please send the sample code snip set



You may kindly use following code snippet to create Named Destinations in PDF document.

Document pdf = new Document();
// Create document with 100 pages
for (int i = 1; i <= 100; i++)
 Page page = pdf.Pages.Add();
 page.AddStamp(new Aspose.Pdf.TextStamp("Page " + i));
   // Named destinations for every page
 pdf.NamedDestinations.Add("Page" + i, new XYZExplicitDestination(i, 0, 600, 0.5));
for (int i = 1; i <= 100; i++)
   // Create outlines (two outlines for every page)
 OutlineItemCollection item1 = new OutlineItemCollection(pdf.Outlines);
 item1.Destination = new NamedDestination(pdf, "Page" + i);
 item1.Title = "Page  " + i + "(1)";

 OutlineItemCollection item2 = new OutlineItemCollection(pdf.Outlines);
 item2.Destination = new NamedDestination(pdf, "Page" + i);
 item2.Title = "Page  " + i + "(2)";
 // Let's update on of the named destinations
pdf.NamedDestinations["Page50"] = new XYZExplicitDestination(50, 0, 100, 2);

Furthermore, please check “Get Zoom Factor” article in API documentation to determine the zoom value of the existing PDF document. In case you face any issue, please share your sample PDF document along with the expected output. We will test the scenario in our environment and address it accordingly.

Thanks for replay!

Probably, The above given snip set code is for creating the goto link(the link pointing to page with same document) with named destination.
But I am expecting the named destination GotoR link(The link is pointing to different pdf document named destination)…?

Below are my sample code and appropriate attachments

  1. Action as GoTo
    /Code Sample/
    Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(pdfFile.Text);
    Aspose.Pdf.Page page = pdf.Pages[1];
    Aspose.Pdf.Rectangle AnnotRect = new Aspose.Pdf.Rectangle(80, 500, 350, 530);
    LinkAnnotation link = new LinkAnnotation(page, AnnotRect);
    GoToAction gotoaction = new GoToAction();
    gotoaction.Destination = new NamedDestination(pdf, namedDestination);
    link.Action = gotoaction;
    /Code Sample/
    Please see the attached “1. Action as GoTo.png” file
    1. Action as GoTo.PNG (7.0 KB)
    1. Action as GoTo-10.PNG (29.8 KB)

  2. Action as GoToR (We needed this part)
    /Code Sample/
    GoToRemoteAction gotoaction = new GoToRemoteAction(remote pdf, remote pdf dest page);
    gotoaction.Destination = new NamedDestination(pdf, “named destination”); //The Exceiption is thrown here: Only Explicit Destination is implemented.
    link.Action = gotoaction;
    /Code Sample


Would you kindly share the sample PDF document with us. We will test the scenario in our environment and address it accordingly.

The input.pdf file is having named destination as “page1”.
So, I want to create GoToR link from output.pdf, that is ponting to input.pdf file named destination - “page1”
input.pdf (37.9 KB)
output.pdf (29.5 KB)


We have logged an investigation ticket as PDFNET-47680 in our issue tracking system for further investigation on this scenario. We will look into details of this ticket and keep you posted on the status of its resolution. Please spare us little time.

We are sorry for the inconvenience.