Page Zoom FitPage

Has anyone had luck setting a page’s default zoom?


Something like:

for (int pageIndex = 1; pageIndex <= Math.Min(3, document.Pages.Count); pageIndex++) {
Pdf.Page page = riskSummaryDocument.Pages[pageIndex];
// set page zoom “FitPage” here
}

Hi Matthew,

Thanks for your inquiry. As already replied in your other post, please use the following code snippet to set the document default zoom to Fit to Page.

Document doc = new Document("Input.pdf");
GoToAction action = new GoToAction(new Aspose.Pdf.InteractiveFeatures.FitVExplicitDestination(doc.Pages[1],doc.Pages[1].MediaBox.Height));
doc.OpenAction = action;
doc.Save("FittoPage_pdf.pdf");

Please feel free to contact us for any further assistance.

Best Regards,