LEADTOOLS Forms (Leadtools.Forms.DocumentReaders assembly)

GetThumbnail Method

Show in webframe
Example 





The requested page. Must be an existing page in the DocumentReader.Pages list and cannot be a a null reference.
The desired maximum width of the thumbnail image in pixels. Must be greater than or equal to 32.
The desired maximum height of the thumbnail image in pixels. Must be greater than or equal to 32.
Gets a thumbnail of a page in the document.
Syntax
public RasterImage GetThumbnail( 
   DocumentReaderPage page,
   int thumbnailWidth,
   int thumbnailHeight
)
'Declaration
 
Public Function GetThumbnail( _
   ByVal page As DocumentReaderPage, _
   ByVal thumbnailWidth As Integer, _
   ByVal thumbnailHeight As Integer _
) As RasterImage
'Usage
 
Dim instance As DocumentImageManager
Dim page As DocumentReaderPage
Dim thumbnailWidth As Integer
Dim thumbnailHeight As Integer
Dim value As RasterImage
 
value = instance.GetThumbnail(page, thumbnailWidth, thumbnailHeight)

            

            
public:
RasterImage^ GetThumbnail( 
   DocumentReaderPage^ page,
   int thumbnailWidth,
   int thumbnailHeight
) 

Parameters

page
The requested page. Must be an existing page in the DocumentReader.Pages list and cannot be a a null reference.
thumbnailWidth
The desired maximum width of the thumbnail image in pixels. Must be greater than or equal to 32.
thumbnailHeight
The desired maximum height of the thumbnail image in pixels. Must be greater than or equal to 32.

Return Value

A new Leadtools.RasterImage that is the thumbnail image.
Remarks

If the page width and height is less than thumbnailWidth and thumbnailHeight, then this method returns a Leadtools.RasterImage in the original size.

If the page width or height is greater than thumbnailWidth and thumbnailHeight, then this method will return the biggest thumbnail it can fit into the dimensions specified by thumbnailWidth and thumbnailHeight, keeping the original image aspect ratio.

The result image will always have 24 bits per pixel and a resolution of 96 by 96 regardless of the value of DpiX and DpiY and will never return a thumbnail bigger than the original page size in pixels.

To get a render of the full size of any page in a PDF document, use GetPageImage.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Forms
Imports Leadtools.Forms.DocumentReaders
Imports Leadtools.WinForms
Imports Leadtools.Forms.Ocr
Imports Leadtools.Drawing

Public Sub DocumentImageManagerGetThumbnailExample(ByVal reader As DocumentReader, ByVal _
                                                   imageList As RasterImageList)
   ' Loop through all the pages
   For Each page As DocumentReaderPage In reader.Pages
      Dim thumbnailImage As RasterImage = reader.ImageManager.GetThumbnail(page, 128, 128)
      Dim item As New RasterImageListItem(thumbnailImage, 1, "Page " + page.PageNumber.ToString())
      imageList.Items.Add(item)
   Next
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.DocumentReaders;
using Leadtools.WinForms;
using Leadtools.Forms.Ocr;
using Leadtools.Drawing;

public void DocumentImageManagerGetThumbnailExample(DocumentReader reader, RasterImageList imageList)
{
   // Loop through all the pages
   foreach(DocumentReaderPage page in reader.Pages)
   {
      RasterImage thumbnailImage = reader.ImageManager.GetThumbnail(page, 128, 128);
      RasterImageListItem item = new RasterImageListItem(thumbnailImage, 1, "Page " + page.PageNumber.ToString());
      imageList.Items.Add(item);
   }
}
Requirements

Target Platforms

See Also

Reference

DocumentImageManager Class
DocumentImageManager Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Forms.DocumentWriters requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features