try(OutputStreamstream=newFileOutputStream(Constants.OutputPng)){// Constants.InputPng is an absolute or relative path to your document. Ex: @"C:\Docs\test.png"try(Metadatametadata=newMetadata(Constants.InputPng)){// Edit or remove metadata heremetadata.save(stream);}}
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples: