Aspose::Words::Rendering::ThumbnailGeneratingOptions Class Reference

Detailed Description

Can be used to specify additional options when generating thumbnail for a document.

Examples

Shows how to update a document's thumbnail.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Hello world!");
builder->InsertImage(ImageDir + u"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 + u"Document.UpdateThumbnail.FirstPage.epub");
// 2 - Use the first image found in the document:
auto options = MakeObject<ThumbnailGeneratingOptions>();
options->set_ThumbnailSize(System::Drawing::Size(400, 400));
options->set_GenerateFromFirstPage(false);
doc->UpdateThumbnail(options);
doc->Save(ArtifactsDir + u"Document.UpdateThumbnail.FirstImage.epub");

#include <Aspose.Words.Cpp/Rendering/ThumbnailGeneratingOptions.h>

+ Inheritance diagram for Aspose::Words::Rendering::ThumbnailGeneratingOptions:

Public Member Functions

 ThumbnailGeneratingOptions ()
 
bool get_GenerateFromFirstPage () const
 Specifies whether to generate thumbnail from first page of the document or first image. More...
 
Size get_ThumbnailSize () const
 Size of generated thumbnail in pixels. Default is 600x900. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_GenerateFromFirstPage (bool value)
 Setter for get_GenerateFromFirstPage. More...
 
void set_ThumbnailSize (Size value)
 Setter for get_ThumbnailSize. More...
 

Static Public Member Functions

static const TypeInfoType ()
 

Constructor & Destructor Documentation

◆ ThumbnailGeneratingOptions()

Aspose::Words::Rendering::ThumbnailGeneratingOptions::ThumbnailGeneratingOptions ( )

Member Function Documentation

◆ get_GenerateFromFirstPage()

bool Aspose::Words::Rendering::ThumbnailGeneratingOptions::get_GenerateFromFirstPage ( ) const

Specifies whether to generate thumbnail from first page of the document or first image.

Examples

Shows how to update a document's thumbnail.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Hello world!");
builder->InsertImage(ImageDir + u"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 + u"Document.UpdateThumbnail.FirstPage.epub");
// 2 - Use the first image found in the document:
auto options = MakeObject<ThumbnailGeneratingOptions>();
options->set_ThumbnailSize(System::Drawing::Size(400, 400));
options->set_GenerateFromFirstPage(false);
doc->UpdateThumbnail(options);
doc->Save(ArtifactsDir + u"Document.UpdateThumbnail.FirstImage.epub");

◆ get_ThumbnailSize()

System::Drawing::Size Aspose::Words::Rendering::ThumbnailGeneratingOptions::get_ThumbnailSize ( ) const

Size of generated thumbnail in pixels. Default is 600x900.

Examples

Shows how to update a document's thumbnail.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Hello world!");
builder->InsertImage(ImageDir + u"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 + u"Document.UpdateThumbnail.FirstPage.epub");
// 2 - Use the first image found in the document:
auto options = MakeObject<ThumbnailGeneratingOptions>();
options->set_ThumbnailSize(System::Drawing::Size(400, 400));
options->set_GenerateFromFirstPage(false);
doc->UpdateThumbnail(options);
doc->Save(ArtifactsDir + u"Document.UpdateThumbnail.FirstImage.epub");

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Rendering::ThumbnailGeneratingOptions::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::Rendering::ThumbnailGeneratingOptions::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ set_GenerateFromFirstPage()

void Aspose::Words::Rendering::ThumbnailGeneratingOptions::set_GenerateFromFirstPage ( bool  value)

◆ set_ThumbnailSize()

void Aspose::Words::Rendering::ThumbnailGeneratingOptions::set_ThumbnailSize ( System::Drawing::Size  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::Rendering::ThumbnailGeneratingOptions::Type ( )
static