跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • Poi PPT PPTX 处理 [生产环境使用]
未分類
1 9 月 2020

Poi PPT PPTX 处理 [生产环境使用]

Poi PPT PPTX 处理 [生产环境使用]

資深大佬 : RedBeanIce 10

poi 在 PPT 转成图片的时候,PPT 会有很多复杂的东西,导致解析困难

如以下复杂结构:

1,文本框套文本框套文本框,嵌套文字

2,文本框嵌套图片

等等。。。。

求助各位大佬,如何解析复杂的结构,让我可以将一页 PPT 转成图片

大佬有話說 (11)

  • 資深大佬 : PopRain

    方向错了吧,你要去自己渲染 PPT? 这个难度太高了,换个方法吧

  • 資深大佬 : iseki

    自己渲染 PPT 意味着你要把 Office 的很大一部分内容自己做一遍(换个办法吧

  • 資深大佬 : PopRain

    stackoverflow 搜索 PPT to PNG conversion with Apache POI

    发链接要手机号验证。。。。

  • 主 資深大佬 : RedBeanIce

    @PopRain
    @iseki
    #1
    #2
    只是将 PPT 转成图片,只是在转的时候,poi 解析复杂结构,解不了。
    图片上不会显示,

  • 資深大佬 : PopRain

    那是不是需要用 Spire 之类的商业 SDK 了,可以用试用版先试试

  • 資深大佬 : 340244120w

    推荐 aspose 系列

  • 資深大佬 : 519718366

    http://poi.apache.org/slideshow/how-to-shapes.html#Render

    HSLF provides a way to export slides into images. You can capture slides into java.awt.Graphics2D object (or any other) and serialize it into a PNG or JPEG format. Please note, although HSLF attempts to render slides as close to PowerPoint as possible, the output may look differently from PowerPoint due to the following reasons:

    – Java2D renders fonts differently vs PowerPoint. There are always some differences in the way the font glyphs are painted
    – HSLF uses java.awt.font.LineBreakMeasurer to break text into lines. PowerPoint may do it in a different way.
    – If a font from the presentation is not available, then the JDK default font will be used.

    Current Limitations:
    – Some types of shapes are not yet supported (WordArt, complex auto-shapes)
    – Only Bitmap images (PNG, JPEG, DIB) can be rendered in Java

    或许是真的不能支持这些复杂的妖魔鬼怪 PPT 吧。

  • 資深大佬 : DsuineGP

    前几天还在调研 libreoffice 的 cli,一条命令就能转,还开源,强烈推荐。poi 不适合做 ppt 和 word 解析,因为渲染逻辑太复杂了。上说的 aspose 也还行。

  • 主 資深大佬 : RedBeanIce

    @PopRain
    我先去试试免费的,哭。

  • 主 資深大佬 : RedBeanIce

    @340244120w #6
    !!!我去试试,都可以试验!!
    @519718366 #7
    @DsuineGP #8
    收到,,看来我只能尝试多种方案了,,一样样试过去,看哪种能够解决我这个问题。自己写不现实了。

  • 主 資深大佬 : RedBeanIce

    @DsuineGP

    #8 尝试了一下 LibreOffice_6.4.6_Win_x64 命令行,Windows 下 会出现字是横着的,但是变成了竖着的。尴尬

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具