opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.19k stars 368 forks source link

there is a error when use fr.opensagres.poi.xwpf.converter.pdf-gae convert word to pdf #643

Open cntigers opened 2 months ago

cntigers commented 2 months ago

there is a error when use fr.opensagres.poi.xwpf.converter.pdf-gae convert word to pdf; the program code is :

try (ByteArrayOutputStream out = new ByteArrayOutputStream();
             ByteArrayInputStream in = new ByteArrayInputStream(FileUtil.readBytes(new File("C:1.docx")))){
            XWPFDocument xwpfDocument = new XWPFDocument(in);
            PdfOptions pdfOptions = PdfOptions.create();
            PdfConverter.getInstance().convert(xwpfDocument,out,pdfOptions);
            FileUtil.writeBytes(out.toByteArray(),"c://1/pdf");
        }catch (Exception e){
            e.printStackTrace();
        }

the error is: image

natimercy commented 1 month ago

17149817303546 Encountering the same problem,遇到同样的问题。

cntigers commented 1 month ago

17149817303546 Encountering the same problem,遇到同样的问题。

我暂时的解决方案是:重写PngImage类然后注释该类中读取iccp部分的代码: image