Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfViewer.GetSelectedThumbnailPageIndexes() Method

Obtains the indexes of the pages selected in the Page Thumbnails panel.

Namespace: DevExpress.XtraPdfViewer

Assembly: DevExpress.XtraPdfViewer.v24.2.dll

NuGet Package: DevExpress.Win.PdfViewer

#Declaration

public IReadOnlyCollection<int> GetSelectedThumbnailPageIndexes()

#Returns

Type Description
IReadOnlyCollection<Int32>

A collection of page indexes.

#Remarks

The following example shows how to save only the pages of a PDF document selected in the Page Thumbnails panel as images:

using System.Drawing;
using System.Drawing.Imaging;
// ...
void ExportSelectedPages(object sender, ItemClickEventArgs e){
    // Obtains the selected page indexes.
    var pages = pdfViewer1.GetSelectedThumbnailPageIndexes();
    // Saves each page from the collection to an image.
    foreach (var i in pages){
      Bitmap image = pdfViewer1.CreateBitmap(i, 1000);
      image.Save($"..\\MyBitmap{i+1}.bmp", ImageFormat.Bmp);
    }
}
See Also