Aspose::Words::Settings::CompatibilityOptions class

CompatibilityOptions class

Contains compatibility options (that is, the user preferences entered on the Compatibility tab of the Options dialog in Microsoft Word). To learn more, visit the Detect File Format and Check Format Compatibility documentation article.

class CompatibilityOptions : public System::Object

Methods

MethodDescription
get_AdjustLineHeightInTable()Add Document Grid Line Pitch To Lines in Table Cells.
get_AlignTablesRowByRow()Align Table Rows Independently.
get_AllowSpaceOfSameStyleInTable()Allow Contextual Spacing of Paragraphs in Tables.
get_ApplyBreakingRules()Use Legacy Ethiopic and Amharic Line Breaking Rules.
get_AutofitToFirstFixedWidthCell()Allow Table Columns To Exceed Preferred Widths of Constituent Cells.
get_AutoSpaceLikeWord95()Emulate Word 95 Full-Width Character Spacing.
get_BalanceSingleByteDoubleByteWidth()Balance Single Byte and Double Byte Characters.
get_CachedColBalance()Use Cached Paragraph Information for Column Balancing.
get_ConvMailMergeEsc()Treat Backslash Quotation Delimiter as Two Quotation Marks.
get_DisableOpenTypeFontFormattingFeatures()Specifies to disable OpenType font formatting features.
get_DisplayHangulFixedWidth()Always Use Fixed Width for Hangul Characters.
get_DoNotAutofitConstrainedTables()Do Not AutoFit Tables To Fit Next To Wrapped Objects.
get_DoNotBreakConstrainedForcedTable()Don’t Break Table Rows Around Floating Tables.
get_DoNotBreakWrappedTables()Do Not Allow Floating Tables To Break Across Pages.
get_DoNotExpandShiftReturn()Don’t Justify Lines Ending in Soft Line Break.
get_DoNotLeaveBackslashAlone()Convert Backslash To Yen Sign When Entered.
get_DoNotSnapToGridInCell()Do Not Snap to Document Grid in Table Cells with Objects.
get_DoNotSuppressIndentation()Do Not Ignore Floating Objects When Calculating Paragraph Indentation.
get_DoNotSuppressParagraphBorders()Do Not Suppress Paragraph Borders Next To Frames.
get_DoNotUseEastAsianBreakRules()Do Not Compress Compressible Characters When Using Document Grid.
get_DoNotUseHTMLParagraphAutoSpacing()Use Fixed Paragraph Spacing for HTML Auto Setting.
get_DoNotUseIndentAsNumberingTabStop()Ignore Hanging Indent When Creating Tab Stop After Numbering.
get_DoNotVertAlignCellWithSp()Don’t Vertically Align Cells Containing Floating Objects.
get_DoNotVertAlignInTxbx()Ignore Vertical Alignment in Textboxes.
get_DoNotWrapTextWithPunct()Do Not Allow Hanging Punctuation With Character Grid.
get_FootnoteLayoutLikeWW8()Emulate Word 6.x/95/97 Footnote Placement.
get_ForgetLastTabAlignment()Ignore Width of Last Tab Stop When Aligning Paragraph If It Is Not Left Aligned.
get_GrowAutofit()Allow Tables to AutoFit Into Page Margins.
get_LayoutRawTableWidth()Ignore Space Before Table When Deciding If Table Should Wrap Floating Object.
get_LayoutTableRowsApart()Allow Table Rows to Wrap Inline Objects Independently.
get_LineWrapLikeWord6()Emulate Word 6.0 Line Wrapping for East Asian Text.
get_MWSmallCaps()Emulate Word 5.x for the Macintosh Small Caps Formatting.
get_NoColumnBalance()Do Not Balance Text Columns within a Section.
get_NoExtraLineSpacing()Do Not Center Content on Lines With Exact Line Height.
get_NoLeading()Do Not Add Leading Between Lines of Text.
get_NoSpaceRaiseLower()Do Not Increase Line Height for Raised/Lowered Text.
get_NoTabHangInd()Do Not Create Custom Tab Stop for Hanging Indent.
get_OverrideTableStyleFontSizeAndJustification()Specifies how the style hierarchy of the document is evaluated.
get_PrintBodyTextBeforeHeader()Print Body Text before Header/Footer Contents.
get_PrintColBlack()Print Colors as Black And White without Dithering.
get_SelectFldWithFirstOrLastChar()Select Field When First or Last Character Is Selected.
get_ShapeLayoutLikeWW8()Emulate Word 97 Text Wrapping Around Floating Objects.
get_ShowBreaksInFrames()Display Page/Column Breaks Present in Frames.
get_SpaceForUL()Add Additional Space Below Baseline For Underlined East Asian Text.
get_SpacingInWholePoints()Only Expand/Condense Text By Whole Points.
get_SplitPgBreakAndParaMark()Always Move Paragraph Mark to Page after a Page Break.
get_SubFontBySize()Increase Priority Of Font Size During Font Substitution.
get_SuppressBottomSpacing()Ignore Exact Line Height for Last Line on Page.
get_SuppressSpacingAtTopOfPage()Ignore Minimum Line Height for First Line on Page.
get_SuppressSpBfAfterPgBrk()Do Not Use Space Before On First Line After a Page Break.
get_SuppressTopSpacing()Ignore Minimum and Exact Line Height for First Line on Page.
get_SuppressTopSpacingWP()Emulate WordPerfect 5.x Line Spacing.
get_SwapBordersFacingPgs()Swap Paragraph Borders on Odd Numbered Pages.
get_SwapInsideAndOutsideForMirrorIndentsAndRelativePositioning()Specifies to swap inside and outside for mirror indents and relative positioning.
get_TransparentMetafiles()Specifies not to blank the area behind metafile pictures.
get_TruncateFontHeightsLikeWP6()Emulate WordPerfect 6.x Font Height Calculation.
get_UICompat97To2003()True to disable UI functionality which is not compatible with Word97-2003. Default value is false.
get_UlTrailSpace()Underline All Trailing Spaces.
get_UnderlineTabInNumList()Underline Following Character Following Numbering.
get_UseAltKinsokuLineBreakRules()Use Alternate Set of East Asian Line Breaking Rules.
get_UseAnsiKerningPairs()Use ANSI Kerning Pairs from Fonts.
get_UseFELayout()Do Not Bypass East Asian/Complex Script Layout Code.
get_UseNormalStyleForList()Do Not Automatically Apply List ParagraphStyle To Bulleted/Numbered Text.
get_UsePrinterMetrics()Use Printer Metrics To Display Documents.
get_UseSingleBorderforContiguousCells()Use Simplified Rules For Table Border Conflicts.
get_UseWord2002TableStyleRules()Emulate Word 2002 Table Style Rules.
get_UseWord2010TableStyleRules()Specifies to use Word2010 table style rules.
get_UseWord97LineBreakRules()Emulate Word 97 East Asian Line Breaking.
get_WPJustification()Emulate WordPerfect 6.x Paragraph Justification.
get_WPSpaceWidth()Specifies whether to set the width of a space as is done in WordPerfect 5.x.
get_WrapTrailSpaces()Line Wrap Trailing Spaces.
GetType() const override
Is(const System::TypeInfo&) const override
OptimizeFor(Aspose::Words::Settings::MsWordVersion)Allows to optimize the document contents as well as default Aspose.Words behavior to a particular versions of MS Word. Use this method to prevent MS Word from displaying “Compatibility mode” ribbon upon document loading. (Note that you may also need to set the Compliance property to Iso29500_2008_Transitional or higher.)
set_AdjustLineHeightInTable(bool)Add Document Grid Line Pitch To Lines in Table Cells.
set_AlignTablesRowByRow(bool)Align Table Rows Independently.
set_AllowSpaceOfSameStyleInTable(bool)Allow Contextual Spacing of Paragraphs in Tables.
set_ApplyBreakingRules(bool)Use Legacy Ethiopic and Amharic Line Breaking Rules.
set_AutofitToFirstFixedWidthCell(bool)Allow Table Columns To Exceed Preferred Widths of Constituent Cells.
set_AutoSpaceLikeWord95(bool)Emulate Word 95 Full-Width Character Spacing.
set_BalanceSingleByteDoubleByteWidth(bool)Balance Single Byte and Double Byte Characters.
set_CachedColBalance(bool)Use Cached Paragraph Information for Column Balancing.
set_ConvMailMergeEsc(bool)Treat Backslash Quotation Delimiter as Two Quotation Marks.
set_DisableOpenTypeFontFormattingFeatures(bool)Specifies to disable OpenType font formatting features.
set_DisplayHangulFixedWidth(bool)Always Use Fixed Width for Hangul Characters.
set_DoNotAutofitConstrainedTables(bool)Do Not AutoFit Tables To Fit Next To Wrapped Objects.
set_DoNotBreakConstrainedForcedTable(bool)Don’t Break Table Rows Around Floating Tables.
set_DoNotBreakWrappedTables(bool)Do Not Allow Floating Tables To Break Across Pages.
set_DoNotExpandShiftReturn(bool)Don’t Justify Lines Ending in Soft Line Break.
set_DoNotLeaveBackslashAlone(bool)Convert Backslash To Yen Sign When Entered.
set_DoNotSnapToGridInCell(bool)Do Not Snap to Document Grid in Table Cells with Objects.
set_DoNotSuppressIndentation(bool)Do Not Ignore Floating Objects When Calculating Paragraph Indentation.
set_DoNotSuppressParagraphBorders(bool)Do Not Suppress Paragraph Borders Next To Frames.
set_DoNotUseEastAsianBreakRules(bool)Do Not Compress Compressible Characters When Using Document Grid.
set_DoNotUseHTMLParagraphAutoSpacing(bool)Use Fixed Paragraph Spacing for HTML Auto Setting.
set_DoNotUseIndentAsNumberingTabStop(bool)Ignore Hanging Indent When Creating Tab Stop After Numbering.
set_DoNotVertAlignCellWithSp(bool)Don’t Vertically Align Cells Containing Floating Objects.
set_DoNotVertAlignInTxbx(bool)Ignore Vertical Alignment in Textboxes.
set_DoNotWrapTextWithPunct(bool)Do Not Allow Hanging Punctuation With Character Grid.
set_FootnoteLayoutLikeWW8(bool)Emulate Word 6.x/95/97 Footnote Placement.
set_ForgetLastTabAlignment(bool)Ignore Width of Last Tab Stop When Aligning Paragraph If It Is Not Left Aligned.
set_GrowAutofit(bool)Allow Tables to AutoFit Into Page Margins.
set_LayoutRawTableWidth(bool)Ignore Space Before Table When Deciding If Table Should Wrap Floating Object.
set_LayoutTableRowsApart(bool)Allow Table Rows to Wrap Inline Objects Independently.
set_LineWrapLikeWord6(bool)Emulate Word 6.0 Line Wrapping for East Asian Text.
set_MWSmallCaps(bool)Emulate Word 5.x for the Macintosh Small Caps Formatting.
set_NoColumnBalance(bool)Do Not Balance Text Columns within a Section.
set_NoExtraLineSpacing(bool)Do Not Center Content on Lines With Exact Line Height.
set_NoLeading(bool)Do Not Add Leading Between Lines of Text.
set_NoSpaceRaiseLower(bool)Do Not Increase Line Height for Raised/Lowered Text.
set_NoTabHangInd(bool)Do Not Create Custom Tab Stop for Hanging Indent.
set_OverrideTableStyleFontSizeAndJustification(bool)Specifies how the style hierarchy of the document is evaluated.
set_PrintBodyTextBeforeHeader(bool)Print Body Text before Header/Footer Contents.
set_PrintColBlack(bool)Print Colors as Black And White without Dithering.
set_SelectFldWithFirstOrLastChar(bool)Select Field When First or Last Character Is Selected.
set_ShapeLayoutLikeWW8(bool)Emulate Word 97 Text Wrapping Around Floating Objects.
set_ShowBreaksInFrames(bool)Display Page/Column Breaks Present in Frames.
set_SpaceForUL(bool)Add Additional Space Below Baseline For Underlined East Asian Text.
set_SpacingInWholePoints(bool)Only Expand/Condense Text By Whole Points.
set_SplitPgBreakAndParaMark(bool)Always Move Paragraph Mark to Page after a Page Break.
set_SubFontBySize(bool)Increase Priority Of Font Size During Font Substitution.
set_SuppressBottomSpacing(bool)Ignore Exact Line Height for Last Line on Page.
set_SuppressSpacingAtTopOfPage(bool)Ignore Minimum Line Height for First Line on Page.
set_SuppressSpBfAfterPgBrk(bool)Do Not Use Space Before On First Line After a Page Break.
set_SuppressTopSpacing(bool)Ignore Minimum and Exact Line Height for First Line on Page.
set_SuppressTopSpacingWP(bool)Emulate WordPerfect 5.x Line Spacing.
set_SwapBordersFacingPgs(bool)Swap Paragraph Borders on Odd Numbered Pages.
set_SwapInsideAndOutsideForMirrorIndentsAndRelativePositioning(bool)Specifies to swap inside and outside for mirror indents and relative positioning.
set_TransparentMetafiles(bool)Specifies not to blank the area behind metafile pictures.
set_TruncateFontHeightsLikeWP6(bool)Emulate WordPerfect 6.x Font Height Calculation.
set_UICompat97To2003(bool)True to disable UI functionality which is not compatible with Word97-2003. Default value is false.
set_UlTrailSpace(bool)Underline All Trailing Spaces.
set_UnderlineTabInNumList(bool)Underline Following Character Following Numbering.
set_UseAltKinsokuLineBreakRules(bool)Use Alternate Set of East Asian Line Breaking Rules.
set_UseAnsiKerningPairs(bool)Use ANSI Kerning Pairs from Fonts.
set_UseFELayout(bool)Do Not Bypass East Asian/Complex Script Layout Code.
set_UseNormalStyleForList(bool)Do Not Automatically Apply List ParagraphStyle To Bulleted/Numbered Text.
set_UsePrinterMetrics(bool)Use Printer Metrics To Display Documents.
set_UseSingleBorderforContiguousCells(bool)Use Simplified Rules For Table Border Conflicts.
set_UseWord2002TableStyleRules(bool)Emulate Word 2002 Table Style Rules.
set_UseWord2010TableStyleRules(bool)Specifies to use Word2010 table style rules.
set_UseWord97LineBreakRules(bool)Emulate Word 97 East Asian Line Breaking.
set_WPJustification(bool)Emulate WordPerfect 6.x Paragraph Justification.
set_WPSpaceWidth(bool)Specifies whether to set the width of a space as is done in WordPerfect 5.x.
set_WrapTrailSpaces(bool)Line Wrap Trailing Spaces.
static Type()

