Browse our Products

Aspose.Words for C++ 23.7 Release Notes

Major Features

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

  • The possibility to save the document page or shape into EPS format has been implemented.
  • The ability to retrieve the digital signature value from a digitally signed document as a byte array has been added.
  • The Row and Cell classes have been extended with new public members.
  • Mustache tags are now supported in the MailMerge.GetRegionsHierarchy and MailMerge.GetFieldNamesForRegion methods.

Full list of changes

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 23.7. 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 get digital signature value from digitally signed document as byte array

Added ability to get a digital signature value from a digitally signed document into Aspose.Words.DigitalSignatures.DigitalSignature class:

    /// Gets an array of bytes representing a signature value.
    ASPOSE_WORDS_SHARED_API const System::ArrayPtr<uint8_t>& get_SignatureValue() const;
    
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(System::String(u"document.docx"));

    for (auto&& digitalSignature : doc->get_DigitalSignatures())
    {
        System::String signatureValue = System::Convert::ToBase64String(digitalSignature->get_SignatureValue());
        System::Console::WriteLine(u"Base64 signature value is: {0}", signatureValue);
    }
    
    // The code produces the following output:
    // Base64 signature value is: AJjRFbflcj+H7VUZ9Q/9rpbavjT7TC10M5orYCRYnEIwyPCtTman8+na4ynclQtBFFgT7uJoHyuHStleXwnbbj6AVNp/B1oCtlEcg9t7WjsgLlm7LQsr6PCCCkgWYNEOwe3s6Wpfop9qkyEEBxATgfpfbbdodB/wO0elS/Ei+dfUmu

Added new EPS image format

The document page or shape could be saved into EPS format now. A new EPS value is added into SaveFormat enum.

    // Open some document.
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(System::String(u"document.docx"));

    // Save the second page as EPS image.
    System::SharedPtr<Aspose::Words::Saving::ImageSaveOptions> saveOptions = System::MakeObject<Aspose::Words::Saving::ImageSaveOptions>(Aspose::Words::SaveFormat::Eps);
    saveOptions->set_PageSet(System::MakeObject<Aspose::Words::Saving::PageSet>(1));
    doc->Save(u"image.eps", saveOptions);
    
    // Open some document.
    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(System::String(u"document.docx"));
    
    // Save the shape as EPS image.
    System::SharedPtr<Aspose::Words::Saving::ImageSaveOptions> saveOptions = System::MakeObject<Aspose::Words::Saving::ImageSaveOptions>(Aspose::Words::SaveFormat::Eps);
    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::Rendering::ShapeRenderer> renderer = shape->GetShapeRenderer();
    renderer->Save(u"image.eps", saveOptions);

Added new public properties Row.NextRow, Row.PreviousRow, Cell.NextCell and Cell.PreviousCell

The following public properties have been added to the Row class:

    /// Gets the next <see cref="Aspose::Words::Tables::Row">Row</see> node.
    ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Tables::Row> get_NextRow();
    
    /// <summary>/// Gets the previous <see cref="Aspose::Words::Tables::Row">Row</see> node.
    ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Tables::Row> get_PreviousRow();

The following public properties have been added to the Cell class:

    /// Gets the next <see cref="Aspose::Words::Tables::Cell">Cell</see> node.
    ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Tables::Cell> get_NextCell();

    /// Gets the previous <see cref="Aspose::Words::Tables::Cell">Cell</see> node.
    ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Tables::Cell> get_PreviousCell();

    System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(System::String(u"document.docx"));
    System::SharedPtr<Aspose::Words::Tables::Table> table = doc->get_FirstSection()->get_Body()->get_Tables()->idx_get(0);
    
    // Enumerate through all cells of the table.
    for (System::SharedPtr<Aspose::Words::Tables::Row> row = table->get_FirstRow(); row != nullptr; row = row->get_NextRow())
    {
        for (System::SharedPtr<Aspose::Words::Tables::Cell> cell = row->get_FirstCell(); cell != nullptr; cell = cell->get_NextCell())
        {
            System::Console::WriteLine(cell->GetText());
        }
    }

A warning is issued if loaded HTML document has fixed-page structure

Aspose.Words doesn’t support loading of fixed-page HTML document (for example, documents that are produced when saving in SaveFormat.HtmlFixed). If Aspose.Words detects that the loaded HTML document has fixed-page structure, it will issue the following warning:

    WarningSource::Html
    WarningType::MajorFormattingLoss
    "The document is fixed-page HTML. Its structure may not be loaded correctly."

Supported mustache tags in the MailMerge.GetRegionsHierarchy and MailMerge.GetFieldNamesForRegion methods

Now the MailMerge.GetRegionsHierarchy method returns mustache regions and mustache fields when the MailMerge.UseNonMergeFields option is true.

Now the MailMerge.GetFieldNamesForRegion method accepts mustache region names and returns mustache field names when the MailMerge.UseNonMergeFields option is true.

The MustacheTag class has been introduced:

    /// Represents "mustache" tag.
    class ASPOSE_WORDS_SHARED_CLASS MustacheTag : public System::Object
    {
    public:
    
        /// Gets the run that contains the beginning of the tag.
        ASPOSE_WORDS_SHARED_API const System::SharedPtr<Aspose::Words::Run>& get_ReferenceRun() const;
    
        /// Gets the zero-based starting position of the tag from the start of the <see cref="Aspose::Words::MailMerging::MustacheTag::get_ReferenceRun">ReferenceRun</see>.
        ASPOSE_WORDS_SHARED_API int32_t get_ReferenceOffset() const;
    
        /// Gets the text of the tag.
        ASPOSE_WORDS_SHARED_API System::String get_Text() const;
    };

The StartMustacheTag, EndMustacheTag and MustacheTags properties have been added to the MailMergeRegionInfo class:

    class ASPOSE_WORDS_SHARED_CLASS MailMergeRegionInfo : public System::Object
    {
    public:
        /// Returns a start "mustache" tag for the region.
        ASPOSE_WORDS_SHARED_API const System::SharedPtr<Aspose::Words::MailMerging::MustacheTag>& get_StartMustacheTag() const;
    
        /// Returns an end "mustache" tag for the region.
        ASPOSE_WORDS_SHARED_API const System::SharedPtr<Aspose::Words::MailMerging::MustacheTag>& get_EndMustacheTag() const;
    
        /// Returns a list of child "mustache" tags.
        ASPOSE_WORDS_SHARED_API const System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<Aspose::Words::MailMerging::MustacheTag>>>& get_MustacheTags() const;
    }

    System::SharedPtr<Aspose::Words::Document> document = System::MakeObject<Aspose::Words::Document>(System::String(u"document.docx"));
    document->get_MailMerge()->set_UseNonMergeFields(true);
    
    System::SharedPtr<Aspose::Words::MailMerging::MailMergeRegionInfo> hierarchy = document->get_MailMerge()->GetRegionsHierarchy();
    
    for (auto&& mustacheTag : System::IterateOver(hierarchy->get_MustacheTags()))
    {
        System::Console::WriteLine(mustacheTag->get_Text());
    }
    
    for (auto&& region : System::IterateOver(hierarchy->get_Regions()))
    {
        System::Console::WriteLine(region->get_StartMustacheTag()->get_Text());
        System::Console::WriteLine(region->get_EndMustacheTag()->get_Text());
    }

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 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.