今天發現上線的文檔轉換功能中存在一個文檔轉換不成功,查看後臺日誌標誌文檔沒法加載成功,提示日誌以下:html
INFO: connected Jul 08, 2015 2:50:33 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect INFO: connected com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: conversion failed: could not load input document at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.loadAndExport(OpenOfficeDocumentConverter.java:134) at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:120) at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:104) at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:74) at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:70) at cn.com.pujiConvert.convert.ConvertDocumentToPdf.convertingToPdf(ConvertDocumentToPdf.java:122) at cn.com.pujiConvert.convert.ConvertDocumentToPdf.getConvertPdfResult(ConvertDocumentToPdf.java:200) at cn.com.pujiConvert.timer.ConvertTimerTask.convertDocumentToPdfTask(ConvertTimerTask.java:16) at cn.com.pujiConvert.timer.ConvertTimerTask.run(ConvertTimerTask.java:49) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) Jul 08, 2015 2:50:33 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing INFO: disconnected
因而改成流轉換方式java
DocumentConverter converter = new StreamOpenOfficeDocumentConverter(connection); converter.convert(documentFile, pdfFile);
調用運行後,生成相應pdf文件,可是再由pdf文件生成的縮略圖倒是一片空白,swf文件實際上沒有生成成功。直接後臺下載pdf文檔到本機查看,提示pdf文檔損壞。因而認真查看了原始的doc文檔,原文中都是繁體字,進行繁簡轉換後,上傳從新轉換成功。由此推測應該是缺乏繁體字的字體,致使openoffice打開文件沒有響應,致使轉化失敗,這個須要進一步研究確認。oop