Browse our Products

Aspose.Words for C++ 22.11 Release Notes

Major Features

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

  • Implemented custom colored/grayscale printing mode.
  • Added an ability to create the new structured document tags of Citation type.
  • Implemented field updating progress tracking.
  • Introduced the new property which allows to embed OLE attachments from the source document to the output PDF document.
  • Changed default behavior when opening document of unknown format.

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.

Full List of Issues Covering all Changes in this Release (Reported by .NET Users)

KeySummaryCategory
WORDSNET-23333Provide an ability to track field updating progressNew Feature
WORDSNET-23496Import the borders and the margins of block-level HTML elements during loading alt chunksNew Feature
WORDSNET-23491Consider providing an ability to specify condition name in LINQ reporting syntaxNew Feature
WORDSNET-23489Support tag headers to match opening and closing tags for LINQ Reporting EngineNew Feature
WORDSNET-24350Add a switch to trim the last paragraph break when inserting a document using LINQ Reporting EngineNew Feature
WORDSNET-24421Use information from the OpenType OS/2 table for precise subscript and superscript font sizesNew Feature
WORDSNET-14001Add feature to export OLE as attachment in PDFNew Feature
WORDSNET-24395Incorrect horizontal offsets if display units are set after converting to PDFNew Feature
WORDSNET-24520Date format of SDTs is lost after renderingBug
WORDSNET-17324Document.Compare does not mimic MS Word behaviorBug
WORDSNET-17298It creates a new bullet and same change appears as both an insert and delete after CompareBug
WORDSNET-14770Document.Compare generates incorrect revision in output DOCXBug
WORDSNET-18187Comparing documents with AW gives different revisions from Word compareBug
WORDSNET-21077Wrong detections of revisions - deletion of runs in the next paragraphBug
WORDSNET-23713Cell preferred width does not match MS Word for RTF inputBug
WORDSNET-24375PDF to PDF with signing: Formatting issuesBug
WORDSNET-24266Axis title is rendered while it is invisible in MS WordBug
WORDSNET-24490DocumentBuilder.InsertField methods do not support cursor position at the end of a structured document tagBug
WORDSNET-24113TOC is not the same during DOCX->HTML->DOCX roundtripBug
WORDSNET-24399Circled digits should be rotated like ideographic characters when TextBox has vertical directionBug
WORDSNET-24311System.Exception is thrown when HarfBuzz is used with Fody packageBug
WORDSNET-24470Part of content is lost after open/save DOCX documentBug
WORDSNET-24484Calculate of the position for the below barBug
WORDSNET-24467Exception when loading docxBug
WORDSNET-24491DOCX to HTML: Link inside shapes refers to a non-existing external pageBug
WORDSNET-21894DOCX to PDF conversion issue with chart axis and labelsBug
WORDSNET-24408UnsupportedFileFormatException upon loading documentsBug
WORDSNET-24341Implement caching of background shape for PDFBug
WORDSNET-24507DrHatchBrush shifted for cached shapesBug
WORDSNET-24479Chart is not added to the OTT documentBug
WORDSNET-24176Text reflection position is incorrect after rendering to FixedHtmlBug
WORDSNET-24029FileCorruptedException is thrown upon loading HTML when BlockImportMode.Preserve is usedBug
WORDSNET-21348Document comparison issue with numberingBug
WORDSNET-20025Position of bookmark is incorrect after moving cursor to paragraph and inserting bookmarkBug
WORDSNET-17074Tab stop are exported incorrectly when converting from DOCX to HTMLBug
WORDSNET-24473Document compare throws System.InvalidOperationException: Unexpected node type exceptionBug
WORDSNET-24407Font is changed from “Calibri” to “Times New Roman” after comparing documentsBug
WORDSNET-24035Content is pushed to the next page, that lead to incorrect page countBug
WORDSNET-24471Paragraph first line indent is incorrect after renderingBug
WORDSNET-24366Date format in chart’s axis is incorrectBug
WORDSNET-24036“w14:checked” is not Sdt.CheckBox direct valueBug
WORDSNET-24418PDF to DOCX: Footer overlap on the next pageBug
WORDSNET-24367Axis labels are rendered improperlyBug
WORDSNET-22096Error in low-level  comparison algorithmBug
WORDSNET-24437Formatting of heading is broken when use ImportFormatMode.UseDestinationStyles while appending documentBug
WORDSNET-23228Imitate MS Word behavior for handling invalid table preferred width valuesBug
WORDSNET-24274Embedded PDF document is not renderedBug
WORDSNET-24353Aspose.Words hangs upon rendering documentBug
WORDSNET-20220Table’s column width is changed after conversion from HTML to DOCXBug

