Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set document properties #140

Closed
ekimbernow opened this issue Apr 7, 2024 · 1 comment
Closed

Set document properties #140

ekimbernow opened this issue Apr 7, 2024 · 1 comment
Assignees

Comments

@ekimbernow
Copy link
Collaborator

Enable ability to set the properties of the document.

These are stored in the docProps/core.xml, docProps/app.xml, and docProps/custom.xml files.

The properties can be accessed like so:

 XWPFDocument doc = new XWPFDocument();
 POIXMLProperties props = doc.getProperties();
@ekimbernow ekimbernow self-assigned this Apr 7, 2024
@ekimbernow
Copy link
Collaborator Author

This seems to work and there do appear to be set methods for all the properties:

    POIXMLProperties props = doc.getProperties();    
    Optional<java.util.Date> date = Optional.of(new Date());
    props.getCoreProperties().setCreated(date);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant