Our product is currently using POI-3.15.jar. As plutext internally uses POI library we are getting an exception due to the removal of a method(putShort) in latest version of POI.
We are using 3.2.0 version of docx4j and plutext.
below method is used for pdf insertion into document as OLE object.
com.plutext.ole.pdf.PdfOleHelperDocx pdfOleHelper = new com.plutext.ole.pdf.PdfOleHelperDocx(mlPackageWriteOnly2);
pdfOleHelper.embedUsingImage(bytes, -1, imageBytes);
Logs:
Caused by: java.lang.NoSuchMethodError: org.apache.poi.util.LittleEndian.putShort([BS)V
at com.plutext.ole.stream.ObjInfo.getOutputStream(ObjInfo.java:136)
at com.plutext.ole.OleObjectBinaryPartHelper.objInfoRepresentAsIcon(OleObjectBinaryPartHelper.java:300)
at com.plutext.ole.pdf.PdfUtils.addPDF(PdfUtils.java:34)
at com.plutext.ole.pdf.PdfOleHelperDocx.ole(PdfOleHelperDocx.java:191)
at com.plutext.ole.pdf.PdfOleHelperDocx.embedUsingImage(PdfOleHelperDocx.java:133)
at com.plutext.ole.pdf.PdfOleHelperDocx.embedUsingImage(PdfOleHelperDocx.java:104)
Below method is removed from POI-3.15
public static void putShort( byte[] data, short value )
{
putShort( data, 0, value );
}
From docx4j 3.3.0 version, looks like the dependency on POI library is removed. Is this right?
What would you suggest to fix the above ole embedding issue. Please let us know.