Apache poi: delete image in XWPFDocument

I am writing an application that takes a .docx file with a bunch of empty paragraphs and tables and populates them programmatically using Apache POI with data from a db.

The .docx model I was provided with also has a series of images: my problem is I want to delete the ones I don't need (again, programmatically). I see there is a way to add pictures to XWPFRun (addPicture ()), but not to remove them.

Can this be done? How to remove image from .docx file using POI?

Thanks in advance!

+1


source to share





All Articles