Browse our Products

Aspose.Words for C++ 23.5 Release Notes

Major Features

There are 174 improvements and fixes in this regular monthly release. The most notable are:

  • Provided the feature to get and modify chart series data.
  • Implemented support for text wrapping in headers/footers.
  • Fixed rendering of MathML formula with embedded images.
  • Added an ability to remove digital signatures from ODT documents.
  • Added public properties to obtain base and ruby text of phonetic guide Run.

Full list of changes

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 23.5. It includes not only new and obsoleted public methods, but also a description of any changes in the behavior behind the scenes in Aspose.Words which may affect existing code. Any behavior introduced that could be seen as regression and modifies the existing behavior is especially important and is documented here.

Added ability to remove digital signatures from ODT

Implemented removing digital signatures from ODT using Aspose.Words.DigitalSignatures.DigitalSignatureUtil.RemoveAllSignatures method.

DigitalSignatureUtil::RemoveAllSignatures(u"in.odt", u"out.odt");

Added new public property FindReplaceOptions.IgnoreShapes

The following public property was added to Aspose.Words.Replacing.FindReplaceOptions class:

    /// Gets a boolean value indicating either to ignore shapes within a text.
    /// The default value is <c>%false</c>.
    ASPOSE_WORDS_SHARED_API bool get_IgnoreShapes() const;

    /// Sets a boolean value indicating either to ignore shapes within a text.
    /// The default value is <c>%false</c>.
    ASPOSE_WORDS_SHARED_API void set_IgnoreShapes(bool value);
    System::SharedPtr<Aspose::Words::DocumentBuilder> builder = System::MakeObject<Aspose::Words::DocumentBuilder>();
    builder->Write(u"123");
    builder->InsertShape(Aspose::Words::Drawing::ShapeType::Balloon, 200, 200);
    builder->Write(u"456");
    
    builder->get_Document()->get_Range()->Replace(u"123456", u"789", [&]{ auto tmp_0 = System::MakeObject<Aspose::Words::Replacing::FindReplaceOptions>(); tmp_0->set_IgnoreShapes(true); return tmp_0; }());
    System::Console::Write(builder->get_Document()->GetText());

    // This code produces the following output:
    // 789
    // \u000c

Added new public property Forms2OleControl.GroupName

The following public property was added to Aspose.Words.Drawing.Ole.Forms2OleControl class:

    /// Gets a string that specifies a group of mutually exclusive controls.
    /// The default value is an empty string.
    ASPOSE_WORDS_SHARED_API System::String get_GroupName();

    /// Sets a string that specifies a group of mutually exclusive controls.
    /// The default value is an empty string.
    ASPOSE_WORDS_SHARED_API void set_GroupName(const System::String& value);
    // Assume there is a shape with Forms2OleControl in document.
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(u"input.docx");
    
    System::SharedPtr<Aspose::Words::Drawing::Shape> shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true));
    System::SharedPtr<Aspose::Words::Drawing::Ole::Forms2OleControl> control = System::ExplicitCast<Aspose::Words::Drawing::Ole::Forms2OleControl>(shape->get_OleFormat()->get_OleControl());
    
    if (control != nullptr)
    {
        System::Console::WriteLine(u"Control group name is: {0}", control->get_GroupName());
        control->set_GroupName(u"newGroup");
    }

Added new public property PdfSaveOptions.ExportParagraphGraphicsToArtifact

The following public property was added to Aspose.Words.Saving.PdfSaveOptions class:

    /// Gets or sets a value determining whether a paragraph graphic should be marked as an artifact.
    /// 
    /// Default value is <c>%false</c> and paragraph graphics (underlines, text emphasis, etc.)
    /// will be marked as "Span" in the logical structure of the document.
    /// 
    /// When the value is <c>%true</c> the paragraph graphics will be marked as "Artifact".
    /// 
    /// This value is ignored when <see cref="Aspose::Words::Saving::PdfSaveOptions::get_ExportDocumentStructure">ExportDocumentStructure</see> is <c>%false</c>.
    ASPOSE_WORDS_SHARED_API bool get_ExportParagraphGraphicsToArtifact() const;

    /// Setter for Aspose::Words::Saving::PdfSaveOptions::get_ExportParagraphGraphicsToArtifact
    ASPOSE_WORDS_SHARED_API void set_ExportParagraphGraphicsToArtifact(bool value);
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(fileName);
    System::SharedPtr<Aspose::Words::Saving::PdfSaveOptions> saveOptions = System::MakeObject<Aspose::Words::Saving::PdfSaveOptions>();
    saveOptions->set_ExportParagraphGraphicsToArtifact(true);
    doc->Save(outputFileName, saveOptions);

Added public properties to obtain base and ruby text of phonetic guide Run

The following public property was added to Aspose.Words.Run class:

    /// Gets a <see cref="Aspose::Words::Run::get_PhoneticGuide">PhoneticGuide</see> object.
    ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::PhoneticGuide> get_PhoneticGuide();

Added the following public class into Aspose.Words namespace:

    /// Represents Phonetic Guide.
    class ASPOSE_WORDS_SHARED_CLASS PhoneticGuide : public System::Object
    {
        /// Gets base text of the phonetic guide.
        ASPOSE_WORDS_SHARED_API System::String get_BaseText();
    
        /// Gets ruby text of the phonetic guide.
        ASPOSE_WORDS_SHARED_API System::String get_RubyText();
    };
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(u"DocWithRuby.docx");
    
    System::SharedPtr<Aspose::Words::Run> run = doc->get_FirstSection()->get_Body()->get_FirstParagraph()->get_Runs()->idx_get(0);
    if (run != nullptr)
    {
        System::Console::WriteLine(run->get_PhoneticGuide()->get_BaseText());
        System::Console::WriteLine(run->get_PhoneticGuide()->get_RubyText());
    }

Added public property ChartSeries.SeriesType of new ChartSeriesType enum type

The SeriesType property has been added to the ChartSeries class:

    /// Gets the type of this chart series.
    ASPOSE_WORDS_SHARED_API Aspose::Words::Drawing::Charts::ChartSeriesType get_SeriesType();

The definition of the added ChartSeriesType enum type:

    /// Specifies a type of a chart series.
    enum class ASPOSE_WORDS_SHARED_CLASS ChartSeriesType
    {
    
        /// Represents an Area chart series.
        Area,
    
        /// Represents a Stacked Area chart series.
        AreaStacked,
    
        /// Represents a 100\% Stacked Area chart series.
        AreaPercentStacked,
    
        /// Represents a 3D Area chart series.
        Area3D,
    
        /// Represents a 3D Stacked Area chart series.
        Area3DStacked,
    
        /// Represents a 3D 100\% Stacked Area chart series.
        Area3DPercentStacked,
    
        /// Represents a Bar chart series.
        Bar,
    
        /// Represents a Stacked Bar chart series.
        BarStacked,
    
        /// Represents a 100\% Stacked Bar chart series.
        BarPercentStacked,
    
        /// Represents a 3D Bar chart series.
        Bar3D,
    
        /// Represents a 3D Stacked Bar chart series.
        Bar3DStacked,
    
        /// Represents a 3D 100\% Stacked Bar chart series.
        Bar3DPercentStacked,
    
        /// Represents a Bubble chart series.
        Bubble,
    
        /// Represents a 3D Bubble chart series.
        Bubble3D,
    
        /// Represents a Column chart series.
        Column,
    
        /// Represents a Stacked Column chart series.
        ColumnStacked,
    
        /// Represents a 100\% Stacked Column chart series.
        ColumnPercentStacked,
    
        /// Represents a 3D Column chart series.
        Column3D,
    
        /// Represents a 3D Stacked Column chart series.
        Column3DStacked,
    
        /// Represents a 3D 100\% Stacked Column chart series.
        Column3DPercentStacked,
    
        /// Represents a 3D Clustered Column chart series.
        Column3DClustered,
    
        /// Represents a Doughnut chart series.
        Doughnut,
    
        /// Represents a Line chart series.
        Line,
    
        /// Represents a Stacked Line chart series.
        LineStacked,
    
        /// Represents a 100\% Stacked Line chart series.
        LinePercentStacked,
    
        /// Represents a 3D Line chart series.
        Line3D,
    
        /// Represents a Pie chart series.
        Pie,
    
        /// Represents a 3D Pie chart series.
        Pie3D,
    
        /// Represents a Pie of Bar chart series.
        PieOfBar,
    
        /// Represents a Pie of Pie chart series.
        PieOfPie,
    
        /// Represents a Radar chart series.
        Radar,
    
        /// Represents a Scatter chart series.
        Scatter,
    
        /// Represents a Stock chart series.
        Stock,
    
        /// Represents a Surface chart series.
        Surface,
    
        /// Represents a 3D Surface chart series.
        Surface3D,
    
        /// Represents a Treemap chart series.
        Treemap,
    
        /// Represents a Sunburst chart series.
        Sunburst,
    
        /// Represents a Histogram chart series.
        Histogram,
    
        /// Represents a Pareto chart series.
        Pareto,
    
        /// Represents a Pareto Line chart series.
        ParetoLine,
    
        /// Represents a Box and Whisker chart series.
        BoxAndWhisker,
    
        /// Represents a Waterfall chart series.
        Waterfall,
    
        /// Represents a Funnel chart series.
        Funnel,
    
        /// Represents a Region Map chart series.
        RegionMap
    };
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(u"ComboChart.docx");
    System::SharedPtr<Aspose::Words::Drawing::Shape> shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true));
    System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
    
    // Remove all series of the Column type.
    for (int32_t i = chart->get_Series()->get_Count() - 1; i >= 0; i--)
    {
        if (chart->get_Series()->idx_get(i)->get_SeriesType() == Aspose::Words::Drawing::Charts::ChartSeriesType::Column)
        {
            chart->get_Series()->RemoveAt(i);
        }
    }
    
    // Add a new series.
    chart->get_Series()->Add(u"New Series", System::MakeArray<System::String>({u"Category 1", u"Category 2", u"Category 3", u"Category 4"}), System::MakeArray<double>({5.6, 7.1, 2.9, 8.9}));
    
    doc->Save(u"out.docx");

