Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This page contains release notes for GroupDocs.Metadata for Java 1819.121.

Major Features

There are the following features and enhancements in this release:

  • Add support for the Matroska multimedia container
  • Add support for password-protected OneNote documents
  • Reduce memory consumption of supported Word Visio formats
  • Reduce memory consumption of supported PowerPoint formatsAbility to update metadata keys in Doc/Docx file formatOneNote formats
  • Reduce memory consumption of supported CAD formats
  • Reduce memory consumption of supported Email formats
  • Reduce memory consumption of the MOV format
  • Remove the obsolete code related to the TIFF/EXIF functionality
  • Remove obsolete members of the Mp3Format DublinCorePackage class
  • Remove the MppFormat.GetProperties method (obsolete code)

All Changes

2489 Word 2424 PowerPoint 1436Ability to update metadata keys in Doc/Docx file format1519Remove obsolete members of the Mp3Format class2463 MppFormat.GetProperties method ()

Key

Summary

Category

METADATANET-2462519Add support for the Matroska multimedia containerNew Feature
METADATANET-2556Add support for password-protected OneNote documentsNew Feature
METADATANET-2513Reduce memory consumption of supported Visio formatsEnhancement
METADATANET-2517Reduce memory consumption of supported OneNote formatsEnhancement
METADATANET-2538Reduce memory consumption of supported CAD formatsEnhancement
METADATANET-2539Reduce memory consumption of supported Email formatsEnhancement
METADATANET-2544Reduce memory consumption of the MOV formatEnhancement
METADATANET-1565Remove the obsolete code related to the TIFF/EXIF functionalityEnhancement
METADATANET-1577Remove obsolete members of the DublinCorePackage classEnhancement

Public API and Backward Incompatible Changes

Info

This section lists public API changes that were introduced in GroupDocs.Metadata for Java 1819.121. It includes not only new and obsoleted public methods, but also a description of any changes in the behavior behind the scenes in GroupDocs.Metadata which may affect existing code. Any behavior introduced that could be seen as a regression and modifies existing behavior is especially important and is documented here.

...

Add support for the Matroska multimedia container

Panel
title
Description

This new feature allows a user to work with password-protected documents of some popular formatsmultimedia files encoded with the Matroska container.

Public API changes

The LoadOptionsMatroskaFormat class has been added to the com.groupdocs.metadata package

The DocFormat(String, LoadOptions) constructor MatroskaSegmentInfoMetadata class has been added to the DocFormat classThe DocFormat(InputStream, LoadOptions) constructor com.groupdocs.metadata package

The MatroskaSimpleTagMetadata class has been added to the com.groupdocs.metadata package

The MatroskaTagMetadata class has been added to the DocFormat classThe PptFormat(String, LoadOptions) constructor com.groupdocs.metadata package

The MatroskaTargetTypeValue class has been added to the PptFormat classThe PptFormat(InputStream, LoadOptions) constructor com.groupdocs.metadata package

The MatroskaTrackMetadata class has been added to the PptFormat classThe XlsFormat(String, LoadOptions) constructor com.groupdocs.metadata package

The MatroskaTrackType class has been added to the com.groupdocs.metadata package

The MatroskaVideoDisplayUnit class has been added to the XlsFormat classThe XlsFormat(InputStream, LoadOptions) constructor com.groupdocs.metadata package

The MatroskaVideoFieldOrder class has been added to the XlsFormat classThe PdfFormatcom.groupdocs.metadata package

The MatroskaVideoFlagInterlaced class has been added to the com.groupdocs.metadata package

The MatroskaVideoStereoMode class has been added to the com.groupdocs.metadata package

The MatroskaVideoTrackMetadata class has been added to the com.groupdocs.metadata package

Usecases

Read MKV video metadata.

