Some test text!
Xamarin / Guides
You can get previews of a document's pages.
The PTThumbnailsViewController
class allows users to view and navigate the pages of a PTPDFViewCtrl
as well as re-arrange and remove pages.
The page thumbnails control is part of the Tools library, so make sure you have added the Tools library to your project .
To create a new page thumbnails view controller instance and display it from another view controller, supply a PTPDFViewCtrl
instance to the PTThumbnailsViewController
designated initializer:
var thumbnailsViewController = new pdftron.PDF.Controls.PTThumbnailsViewController(mPdfViewCtrl);
var navController = new UINavigationController(thumbnailsViewController);
this.PresentViewController(navController, true, null);
The thumbnail images shown in the thumbnails view controller are generated by the GetThumbAsync:
method of the PTPDFViewCtrl
class. When ready, the thumbnail images are provided to the pdfviewCtrl
's delegate via the GotThumbAsync:thumbImage:
method.
In your class adopting the PTPDFViewCtrlDelegate
protocol (usually the same view controller presenting the thumbnails view controller), add the following:
mPdfViewCtrl.GotThumbAsync += (sender, e) =>
{
if (e.Image == null)
{
return;
}
if (this.thumbnailsViewController != null && this.thumbnailsViewController.PresentingViewController != null)
{
this.thumbnailsViewController.SetThumbnail(e.Image, e.Page_num);
}
};
Pages can be re-arranged and removed in edit-mode, which is activated by the 'Edit' button in the navigation bar. Long-pressing and dragging allows the user to move a page to a different location in the same document, and tapping one or more documents selects them for removal with the trash can icon. The user is prompted for confirmation before any pages are permanently removed.
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales