Hi Nico,
I once created the PDF Parser widget. This widget contains operations to edit the metadata in PDF documents. I think you can use the code from Github and alter it to your needs. This would only work for the PDFs of course, you need other operations to do the same thing fod DOC and DOCX documents. Hope this helps.
I managed to remove the EXIF data from images using the following JAVA code:
public java.lang.Void executeAction() throws Exception
{
this.imageToStrip = this.__imageToStrip == null ? null : system.proxies.Image.initialize(getContext(), __imageToStrip);
// BEGIN USER CODE
BufferedImage img = ImageIO.read(Core.getImage(getContext(), __imageToStrip, false));
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(img, getFileExtension(imageToStrip), os);
Core.storeImageDocumentContent(getContext(), __imageToStrip, new ByteArrayInputStream(os.toByteArray()), 0, 0);
return null;
// END USER CODE
}
Where,
private static String getFileExtension(FileDocument file) throws Exception {
String fileName = file.getName().toLowerCase();
try {
if(fileName.contains(".")) {
java.lang.String extention = fileName.substring(fileName.lastIndexOf('.')+1);
return extention;
}
}
catch(Exception e) {
}
throw new Exception("");
}