Set Zoom Factor in PDF using Aspose.PDF for .NET

Hi,
I am trying to set zoom factor of pdf file. I successfully update zoom factor but when I open pdf file it open from page number 2. I set page number 1 but It’s not work.
Please update me what’s the reason and provide me solution.
Please find the code I used and sample file in attachment.
Document document=new Document(“C:\Users\Saxena\Documents\Workspace\sample.pdf”);
GoToAction action = new GoToAction(new XYZExplicitDestination(1, 0, 0, 2));
document.setOpenAction(action);sample.pdf (3.0 KB)

	document.save("C:\\Users\\Saxena\\Documents\\Workspace\\sample.pdf");

@sauravjava

Thanks for contacting support.

Please try to set the Action as following:

GoToAction action = new GoToAction(new XYZExplicitDestination(1, 0, document.Pages[1].PageInfo.Height, 2));

In case you still face any issue, please feel free to let us know.

@asad.ali
Thank you.

1 Like