I want to convert DOCX file that contains EMF pictures inside to PDF file. Apache POI detects EMF picture type, however it uses com.lowagie.text.Image class while converting to PDF. Unfortunately it doesn't support EMF format.
Do you have any idea how I can replace EMF pictures to JPG/GIF/BMP formats that are fully supported?
org.apache.poi.xwpf.converter.pdf version: 1.0.5
FileInputStream fis = new FileInputStream("file.docx");
XWPFDocument document = new XWPFDocument(OPCPackage.open(fis));
File outFile = new File("file.pdf");
OutputStream out = new FileOutputStream(outFile);
PdfOptions options = PdfOptions.create().fontEncoding("windows-1250");
PdfConverter.getInstance().convert(document, out, options);
The code above give an error:
Dec 21, 2015 10:26:56 AM org.apache.poi.xwpf.converter.pdf.internal.PdfMapper visitPicture SEVERE: The byte array is not a recognized imageformat.