GroupDocs.Parser for Java 26.9 Release Notes

Major Features

This release brings the annotation extraction API to Java, adds page count, text area and table extraction for HTML documents, lets the file extension guide format detection, and restores metered licensing, which could not be applied in 26.5. All bundled Aspose components have been updated.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
PARSERJAVAImplement the ability to extract annotations from PDF documentsImprovement
PARSERJAVAImplement annotation extraction for electronic text documentsImprovement
PARSERJAVAImplement annotation extraction for presentationsImprovement
PARSERJAVAAdd additional data to the extracted annotation classImprovement
PARSERJAVAImplement text extraction without comments for word processing documentsImprovement
PARSERJAVAImplement text extraction with comments for presentationsImprovement
PARSERJAVAImplement table extraction from HTML documentsImprovement
PARSERJAVAImplement page count and text area extraction for HTML documentsImprovement
PARSERJAVAImplement file type detection by file extensionImprovement
PARSERJAVAImplement detection of the target platform at runtimeImprovement
PARSERJAVAMark constructors of some data classes deprecatedImprovement
PARSERJAVAUpdate the bundled Aspose componentsImprovement
PARSERJAVASign release JARs with GPG detached signaturesImprovement
PARSERJAVAShip third-party license notices and module metadata in the JARImprovement
PARSERJAVAA metered license cannot be applied: “Signature encoding error”Fix
PARSERJAVAExcessive memory usage when parsing image-heavy PDF documentsFix
PARSERJAVAgetFileInfo reports no file type and zero size for encrypted documentsFix
PARSERJAVAThe page index is ignored when extracting images from HTML documentsFix
PARSERJAVAHarden XML parsing against external entity resolutionFix

Public API and Backward Incompatible Changes

Annotation extraction

Annotations can now be extracted from PDF documents, word processing documents and presentations, either on their own or together with the document text.

Public API changes:

  • Class AnnotationItem added to the com.groupdocs.parser.data package, with the properties value, annotationType ("Comment" by default), timestamp (java.util.Date), authorName and authorInitials.
  • Methods getAnnotations() and getAnnotations(int pageIndex) added to the Parser class.
  • Method isAnnotations() added to the Features class.
  • Property includeAnnotations added to the TextOptions class.
try (Parser parser = new Parser("annotated.docx")) {
    Iterable<AnnotationItem> annotations = parser.getAnnotations();
    if (annotations == null) {
        return; // Annotation extraction isn't supported for this document
    }

    for (AnnotationItem annotation : annotations) {
        System.out.println(annotation.getAuthorName() + " (" + annotation.getAnnotationType() + "): "
                + annotation.getValue());
    }
}

Comments in extracted text

TextOptions.setIncludeAnnotations(boolean) controls whether annotations are part of the extracted text. Note that the underlying document models differ:

  • in word processing documents comments belong to the text, so the option keeps them;
  • in presentations comments are stored separately, so the option adds them.
TextOptions options = new TextOptions(false);
options.setIncludeAnnotations(true);

try (Parser parser = new Parser("annotated.docx");
     TextReader reader = parser.getText(options)) {
    System.out.println(reader.readToEnd());
}

Backward incompatible change: with the default options, comment text is no longer part of the text extracted from word processing documents. Call setIncludeAnnotations(true) to get the previous result.

Page separator in word processing text

Whole-document text extraction for word processing documents now goes through the same page text cache as page-by-page extraction. As a result the form feed character (\f) that used to end each page is no longer emitted; pages are separated by a line break, and the last page is returned as a separate line.

HTML documents: pages, text areas and tables

getPageCount, getTextAreas and getTables are now implemented for HTML documents, and Features.isTables() reports true for them.

try (Parser parser = new Parser("document.html")) {
    System.out.println("Pages: " + parser.getDocumentInfo().getPageCount());

    for (PageTableArea table : parser.getTables()) {
        System.out.println(table.getRowCount() + "x" + table.getColumnCount());
    }
}

Backward incompatible change: getImages(int pageIndex) on an HTML document now returns the images of the requested page. It previously returned every image in the document regardless of the page index.

File type detection by file extension

When Parser.getFileInfo(String filePath) is given a path, a known file extension now narrows content-based detection to that format’s detector, which resolves formats that content sniffing alone cannot tell apart. Files whose extension is unknown keep the previous content-only behaviour, and the java.io.InputStream overload is unchanged.

Backward incompatible change: for a file whose extension and content disagree, the detected file type can differ from the one reported by 26.5.

File information for encrypted documents

getFileInfo now returns FileType.Unknown together with the real file size and isEncrypted() == true for password-protected office documents. It previously returned an empty file info with no file type and a size of 0.

Deprecated constructors

The constructors of DocumentData, DocumentPageData and FieldData are marked as deprecated; these objects are produced by the library and are not meant to be created by user code.

Metered licensing

Metered.setMeteredKey(publicKey, privateKey) threw

GroupDocsParserException: Failed to set license. Details: Signature encoding error

on every call in 26.5, so a metered license could not be applied at all. Applying a metered key licenses the bundled Aspose components with an internal license, and one of the bundled components predated the signature format of that license.

Besides updating the component, every bundled component is now licensed independently, so a component that refuses the internal license can no longer interrupt the licensing of the remaining ones.

Memory usage on image-heavy PDF documents

Text extraction from image-heavy PDF documents no longer retains the decoded image data. Measured on a 52 MB document that previously could not be parsed in a 2 GB heap: the document now parses in a 768 MB heap and retains a 192 MB live set afterwards.

Presentation page previews

Page preview rendering for presentations moved to the current Aspose.Slides image API. Rendered previews may differ slightly from those produced by 26.5.

Updated Aspose components

Component26.526.9
Aspose.Cells23.626.3
Aspose.Email24.926.1
Aspose.Imaging21.225.12
Aspose.PDF23.426.2
Aspose.Slides23.326.2
Aspose.Words23.626.3
Aspose.BarCode24.626.4
Aspose.ZIP24.825.10
Aspose.Note23.323.3

Package signing and metadata

  • The published JAR is accompanied by a GPG detached signature (.asc) signed with the GroupDocs public key, in place of the Authenticode signature used previously.
  • The JAR carries third-party license notices under META-INF, and the manifest declares Automatic-Module-Name: com.groupdocs.parser for use on the module path.