Implemented ability to get and modify chart series data

The following changes have been implemented:

Added new classes: ChartXValue, ChartYValue, ChartXValueCollection, ChartYValueCollection, BubbleSizeCollection, ChartMultilevelValue, and new enum types: ChartXValueType, ChartYValueType.

Added new properties and methods to the ChartSeries class.

    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(u"ScatterChart.docx");
    
    System::SharedPtr<Aspose::Words::Drawing::Shape> shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true));
    System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
    System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> series1 = chart->get_Series()->idx_get(0);
    
    // Clear X and Y values of the first series.
    series1->ClearValues();
    
    // Populate the series with data.
    series1->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(3), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(10));
    series1->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(5), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(5));
    series1->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(7), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(11));
    series1->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(9), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(17));
    
    System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> series2 = chart->get_Series()->idx_get(1);
    
    // Clear X and Y values of the second series.
    series2->ClearValues();
    
    // Populate the series with data.
    series2->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(2), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(4));
    series2->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(4), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(7));
    series2->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(6), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(14));
    series2->Add(Aspose::Words::Drawing::Charts::ChartXValue::FromDouble(8), Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(7));
    
    doc->Save(u"out.docx");
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(u"Chart.docx");
    
    System::SharedPtr<Aspose::Words::Drawing::Shape> shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true));
    System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
    System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> series = chart->get_Series()->idx_get(0);
    
    double minValue = std::numeric_limits<double>::max();
    int32_t minValueIndex = 0;
    double maxValue = std::numeric_limits<double>::lowest();
    int32_t maxValueIndex = 0;
    
    for (int32_t i = 0; i < series->get_YValues()->get_Count(); i++)
    {
        // Clear individual format of all data points. Data points and data values are one-to-one in column charts.
        series->get_DataPoints()->idx_get(i)->ClearFormat();
        
        // Get Y value.
        double yValue = series->get_YValues()->idx_get(i)->get_DoubleValue();
        
        if (yValue < minValue)
        {
            minValue = yValue;
            minValueIndex = i;
        }
        
        if (yValue > maxValue)
        {
            maxValue = yValue;
            maxValueIndex = i;
        }
    }
    
    // Change colors of the max and min values.
    series->get_DataPoints()->idx_get(minValueIndex)->get_Format()->get_Fill()->set_ForeColor(System::Drawing::Color::get_Red());
    series->get_DataPoints()->idx_get(maxValueIndex)->get_Format()->get_Fill()->set_ForeColor(System::Drawing::Color::get_Green());
    
    doc->Save(u"out.docx");
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(u"SalesChart.docx");
    
    System::SharedPtr<Aspose::Words::Drawing::Shape> shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true));
    System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
    System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> department1Series = chart->get_Series()->idx_get(0);
    System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> department2Series = chart->get_Series()->idx_get(1);
    
    // Remove the first value in the both series.
    department1Series->Remove(0);
    department2Series->Remove(0);
    
    // Add new values to the both series.
    System::SharedPtr<Aspose::Words::Drawing::Charts::ChartXValue> newXCategory = Aspose::Words::Drawing::Charts::ChartXValue::FromString(u"Q1, 2023");
    department1Series->Add(newXCategory, Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(10.3));
    department2Series->Add(newXCategory, Aspose::Words::Drawing::Charts::ChartYValue::FromDouble(5.7));
    
    doc->Save(u"out.docx");

Limitations and API Differences

Aspose.Words for C++ has some differences as compared to its equivalent .NET version of the API. This section contains information about all such functionality that is not available in the current release. The missing features will be added in future releases.

  • The current release does not support Metered license.
  • The current release does not support LINQ and Reporting features.
  • The current release does not support OpenGL 3D Shapes rendering.
  • The current release does not support loading PDF documents.
  • The current release has limited support for database features - C++ doesn’t have common API for DB like .NET System.Data.
  • The current release supports Microsoft Visual C++ version 2017 or higher.
  • The current release supports GCC 6.3 or higher and Clang 3.9.1 or higher on Linux and only for the x86_x64 platform.
  • The current release supports macOS Big Sur or later (11.5+) for 64-bit Intel Mac platform.