UpdateThumbnail
Contents
[
Hide
]UpdateThumbnail(ThumbnailGeneratingOptions)
Updates Thumbnail
of the document according to the specified options.
public void UpdateThumbnail(ThumbnailGeneratingOptions options)
Parameter | Type | Description |
---|---|---|
options | ThumbnailGeneratingOptions | The generating options to use. |
Remarks
The ThumbnailGeneratingOptions
allows you to specify the source of thumbnail, size and other options. If attempt to generate thumbnail fails, doesn’t change one.
Examples
Shows how to update a document’s thumbnail.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("Hello world!");
builder.InsertImage(ImageDir + "Logo.jpg");
// There are two ways of setting a thumbnail image when saving a document to .epub.
// 1 - Use the document's first page:
doc.UpdateThumbnail();
doc.Save(ArtifactsDir + "Document.UpdateThumbnail.FirstPage.epub");
// 2 - Use the first image found in the document:
ThumbnailGeneratingOptions options = new ThumbnailGeneratingOptions();
options.ThumbnailSize = new Size(400, 400);
options.GenerateFromFirstPage = false;
doc.UpdateThumbnail(options);
doc.Save(ArtifactsDir + "Document.UpdateThumbnail.FirstImage.epub");
See Also
- class ThumbnailGeneratingOptions
- class Document
- namespace Aspose.Words
- assembly Aspose.Words
UpdateThumbnail()
Updates Thumbnail
of the document using default options.
public void UpdateThumbnail()
Examples
Shows how to update a document’s thumbnail.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("Hello world!");
builder.InsertImage(ImageDir + "Logo.jpg");
// There are two ways of setting a thumbnail image when saving a document to .epub.
// 1 - Use the document's first page:
doc.UpdateThumbnail();
doc.Save(ArtifactsDir + "Document.UpdateThumbnail.FirstPage.epub");
// 2 - Use the first image found in the document:
ThumbnailGeneratingOptions options = new ThumbnailGeneratingOptions();
options.ThumbnailSize = new Size(400, 400);
options.GenerateFromFirstPage = false;
doc.UpdateThumbnail(options);
doc.Save(ArtifactsDir + "Document.UpdateThumbnail.FirstImage.epub");
See Also
- class Document
- namespace Aspose.Words
- assembly Aspose.Words