Code Block
titleJava
languagejava
try (MatroskaFormat format = new MatroskaFormat("D:\\input.mkv"))
{
    System.out.println(format.getEbmlHeader().getDocType());
    System.out.println(format.getEbmlHeader().getDocTypeReadVersion());
    System.out.println(format.getEbmlHeader().getDocTypeVersion());
    System.out.println(format.getEbmlHeader().getReadVersion());
    System.out.println(format.getEbmlHeader().getVersion());
    for (MatroskaSegmentInfoMetadata segment : format.getSegments())
    {
        System.out.println(segment.getDateUtc());
        System.out.println(segment.getDuration());
        System.out.println(segment.getMuxingApp());
        System.out.println(segment.getSegmentFilename());
        System.out.println(segment.getSegmentUid());
        System.out.println(segment.getTimecodeScale());
        System.out.println(segment.getTitle());
        System.out.println(segment.getWritingApp());
    }
    for (MatroskaTagMetadata tag : format.getTags())
    {
        System.out.println(tag.getTargetType());
        System.out.println(tag.getTargetTypeValue());
        System.out.println(tag.getTagTrackUid());
        for (String key : tag.getSimpleTags().getKeys())
        {
            System.out.println(tag.getSimpleTags().readByStringKey(key).getFormattedValue());
        }
    }
    for (MatroskaTrackMetadata track : format.getTracks())
    {
        System.out.println(track.getCodecId());
        System.out.println(track.getCodecName());
        System.out.println(track.getDefaultDuration());
        System.out.println(track.getFlagEnabled());
        System.out.println(track.getLanguage());
        System.out.println(track.getLanguageIetf());
        System.out.println(track.getName());
        System.out.println(track.getTrackNumber());
        System.out.println(track.getTrackType());
        System.out.println(track.getTrackUid());
         
        if (track instanceof MatroskaAudioTrackMetadata)
        {
            MatroskaAudioTrackMetadata audioTrack = (MatroskaAudioTrackMetadata)track;
            System.out.println(audioTrack.getSamplingFrequency());
            System.out.println(audioTrack.getOutputSamplingFrequency());
            System.out.println(audioTrack.getChannels());
            System.out.println(audioTrack.getBitDepth());
        }
         
        if (track instanceof MatroskaVideoTrackMetadata)
        {
            MatroskaVideoTrackMetadata videoTrack = (MatroskaVideoTrackMetadata)track;
            System.out.println(videoTrack.getFlagInterlaced());
            System.out.println(videoTrack.getFieldOrder());
            System.out.println(videoTrack.getStereoMode());
            System.out.println(videoTrack.getAlphaMode());
            System.out.println(videoTrack.getPixelWidth());
            System.out.println(videoTrack.getPixelHeight());
            System.out.println(videoTrack.getPixelCropBottom());
            System.out.println(videoTrack.getPixelCropTop());
            System.out.println(videoTrack.getPixelCropLeft());
            System.out.println(videoTrack.getPixelCropRight());
            System.out.println(videoTrack.getDisplayWidth());
            System.out.println(videoTrack.getDisplayHeight());
            System.out.println(videoTrack.getDisplayUnit());
        }
    }
}  

Add support for password-protected OneNote documents

Panel
title
Description

This new feature allows a user to work with password-protected OneNote documents.

Public API changes

The OneNoteFormat(String, LoadOptions) constructor has been added to the PdfFormat OneNoteFormat class

The PdfFormatOneNoteFormat(InputStream, LoadOptions) constructor has been added to the PdfFormat OneNoteFormat class

Usecases

Load a password-protected PDF documentprotected OneNote document.

Code Block
titleJava
languagejava
LoadOptions loadOptions = new LoadOptions("password");
try (PdfFormatOneNoteFormat format = new PdfFormatOneNoteFormat("D:\\protected\\input.pdfone", loadOptions))
{
    // Working with the password-protected document
    format.cleanMetadata();
    format.save}

Check if a document is password-protected.

Code Block
titleJava
languagejava
if (MetadataUtility.isProtected("D:\\protected\\outputinput.pdfone");
}
Load a
)
{
    // Working with the password-protected
Excel document.
 document
}

Reduced memory consumption of supported Visio formats

Panel
title
Description

This enhancement allows working with Visio documents with less memory consumption.

Public API changes

None.

Usecases

Please note that the VisioFormat class implements the Closeable interface and it's necessary to call the close() method when you're done working with its instance.

Code Block
titleJava
languagejava
LoadOptionstry loadOptions(VisioFormat format = new LoadOptionsVisioFormat("passwordd:\\input.vsdx");
)
{
    // Working with metadata
}

If you are loading a Visio document from a stream, it's up to you to close the stream when the file is not needed anymore.

Code Block
titleJava
languagejava
try (XlsFormatInputStream formatstream = new XlsFormatFileInputStream("Dd:\\protected\\input.xlsxvsdx", loadOptions))
{
    try (VisioFormat format = new VisioFormat(stream))
    {
        // Working with themetadata
password-protected document   }
 format.cleanMetadata();   //  format.save("D:\\protected\\output.xlsx");
}
Load a password-protected PowerPoint document
The stream is still open here
}

The same rule works if you are saving the output file into a stream.

Code Block
titleJava
languagejava
LoadOptionstry loadOptions(OutputStream stream = new LoadOptionsFileOutputStream("passwordd:\\output.vsdx");
)
{
    try (PptFormatVisioFormat format = new PptFormatVisioFormat("Dd:\\protected\\input.pptxvsdx", loadOptions))
    {
        // Working with themetadata
password-protected document
        format.cleanMetadatasave(stream);
    format.save("D:\\protected\\output.pptx");
}
Load a password-protected Word document
}
    // The stream is still open here
}

Reduced memory consumption of supported OneNote formats

Panel
title
Description

This enhancement allows working with OneNote documents with less memory consumption.

Public API changes

None.

Usecases

Please note that the OneNoteFormat class implements the Closeable interface and it's necessary to call the close() method when you're done working with its instance.

Code Block
titleJava
languagejava
try (OneNoteFormat format = new OneNoteFormat("d:\\input.one"))
{
    // Working with metadata
}

If you are loading a OneNote document from a stream, it's up to you to close the stream when the file is not needed anymore.

Code Block
titleJava
languagejava
LoadOptionstry loadOptions(InputStream stream = new LoadOptionsFileInputStream("passwordd:\\input.one");
)
{
    try (DocFormatOneNoteFormat format = new DocFormat("D:\\protected\\input.doc", loadOptionsOneNoteFormat(stream))
    {
        // Working with themetadata
password-protected document   }
 format.cleanMetadata();   //  format.save("D:\\protected\\output.doc");
}
Check if a document is password-protected
The stream is still open here
}

The same rule works if you are saving the output file into a stream.

Code Block
titleJava
languagejava
iftry (MetadataUtility.isProtectedOutputStream stream = new FileOutputStream("Dd:\\protectedoutput.one"))
{
    try (OneNoteFormat format = new OneNoteFormat("d:\\input.docone"))
    {
        // Working with themetadata
password-protected document
}
        format.save(stream);
    }
    // The stream is still open here
}

Reduced memory consumption of

...

supported CAD formats

Panel
title
Description

This enhancement allows working with Word documents supported CAD formats with less memory consumption.

Public API changes

None.

Usecases

Please note that the DocFormat class implements the DwgFormat and DxfFormat classes implement the Closeable interface and it's necessary to call the close() method when you're done working with its the instance.

Code Block
titleJava
languagejava
try (DocFormatDwgFormat format = new DocFormatDwgFormat("d:\\input.docxdwg"))
{
    // Working with metadata
}

If you are loading a Word document CAD drawing from a stream, it's up to you to close the stream when the file is not needed anymore.

Code Block
titleJava
languagejava
try (InputStream stream = new FileInputStream("d:\\input.docdxf"))
{
    try (DocFormatDxfFormat format = new DocFormatDxfFormat(stream))
    {
        // Working with metadata
    }
    // The stream is still open here
}

The same rule works if you are saving the output file into a stream.

Code Block
titleJava
languagejava
try (OutputStream stream = new FileOutputStream("d:\\output.docxdwg"))
{
    try (DocFormatDwgFormat format = new DocFormatDwgFormat("d:\\input.docxdwg"))
    {
        // Working with metadata
 
        format.save(stream);
    }
    // The stream is still open here
}

Reduced memory consumption of

...

supported Email formats

Panel
title
Description

This enhancement allows working with PowerPoint documents saved email messages with less memory consumption.

Public API changes

None.

Usecases

Please note that the PptFormat class implements the EmlFormat and OutlookMessage classes implement the Closeable interface and it's necessary to call the close() method when you're done working with its the instance.

Code Block
titleJava
languagejava
try (PptFormatOutlookMessage format = new PptFormatOutlookMessage("d:\\input.pptmsg"))
{
    // Working with metadata
}

If you are loading a Word document an email message from a stream, it's up to you to close the stream when the file is not needed anymore.

Code Block
titleJava
languagejava
try (InputStream stream = new FileInputStream("d:\\input.pptxeml"))
{
    try (PptFormatEmlFormat format = new PptFormatEmlFormat(stream))
    {
        // Working with metadata
    }
    // The stream is still open here
}

The same rule works if you are saving the output file into a stream.

Code Block
titleJava
languagejava
try (OutputStream stream = new FileOutputStream("d:\\output.pptmsg"))
{
    try (PptFormatOutlookMessage format = new PptFormatOutlookMessage("d:\\input.pptmsg"))
    {
        // Working with metadata
 
        format.save(stream);
    }
    // The stream is still open here
}

...

Reduced memory consumption of supported MOV formats

Panel
title
Description

This enhancement allows updating Words and Version properties of Doc/Docx file formatsworking with MOV videos with less memory consumption.

Public API changes

None.

Usecases

Update the Words and Version metadata keys in doc/docx documentsThe QuickTimeAtom.getData method has been marked as deprecated

The getDataOffset method has been added to the QuickTimeAtom class

The getDataSize method has been added to the QuickTimeAtom class

Usecases

Please note that the MovFormat class implements the Closeable interface and it's necessary to call the close() method when you're done working with its instance.

Code Block
titleJava
languagejava
try (DocFormatMovFormat docFormatformat = new DocFormatMovFormat("Dd:\\input.docxmov"))
{
    docFormat.getDocumentProperties().setValueByKey("Words", new PropertyValue(1));
    docFormat.getDocumentProperties().setValueByKey("Version", new PropertyValue(851968));
 
    docFormat.save("D:\\output.docx");
}

...

// Working with metadata
}

If you are loading a MOV video from a stream, it's up to you to close the stream when the file is not needed anymore.

Code Block
titleJava
languagejava
try (InputStream stream = new FileInputStream("d:\\input.mov"))
{
    try (MovFormat format = new MovFormat(stream))
    {
        // Working with metadata
    }
    // The stream is still open here
}

The same rule works if you are saving the output file into a stream.

Code Block
titleJava
languagejava
try (OutputStream stream = new FileOutputStream("d:\\output.mov"))
{
    try (MovFormat format = new MovFormat("d:\\input.mov"))
    {
        // Working with metadata
        format.save(stream);
    }
    // The stream is still open here
}

Remove the obsolete code related to the TIFF/EXIF functionality

Panel
title
Description

This enhancement removes some obsolete members of the Mp3Format classclasses, enumsandmembers connected with the TIFF/EXIF functionality.

Public API changes

The getId3v1ExifProperty class has been removed from the com.groupdocs.metadata package

The ExifPropertyType class has been removed from the com.groupdocs.metadata package

The getValue method has been removed from the Mp3Format class.The getId3v2 method TiffAsciiTag class

The getValue method  has been removed from the TiffByteTag class

The getValue method has been removed from the TiffLongTag class

The getValue method has been removed from the TiffRationalTag class

The getValue method has been removed from the TiffSByteTag class

The getValue method has been removed from the TiffSLongTag class

The getValue method has been removed from the TiffSRationalTag class

The getValue method has been removed from the TiffSShortTag class

The getValue method has been removed from the TiffShortTag class

The TiffLongTag(int,int) constructor has been removed from the TiffLongTag class

The TiffRationalTag(int,Rational) constructor has been removed from the TiffRationalTag class

The TiffSByteTag(int,int) constructor has been removed from the TiffSByteTag class

The TiffSLongTag(int,int) constructor has been removed from the Mp3FormatTiffSLongTag class.

Usecases

Please use the getId3v1Tag and getId3v2Tag methods instead

The TiffSRationalTag(int,SRational) constructor has been removed from the TiffSRationalTag class

The TiffSShortTag(int,short) constructor has been removed from the TiffSShortTag class

The TiffShortTag(int,short) constructor has been removed from the TiffShortTag class

The CompareExif(String,String,int) method has been removed from the ComparisonFacade class

The CompareExif(InputStream,InputStream,int) method has been removed from the ComparisonFacade class

The ScanExif(String,String,int) method has been removed from the SearchFacade class

The ScanExif(String,String) method has been removed from the SearchFacade class

The ScanExif(InputStream,String,int) method has been removed from the SearchFacade class

The ScanExif(InputStream,String) method has been removed from the SearchFacade class

The ScanExif(String,Pattern) method has been removed from the SearchFacade class

The ScanExif(InputStream,Pattern) method has been removed from the SearchFacade class

Usecases

Compare EXIF properties of two different documents.

Code Block
titleJava
languagejava
try (Mp3Format format = new Mp3FormatTiffTag[] result = ComparisonFacade.compareExifTags("D:\\input1.jpg", "D:\\input2.jpg", ComparerSearchType.Intersection);

Search for EXIF tags using the SearchFacade class.

Code Block
titleJava
languagejava
TiffTag[] result = SearchFacade.scanExifTags("D:\\input.mp3jpg", "james"))
{
    Id3v1Tag id3v1 = format.getId3v1Tag();
    System.out.println(id3v1.getAlbum());
    System.out.println(id3v1.getArtist());
 
    Id3v2Tag id3v2 = format.getId3v2Tag();
    ; 

Work with EXIF tags using alternative properties and constructors.

Code Block
titleJava
languagejava
TiffLongTag width = new TiffLongTag(TiffTagIdEnum.ImageWidth, new Long[] { 123L });
TiffLongTag length = new TiffLongTag(TiffTagIdEnum.ImageLength, new Long[] { 123L });
try (JpegFormat format = new JpegFormat("D:\\input.jpg"))
{
    format.getExifValues().setTags(new TiffTag[] { width, length});
    format.save("D:\\output.jpg");
}
System.out.println(id3v2width.getAlbumgetTagValue()[0]);
    System.out.println(id3v2length.getArtistgetTagValue()[0]);
} 

...

Remove obsolete members of the DublinCorePackage class

Panel
title
Description

This enhancement removes some obsolete members of members of the MppFormatDublinCorePackage class.

Public API changes

The getProjectProperties method The getSubject method has been removed from the DublinCorePackage class

The setSubject(String[]) method has been removed from the MppFormatDublinCorePackage class.

Usecases

Please use the MppFormat.getProjectInfo method Subjects property instead.

Code Block
titleJava
languagejava
try (MppFormatJpegFormat format = new MppFormatJpegFormat("D:\\input.mppjpg"))
{
    System.out.println(format.getProjectInfo().getAuthor());DublinCorePackage dublinCore = format.getXmpValues().getSchemes().getDublinCore();
    for (String subject : dublinCore.getSubjects())
    {
        System.out.println(subject);
    }
}
Code Block
titleJava
languagejava
try (JpegFormat format.getProjectInfo = new JpegFormat("D:\\input.jpg"))
{
    DublinCorePackage dublinCore = format.getXmpValues().getLastAuthorgetSchemes().getDublinCore();
    SystemdublinCore.out.println(format.getProjectInfo().getCompany());
} setSubjects(new String[] {"test subject"});
    format.save("D:\\output.jpg");
}