Aspose::Words::Settings::ViewOptions class
ViewOptions class
Provides various options that control how a document is shown in Microsoft Word. To learn more, visit the Work with Options and Appearance of Word Documents documentation article.
class ViewOptions : public System::Object
Methods
Method | Description |
---|---|
get_DisplayBackgroundShape() const | Controls display of the background shape in print layout view. |
get_DoNotDisplayPageBoundaries() const | Turns off display of the space between the top of the text and the top edge of the page. |
get_FormsDesign() const | Specifies whether the document is in forms design mode. |
get_ViewType() const | Controls the view mode in Microsoft Word. |
get_ZoomPercent() const | Gets or sets the percentage (between 10 and 500) at which you want to view your document. |
get_ZoomType() const | Gets or sets a zoom value based on the size of the window. |
GetType() const override | |
Is(const System::TypeInfo&) const override | |
set_DisplayBackgroundShape(bool) | Setter for Aspose::Words::Settings::ViewOptions::get_DisplayBackgroundShape. |
set_DoNotDisplayPageBoundaries(bool) | Setter for Aspose::Words::Settings::ViewOptions::get_DoNotDisplayPageBoundaries. |
set_FormsDesign(bool) | Setter for Aspose::Words::Settings::ViewOptions::get_FormsDesign. |
set_ViewType(Aspose::Words::Settings::ViewType) | Setter for Aspose::Words::Settings::ViewOptions::get_ViewType. |
set_ZoomPercent(int32_t) | Setter for Aspose::Words::Settings::ViewOptions::get_ZoomPercent. |
set_ZoomType(Aspose::Words::Settings::ZoomType) | Setter for Aspose::Words::Settings::ViewOptions::get_ZoomType. |
static Type() |
Examples
Shows how to set a custom zoom factor, which older versions of Microsoft Word will apply to a document upon loading.
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Hello world!");
doc->get_ViewOptions()->set_ViewType(ViewType::PageLayout);
doc->get_ViewOptions()->set_ZoomPercent(50);
ASSERT_EQ(ZoomType::Custom, doc->get_ViewOptions()->get_ZoomType());
ASSERT_EQ(ZoomType::None, doc->get_ViewOptions()->get_ZoomType());
doc->Save(ArtifactsDir + u"ViewOptions.SetZoomPercentage.doc");
Shows how to set a custom zoom type, which older versions of Microsoft Word will apply to a document upon loading.
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Hello world!");
// Set the "ZoomType" property to "ZoomType.PageWidth" to get Microsoft Word
// to automatically zoom the document to fit the width of the page.
// Set the "ZoomType" property to "ZoomType.FullPage" to get Microsoft Word
// to automatically zoom the document to make the entire first page visible.
// Set the "ZoomType" property to "ZoomType.TextFit" to get Microsoft Word
// to automatically zoom the document to fit the inner text margins of the first page.
doc->get_ViewOptions()->set_ZoomType(zoomType);
doc->Save(ArtifactsDir + u"ViewOptions.SetZoomType.doc");
See Also
- Namespace Aspose::Words::Settings
- Library Aspose.Words for C++