Page Thumbnail Property. The Thumbnail for the page. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

 

Type Default Value Read Only Description
[C#] PixMap

[Visual Basic]
PixMap
n/a No The Thumbnail for the page

 

   

Notes
 

Each page can have a thumbnail image for quick preview purposes. This property allows to access such a thumbnail if it exists, or to assign such a thumbnail to a page if it does not.

 

   

Example
 

This example shows how to create and embed thumbnails in a PDF document.

[C#]
using (Doc doc = new Doc(), srcDoc = new Doc()) {
  doc.Read("spaceshuttle.pdf");
  doc.Rendering.DotsPerInch = 18;
  Page[] pages = doc.ObjectSoup.Catalog.Pages.GetPageArrayAll();
  foreach (Page page in pages) {
    doc.Page = page.ID;
    using (XImage xi = XImage.FromData(doc.Rendering.GetData(".jpg"), null))
      page.Thumbnail = PixMap.FromXImage(doc.ObjectSoup, xi);
  }
  doc.Save("embedthumbnails.pdf");
}

[Visual Basic]
Sub ...
  Using doc As New Doc(), srcDoc As New Doc()
    doc.Read("spaceshuttle.pdf")
    doc.Rendering.DotsPerInch = 18
    Dim pages As Page() = doc.ObjectSoup.Catalog.Pages.GetPageArrayAll()
    For Each page As Page In pages
      doc.Page = page.ID
      Using xi As XImage = XImage.FromData(doc.Rendering.GetData(".jpg"), Nothing)
        page.Thumbnail = PixMap.FromXImage(doc.ObjectSoup, xi)
      End Using
    Next
    doc.Save("embedthumbnails.pdf")
  End Using
End Sub