GoToRemoteAction with inherited zoom

Hello,

I want to use GoToRemoteAction and XYZExplicitDestination to create a hyperlink to another PDF file, inheriting the current document’s zoom level.

The constructor:

XYZExplicitDestination(int pageNumber, double left, double top, double zoom)

allows the zoom level to be set to 0 (inherit), however it also requires the target page height to be specified (for parameter top). Setting top to 0 makes it link to the bottom of the page.

I do not want to have to load the other PDF just to look up the page height.

Is there a way to create an XYZExplicitDestination with zoom level 0 and top of the page, without needing to specify the page height?

@ast3
I’ll investigate this issue and write about results as soon as possible

@ast3
I checked the issue
It seems that you can try to just set some big enough number and XYZExplicitDestination will stop at the top of the page
I tried something like following

using (var document = new Document(input))
{
    Page page = document.Pages[1];
    // Create Link annotation object
    LinkAnnotation link = new LinkAnnotation(page, new Aspose.Pdf.Rectangle(100, 100, 120, 400));

    link.Highlighting = HighlightingMode.Invert;

    link.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red);
    // Create border object for LinkAnnotation
    Border border = new Border(link);


    border.Style = BorderStyle.Solid;
    // Set the border width value as 0
    border.Width = 2;
    // Set the border for LinkAnnotation
    link.Border = border;
    // Specify the link type as remote URI
    GoToAction goToAction = new GoToAction();
//I set top to 2000 as it would most likely surpass page height
    goToAction.Destination = new XYZExplicitDestination(4, 10, 2000, 1);
    link.Action = goToAction;
    page.Annotations.Add(link);
    document.Save(GetOutputPath("layer_add_issue.pdf"));
}