GroupDocs.Parser for .NET 26.8 Release Notes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
PARSERNET-2903Add additional data to the extracted annotation classImprovement
PARSERNET-2899Implement annotation extraction for electronic text documentsImprovement
PARSERNET-2900Implement annotation extraction for presentationsImprovement

Public API and Backward Incompatible Changes

Add additional data to the extracted annotation class

To improve the context and traceability of extracted annotations, the AnnotationItem class now includes additional metadata fields.

PropertyTypeDescription
AnnotationTypestringThe annotation type.
PageIndexintZero-based index of the page (or slide) where the annotation is located.
TimestampDateTime?Date and time when the annotation was created or last modified.
AuthorNamestringName of the author who created or last modified the annotation.
AuthorInitialsstringInitials of the author who created or last modified the annotation.

Public API changes

Property System.String AnnotationType has been added to GroupDocs.Parser.Data.AnnotationItem class.
Property System.Int32 PageIndex has been added to GroupDocs.Parser.Data.AnnotationItem class.
Property System.Nullable<System.DateTime> Timestamp has been added to GroupDocs.Parser.Data.AnnotationItem class.
Property System.String AuthorName has been added to GroupDocs.Parser.Data.AnnotationItem class.
Property System.String AuthorInitials has been added to GroupDocs.Parser.Data.AnnotationItem class.

Usage

The AnnotationItem object now provides richer metadata:

using (Parser parser = new Parser("Document.pdf"))
{
    foreach (AnnotationItem annotation in parser.GetAnnotations())
    {
        Console.WriteLine($"Type: {annotation.AnnotationType}");
        Console.WriteLine($"Author: {annotation.AuthorName} ({annotation.AuthorInitials})");
        Console.WriteLine($"Created/Modified: {annotation.Timestamp}");
        Console.WriteLine($"Page/Slide: {annotation.PageIndex}");
        Console.WriteLine($"Content: {annotation.Value}");
    }
}

Implement annotation extraction for electronic text documents

This improvement extends the annotation extraction capability to electronic text documents (e.g., DOCX, RTF, TXT). Annotations (such as comments, tracked changes, or embedded notes) can now be extracted using the GetAnnotations methods and included during full text extraction via GetText when TextOptions.IncludeAnnotations is set to true.

Public API changes

None.

Usage

The following example demonstrates how to extract annotations from a DOCX document:

using (Parser parser = new Parser("MyFile.docx"))
{
    // Extract annotations separately
    IEnumerable<AnnotationItem> annotations = parser.GetAnnotations();
    foreach (AnnotationItem annotation in annotations)
    {
        Console.WriteLine($"Author: {annotation.AuthorName}, Type: {annotation.AnnotationType}");
        Console.WriteLine($"Page: {annotation.PageIndex}, Date: {annotation.Timestamp}");
        Console.WriteLine($"Text: {annotation.Value}");
    }

    // Or extract annotations together with the full text
    TextOptions options = new TextOptions()
    {
        IncludeAnnotations = true
    };
    using (TextReader reader = parser.GetText(options))
    {
        string text = reader.ReadToEnd();
        Console.WriteLine(text);
    }
}

Implement annotation extraction for presentations

This improvement adds support for extracting annotations from presentation documents (e.g., PPTX, PPT), including slide comments and reviewer notes. Annotations are accessible via the same GetAnnotations API and included in text extraction when enabled.

Public API changes

None.

Usage

The following example demonstrates how to extract comments from a PPTX presentation:

using (Parser parser = new Parser("MyPresentation.pptx"))
{
    IEnumerable<AnnotationItem> annotations = parser.GetAnnotations();
    foreach (AnnotationItem annotation in annotations)
    {
        Console.WriteLine($"Slide: {annotation.PageIndex}, Author: {annotation.AuthorInitials}");
        Console.WriteLine($"Created: {annotation.Timestamp}, Type: {annotation.AnnotationType}");
        Console.WriteLine($"Comment: {annotation.Value}");
    }
}