Skip to main content linkedinfacebooktwittermenuarrow-up
1

Programatic Navigation and Zoom Completed

Would it be possible to make javascript calls to navigate and zoom in the pdf viewer via clicks in the page containing the component. This would be useful for either opening a document at a specific point, or clicking a button to have the document navigate to a given point.

Comment (1)

Mario at GemBox

Hi,


This feature request has been implemented and is available in the latest versions of GemBox.PdfViewer.

Here is a JavaScript snippet code that will set navigation and zoom in the PDF viewer:


let viewer = await GemBoxPdfViewer.create({
    ...
});

// To set the zoom by number or values such as "fitPage" and "fitWidth"
viewer.setZoom("fitPage");

// To get current page
let currentPage = viewer.getCurrentPage();

// To get total page count
let pageCount = viewer.getPageCount();

// To set current page to the given number
viewer.setCurrentPage(currentPage   1);

// To search text in the file
viewer.search("GemBox");


Regards,

Mario