Navigation and zooming in GemBox.PdfViewer

GemBox.PdfViewer makes navigating through large PDF files seamless and intuitive. You can benefit from a variety of navigation tools that enhance the reading and browsing experience.

Page navigation

GemBox.PdfViewer provides straightforward options for moving through the document. You can jump to any page by entering the page number, using the next and previous buttons, or scrolling through the document. This makes it easier to handle documents of any length.

Navigating between pages using GemBox.PdfViewer
Navigating between pages using GemBox.PdfViewer

You can also navigate a PDF document programmatically using the API. The example below demonstrates how to navigate to the next page, if it's not the last one:

let viewer = await GemBoxPdfViewer.create({ 
	container: "#viewer",
	initialDocument: "/document.pdf"
});

let currentPage = viewer.getCurrentPage();
if (currentPage < viewer.getPageCount() - 1)
	viewer.setCurrentPage(currentPage + 1);

Thumbnails and Bookmarks

For quicker access, you can view thumbnails of each page or use bookmarks that take you directly to specific sections of the PDF. This feature is particularly useful for lengthy documents, allowing you to save time and improve efficiency.

Using thumbnails and bookmarks for navigation
Using thumbnails and bookmarks for navigation

Zooming

The library allows you to zoom in and out of the document for better readability. You can choose to view the document in actual size, fit-to-page, or fit-to-width modes, adapting the document to the screen for optimal viewing.

Zooming using GemBox.PdfViewer
Zooming using GemBox.PdfViewer

Zoom levels can also be set programmatically using the API. The example below illustrates how to set the zoom to 50%:

let viewer = await GemBoxPdfViewer.create({ 
	container: "#viewer",
	initialDocument: "/document.pdf"
});

viewer.setZoom(50);

File manipulation

Apart from viewing and navigating PDFs, the library provides essential tools to manage PDF files:

  • Opening files: You can pick their file and open it in the viewer
  • Downloading: You can download the displayed file
  • Printing: The PDF viewer allows to print the file
Opening file using GemBox.PdfViewer
Opening file using GemBox.PdfViewer

See also


Next steps

GemBox.PdfViewer is a JavaScript library that enables you to show PDF files seamlessly in your web applications.

Download Buy