org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type pa

org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13]
	at org.apache.poi.util.PackageHelper.open(PackageHelper.java:41)
	at org.apache.poi.xwpf.usermodel.XWPFDocument.(XWPFDocument.java:121)
	at word.WordToPDFConverter.main(WordToPDFConverter.java:31)
Caused by: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13]
	at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:199)
	at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:665)
	at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:274)
	at org.apache.poi.util.PackageHelper.open(PackageHelper.java:39)
	... 2 more

org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13]

org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type pa_第1张图片

==

word格式错误,XWPFDocument 对应的是 .docx

org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type pa_第2张图片

org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type pa_第3张图片

 

org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type pa_第4张图片

org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type pa_第5张图片

 

结果是出来的,但是好像word里面【图片】、【汉字】没了

org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type pa_第6张图片

 

你可能感兴趣的:(java,word,PDF)