THPDFPage.SetPageThumbnail / ClearPageThumbnail

THPDFPage

 

Supported Image Formats

Προσαρτά ή αφαιρεί page thumbnail image (PDF page /Thumb entry, ISO 32000-1 §12.3.4). Οι PDF viewers (Adobe Acrobat, Foxit, browser viewers) εμφανίζουν το referenced image στο navigation panel τους χωρίς να rasterise οι ίδιοι το page content, κάνοντας αισθητά ταχύτερο το άνοιγμα image-heavy archives

 

Delphi syntax:

procedure SetPageThumbnail(ImageIndex: Integer);

procedure ClearPageThumbnail;

 

Parameters

Το ImageIndex είναι η value που επιστρέφεται από προηγούμενη κλήση THotPDF.AddImage ή THotPDF.AddImageFromFile. Το underlying Image XObject αναφέρεται indirect σύμφωνα με το spec, οπότε το ίδιο image μπορεί επίσης να σχεδιαστεί σε regular page χωρίς conflict. Περάστε negative index για να αφαιρέσετε υπάρχον /Thumb entry

 

Περιγραφή

Each PDF page can carry an indirect reference to an Image XObject in its /Thumb key. The image is normally a downsampled 8-bit DeviceGray, DeviceRGB, or Indexed bitmap (Acrobat uses roughly one thumbnail point per page point), but HotPDF does not validate the color space – the caller chooses what to attach. ClearPageThumbnail removes any previously attached thumbnail. SetPageThumbnail(-1) is equivalent to ClearPageThumbnail. Passing an ImageIndex that is not in range of the document’s image list raises a descriptive exception.

 

Example

PDF := THotPDF.Create(nil);
PDF.FileName := 'archive.pdf';
PDF.BeginDoc;
Idx := PDF.AddImageFromFile('preview.jpg', icJpeg);
PDF.CurrentPage.SetPageThumbnail(Idx);
PDF.EndDoc;

 

Availability

HotPDF v2.119.13. The PDF /Thumb entry is a PDF 1.0 feature and is not gated under PDF/A, PDF/X, or PDF/UA compliance modes. To make the viewer open with the thumbnail panel visible, also set THotPDF.PageMode := pmUseThumbs.

 

See also: Supported Image Formats, THPDFPage