Examples

Shows how to set an OOXML compliance specification for a saved document to adhere to.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

// If we configure compatibility options to comply with Microsoft Word 2003,
// inserting an image will define its shape using VML.
doc->get_CompatibilityOptions()->OptimizeFor(MsWordVersion::Word2003);
builder->InsertImage(ImageDir + u"Transparent background logo.png");

ASSERT_EQ(ShapeMarkupLanguage::Vml, (System::ExplicitCast<Shape>(doc->GetChild(NodeType::Shape, 0, true)))->get_MarkupLanguage());

// The "ISO/IEC 29500:2008" OOXML standard does not support VML shapes.
// If we set the "Compliance" property of the SaveOptions object to "OoxmlCompliance.Iso29500_2008_Strict",
// any document we save while passing this object will have to follow that standard.
auto saveOptions = MakeObject<OoxmlSaveOptions>();
saveOptions->set_Compliance(OoxmlCompliance::Iso29500_2008_Strict);
saveOptions->set_SaveFormat(SaveFormat::Docx);

doc->Save(ArtifactsDir + u"OoxmlSaveOptions.Iso29500Strict.docx", saveOptions);

// Our saved document defines the shape using DML to adhere to the "ISO/IEC 29500:2008" OOXML standard.
doc = MakeObject<Document>(ArtifactsDir + u"OoxmlSaveOptions.Iso29500Strict.docx");

ASSERT_EQ(ShapeMarkupLanguage::Dml, (System::ExplicitCast<Shape>(doc->GetChild(NodeType::Shape, 0, true)))->get_MarkupLanguage());

Shows how to vertically align the text contents of a text box.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

SharedPtr<Shape> shape = builder->InsertShape(ShapeType::TextBox, 200, 200);

// Set the "VerticalAnchor" property to "TextBoxAnchor.Top" to
// align the text in this text box with the top side of the shape.
// Set the "VerticalAnchor" property to "TextBoxAnchor.Middle" to
// align the text in this text box to the center of the shape.
// Set the "VerticalAnchor" property to "TextBoxAnchor.Bottom" to
// align the text in this text box to the bottom of the shape.
shape->get_TextBox()->set_VerticalAnchor(verticalAnchor);

builder->MoveTo(shape->get_FirstParagraph());
builder->Write(u"Hello world!");

// The vertical aligning of text inside text boxes is available from Microsoft Word 2007 onwards.
doc->get_CompatibilityOptions()->OptimizeFor(MsWordVersion::Word2007);
doc->Save(ArtifactsDir + u"Shape.VerticalAnchor.docx");

See Also