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
| Key | Summary | Category |
|---|---|---|
| PARSERJAVA | Implement the ability to extract annotations from PDF documents | Improvement |
| PARSERJAVA | Implement annotation extraction for electronic text documents | Improvement |
| PARSERJAVA | Implement annotation extraction for presentations | Improvement |
| PARSERJAVA | Add additional data to the extracted annotation class | Improvement |
| PARSERJAVA | Implement text extraction without comments for word processing documents | Improvement |
| PARSERJAVA | Implement text extraction with comments for presentations | Improvement |
| PARSERJAVA | Implement table extraction from HTML documents | Improvement |
| PARSERJAVA | Implement page count and text area extraction for HTML documents | Improvement |
| PARSERJAVA | Implement file type detection by file extension | Improvement |
| PARSERJAVA | Implement detection of the target platform at runtime | Improvement |
| PARSERJAVA | Mark constructors of some data classes deprecated | Improvement |
| PARSERJAVA | Update the bundled Aspose components | Improvement |
| PARSERJAVA | Sign release JARs with GPG detached signatures | Improvement |
| PARSERJAVA | Ship third-party license notices and module metadata in the JAR | Improvement |
| PARSERJAVA | A metered license cannot be applied: “Signature encoding error” | Fix |
| PARSERJAVA | Excessive memory usage when parsing image-heavy PDF documents | Fix |
| PARSERJAVA | getFileInfo reports no file type and zero size for encrypted documents | Fix |
| PARSERJAVA | The page index is ignored when extracting images from HTML documents | Fix |
| PARSERJAVA | Harden XML parsing against external entity resolution | Fix |
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
AnnotationItemadded to thecom.groupdocs.parser.datapackage, with the propertiesvalue,annotationType("Comment"by default),timestamp(java.util.Date),authorNameandauthorInitials. - Methods
getAnnotations()andgetAnnotations(int pageIndex)added to theParserclass. - Method
isAnnotations()added to theFeaturesclass. - Property
includeAnnotationsadded to theTextOptionsclass.
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
| Component | 26.5 | 26.9 |
|---|---|---|
| Aspose.Cells | 23.6 | 26.3 |
| Aspose.Email | 24.9 | 26.1 |
| Aspose.Imaging | 21.2 | 25.12 |
| Aspose.PDF | 23.4 | 26.2 |
| Aspose.Slides | 23.3 | 26.2 |
| Aspose.Words | 23.6 | 26.3 |
| Aspose.BarCode | 24.6 | 26.4 |
| Aspose.ZIP | 24.8 | 25.10 |
| Aspose.Note | 23.3 | 23.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 declaresAutomatic-Module-Name: com.groupdocs.parserfor use on the module path.