亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

documents4j 轉換為 pdf 沒有 Microsoft word 就不能工作?

documents4j 轉換為 pdf 沒有 Microsoft word 就不能工作?

慕沐林林 2023-04-26 15:01:41
我想用 documents4j 將 docx 文件轉換為 pdf,但我不想使用 MS word有沒有其他解決方案?我使用 Apache poi 但它在波斯語中無法正常工作public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {    ByteArrayOutputStream bo = new ByteArrayOutputStream();    InputStream in = new BufferedInputStream(new FileInputStream("d:\\c.docx"));    IConverter converter = LocalConverter.builder()            .baseFolder(new File("D:\\a"))            .workerPool(20, 25, 2, TimeUnit.SECONDS)            .processTimeout(5, TimeUnit.SECONDS)            .build();    Future<Boolean> conversion = converter            .convert(in).as(DocumentType.MS_WORD)            .to(bo).as(DocumentType.PDF)            .prioritizeWith(1000) // optional            .schedule();    conversion.get();    try (OutputStream outputStream = new FileOutputStream("D:\\c.pdf")) {        bo.writeTo(outputStream);    } catch (IOException e) {        e.printStackTrace();    }    in.close();    bo.close();}}
查看完整描述

1 回答

?
千萬里不及你

TA貢獻1784條經驗 獲得超9個贊

documents4j 是一個通過橋梁將文檔轉換為 MS Word 的工具。不幸的是,如果您沒有運行實例,這將不起作用。



查看完整回答
反對 回復 2023-04-26
  • 1 回答
  • 0 關注
  • 584 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號