Full List of Issues Covering all Changes in this Release (Reported by Java Users)

KeySummaryCategory
WORDSNET-23141Support Nullable values at LINQ Reporting Engine tags where not Nullable values are expectedNew Feature
WORDSNET-20906Document Compare method incorrectly Deletes and then Inserts same ParagraphBug
WORDSNET-18031Document.Compare generates incorrect revisionsBug
WORDSNET-17310Incorrect Revision for a List Paragraph when ComparingBug
WORDSNET-18036Document.Compare generates incorrect revisionsBug
WORDSNET-24516NullReferenceException is thrown when check watermark type in the document without header/footerBug
WORDSNET-24514FileCorruptedException is thrown upon loading DOCX documentBug
WORDSNET-24423DOCX to PDF: Placeholders in formula not rendered correctlyBug
WORDSNET-22563Document.Compare issue with document commentsBug
WORDSNET-24396Font size is incorrect after rendering the documentBug
WORDSNET-24483InvalidCastException is thrown upon comparing documentBug
WORDSNET-24444List list labels are incorrect after rendering documentBug
WORDSNET-24372IF field is updated improperly when REF field is usedBug
WORDSNET-24370Aspose.Words hangs upon rendering documentBug
WORDSNET-24429Span tags created for the blank lines when ExportLanguageToSpanTag is setBug
WORDSNET-17087Make embedded objects in PDF clickableBug
WORDSNET-23263Custom style does not apply after HTML to DOCX conversionBug

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 22.11. 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 PdfSaveOptions.EmbedAttachments property

Related issue: WORDSNET-14001

The new property allows to embed OLE attachments from source document to output PDF document.

/// Gets or sets a value determining whether or not to embed attachments to the PDF document.
/// Default value is <c>%false</c> and attachments are not embedded.
/// When the value is <c>%true</c> attachments are embedded to the PDF document.
/// Embedding attachments is not supported when saving to PDF/A and PDF/UA compliance.
/// <c>%false</c> value will be used automatically.
/// Embedding attachments is not supported when encryption is enabled. <c>%false</c> value
/// will be used automatically.
ASPOSE_WORDS_SHARED_API bool get_EmbedAttachments() const;
/// Setter for Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments
ASPOSE_WORDS_SHARED_API void set_EmbedAttachments(bool value);

Allowed creation of structured document tags of Citation type

Related issue: WORDSNET-24458

Added an ability to create the new structured document tags of SdtType.Citation type.

Use Case:

auto doc = System::MakeObject<Document>();

// Create a structured document tag of the Citation type.
auto sdt = System::MakeObject<StructuredDocumentTag>(doc, SdtType::Citation, MarkupLevel::Inline);

// Append to a paragraph.
auto paragraph = doc->get_FirstSection()->get_Body()->get_FirstParagraph();
paragraph->AppendChild(sdt);

// Create a Citation field.
auto builder = System::MakeObject<DocumentBuilder>(doc);
builder->MoveToParagraph(0, -1);
builder->InsertField(u"CITATION Ath22 \\l 1033 ", u"(Author1, 2022)");

// Move the field to the structured document tag.
while (sdt->get_NextSibling() != nullptr)
sdt->AppendChild(sdt->get_NextSibling());

doc->Save(u"output.docx");

Changed default behavior when opening document of unknown format

Related issue: WORDSNET-24408.

We changed the behavior for the case when the format of the input document cannot be identified. Previously, we always threw an exception. Now we do this only if the input document has the file name extension .docx, .odt, or .sxw. In case the format of the input document cannot be identified and has an extension other than the above-mentioned, the format will be set to .txt.

Use Case:

void OpenDoc(System::String fileName)
{
    try
    {
        System::SharedPtr<Aspose::Words::Document> doc = System::MakeObject<Aspose::Words::Document>(fileName);
    }
    catch (Aspose::Words::UnsupportedFileFormatException& e)
    {
        System::Console::WriteLine(u"{0} is opened with exception", fileName);
        return;
    }

    System::Console::WriteLine(u"{0} is opened successfully", fileName);
}

int main(int argc, char** argv)
{
    System::String content(u'\x0000', 20);

    System::IO::File::WriteAllText(u"a.doc", content);
    OpenDoc(u"a.doc");
    
    System::IO::File::WriteAllText(u"b.docx", content);
    OpenDoc(u"b.docx");
}

// The code produces the following output:
// a.doc is opened successfully
// b.docx is opened with exception

Implemented field updating progress tracking

Related issue: WORDSNET-23333

The following property is added to FieldOptions class:

/// Gets <see cref="Aspose::Words::Fields::IFieldUpdatingProgressCallback">IFieldUpdatingProgressCallback</see> implementation.
ASPOSE_WORDS_SHARED_API const System::SharedPtr<Aspose::Words::Fields::IFieldUpdatingProgressCallback>& get_FieldUpdatingProgressCallback() const;

/// Sets <see cref="Aspose::Words::Fields::IFieldUpdatingProgressCallback">IFieldUpdatingProgressCallback</see> implementation.
void set_FieldUpdatingProgressCallback(const System::SharedPtr<Aspose::Words::Fields::IFieldUpdatingProgressCallback>& value);

New IFieldUpdatingProgressCallback interface is introduced:

/// Interface IFieldUpdatingProgressCallback
/// Implement this interface if you want to track field updating progress.
class ASPOSE_WORDS_SHARED_CLASS IFieldUpdatingProgressCallback : public System::Object
{
    typedef IFieldUpdatingProgressCallback ThisType;
    typedef System::Object BaseType;
    typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
    ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();

public:
    /// A user defined method that is called when updating progress is changed.
    virtual void Notify(System::SharedPtr<Aspose::Words::Fields::FieldUpdatingProgressArgs> args) = 0;
};

New FieldUpdatingProgressArgs class is introduced:

/// Provides data for the field updating progress event.
class ASPOSE_WORDS_SHARED_CLASS FieldUpdatingProgressArgs final : public System::Object
{
    typedef FieldUpdatingProgressArgs ThisType;
    typedef System::Object BaseType;
    typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
    ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();

public:
    /// Gets the total fields count to be updated.
    ASPOSE_WORDS_SHARED_API int32_t get_TotalFieldsCount() const;

    /// Gets the number of updated fields.
    ASPOSE_WORDS_SHARED_API int32_t get_UpdatedFieldsCount() const;
    
    /// Gets a value indicating whether field updating is completed.
    ASPOSE_WORDS_SHARED_API bool get_UpdateCompleted() const;
};

Use Case:

auto document = System::MakeObject<Document>(filename);
document->get_FieldOptions()->set_FieldUpdatingProgressCallback(System::MakeObject<FieldUpdatingProgressCallback>());
document->UpdateFields();

class FieldUpdatingProgressCallback : public IFieldUpdatingProgressCallback
{
    virtual void Notify(System::SharedPtr<Aspose::Words::Fields::FieldUpdatingProgressArgs> args) override
    {
        System::Console::WriteLine(u"{0}/{1}", args->get_UpdateCompleted(), args->get_TotalFieldsCount());
    }
}

Renamed PdfSaveOptions.CacheHeaderFooterShapes property

PdfSaveOptions.CacheHeaderFooterShapes property renamed to PdfSaveOptions.CacheBackgroundGraphics and enabled by default:

/// Gets or sets a value determining whether or not to cache graphics placed in document's background.
/// Default value is <c>%true</c> and background graphics are written to the PDF document as an xObject.
/// When the value is <c>%false</c> background graphics are not cached.
/// Some shapes are not supported for caching(shapes with fields, bookmarks, HRefs).
/// Document background graphic is various shapes, charts, images placed in the footer or header,
/// well as background and border of a page.
bool get_CacheBackgroundGraphics() const;
/// Setter for Aspose::Words::Saving::PdfSaveOptions::get_CacheBackgroundGraphics
void set_CacheBackgroundGraphics(bool value);

The new property allows you to cache the header/footer shapes and reduce the size of PDF output file. Use Case:

auto doc = System::MakeObject<Document>(filename);
auto saveOptions = System::MakeObject<PdfSaveOptions>();
saveOptions->set_CacheBackgroundGraphics(true);
doc->Save(outputFileName, saveOptions);