We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

LinkAnnotation GoToAction - setting page zoom factor/rectangle


I’m using Aspose PDF.NET 9.7.0 (registered) to process a pdf file pages and convert them to another PDF with pages to png images (flatten them). All work as it should but I also want to insert the annotations in the pdf that has pages converted to image. I’ve managed to do that by extracting the GoToAction page number and creating a new LinkAnnotation based on the original pdf. The problem is that I also want to keep/set the GoToAction page destionation x/y and zoom factor as it was in the original PDF. I’ve tried setting the LinkAnnotation destination equal to original one but it doesn’t work, it doesn’t scroll in the page nor the page no is kept.

Here is my code that extracts link annotations from one pdf and inserts them to the other one keeping only the page no from the LinkAnnotation (need a way to set the rect/zoom page as well). Any help will be really appreciated.

Later: I’ve just realized that I can use XYZExplicitDestination for that and works as it should! Sorry

Aspose.Pdf.InteractiveFeatures.XYZExplicitDestination xyzd =  (Aspose.Pdf.InteractiveFeatures.XYZExplicitDestination)link.Destination;
Aspose.Pdf.InteractiveFeatures.XYZExplicitDestination xyzdn = new Aspose.Pdf.InteractiveFeatures.XYZExplicitDestination(xyzd.PageNumber,xyzd.Left,xyzd.Top,xyzd.Zoom);
newlink.Action = new Aspose.Pdf.InteractiveFeatures.GoToAction(xyzdn);


Hi Razvan,

Thanks for your inquiry. Yes you are right you have to use XYZExplictiDestination for the purpose and It is good to know that you have managed to resolve the issue.

Please feel free to ask any question or concern. We will be glad to extend our support.

Best Regards,