You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/09/22 20:39:06 UTC
[Bug 63761] New: Custom metadata properties of XLS and DOC files are
not deleted.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63761
Bug ID: 63761
Summary: Custom metadata properties of XLS and DOC files are
not deleted.
Product: POI
Version: 4.0.x-dev
Hardware: PC
Status: NEW
Severity: regression
Priority: P2
Component: HPSF
Assignee: dev@poi.apache.org
Reporter: drejcab@gmail.com
Target Milestone: ---
Created attachment 36791
--> https://bz.apache.org/bugzilla/attachment.cgi?id=36791&action=edit
Office 97 file with custom properties
For Office 97 files, it allows you to add custom properties but does not allow
you to delete all custom properties.
Attached code to remove all custom properties:
InputStream is = new FileInputStream(new File("C:\test\CustomProperties.doc"));
POIFSFileSystem poifs = new POIFSFileSystem(is);
is.close();
DirectoryEntry dir = poifs.getRoot();
HPSFPropertiesOnlyDocument dis = new HPSFPropertiesOnlyDocument(poifs);
DocumentSummaryInformation dsi = dis.getDocumentSummaryInformation();
//Remove all Custom Properties
dsi.setCustomProperties(new CustomProperties());
dsi.write(dir, DocumentSummaryInformation.DEFAULT_STREAM_NAME);
si.write(dir, SummaryInformation.DEFAULT_STREAM_NAME);
OutputStream out = new FileOutputStream("C:\test\CustomProperties_2.doc");
poifs.writeFilesystem(out);
out.close();
In version 3.15 it worked correctly.
I need this functionality before moving on to version 4.10
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 63761] Custom metadata properties of XLS and DOC files are not
deleted.
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63761
drejcab@gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEEDINFO |RESOLVED
--- Comment #2 from drejcab@gmail.com ---
(In reply to Andreas Beeker from comment #1)
> Does DocumentSummaryInformation.removeCustomProperties() work for your
> usecase?
ok, DocumentSummaryInformation.removeCustomProperties () works correctly.
Regards,
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 63761] Custom metadata properties of XLS and DOC files are not
deleted.
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63761
Andreas Beeker <ki...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
Status|NEW |NEEDINFO
--- Comment #1 from Andreas Beeker <ki...@apache.org> ---
Does DocumentSummaryInformation.removeCustomProperties() work for your usecase?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org