Created
June 13, 2019 06:13
-
-
Save kenmlee/ec1ba85bf4aca264deaccff1787e25b8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public static void main(String[] args) throws Exception | |
{ | |
HWPFDocument doc = new HWPFDocument(new FileInputStream( | |
"data/document.doc")); | |
List<Picture> pics = doc.getPicturesTable().getAllPictures(); | |
for (int i = 0; i < pics.size(); i++) | |
{ | |
Picture pic = (Picture) pics.get(i); | |
FileOutputStream outputStream = new FileOutputStream( | |
"data/apacheImages/" + "Apache_" | |
+ pic.suggestFullFileName()); | |
outputStream.write(pic.getContent()); | |
outputStream.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment