Last active
March 3, 2022 18:35
-
-
Save GroupDocsGists/9aa3d162544a32eeff377b6caa6fdf4a to your computer and use it in GitHub Desktop.
Clean All Metadata from Documents and Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Clean all the detected metadata properties from Word, Excel, | |
* PowerPoint, PDF, and other documents using C# | |
*/ | |
using (Metadata metadata = new Metadata("filePath/document.pdf")) | |
{ | |
var affected = metadata.Sanitize(); | |
metadata.Save("filePath/output.pdf"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Remove all the detected metadata properties from Word, Excel, | |
* PowerPoint, PDF, and other documents using Java | |
*/ | |
Metadata metadata = new Metadata("filePath/document.pdf"); | |
int affected = metadata.sanitize(); | |
metadata.save("filePath/output.pdf"); // Save the output document with no metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Clean or remove all the detected metadata properties from PNG, JPG/JPEG, | |
* WebP, BMP, GIF, TIFF and other images using C# | |
*/ | |
using (Metadata metadata = new Metadata("filePath/document.jpg")) | |
{ | |
var affected = metadata.Sanitize(); | |
metadata.Save("filePath/output.jpg"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Remove all the detected metadata properties from JPEG, PNG, | |
* WebP, BMP, GIF, TIFF and other images using Java | |
*/ | |
Metadata metadata = new Metadata("filePath/document.jpg"); | |
int affected = metadata.sanitize(); | |
metadata.save("filePath/output.jpg"); // Save the output image having no metadata |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment