OpenPDF/PDFBox自动生成目录表

发布于 2025-01-27 17:29:51 字数 172 浏览 3 评论 0原文

在我当前的Java/Springboot项目中,我需要创建一个包含段落,图像和表格的PDF Dynamicaly。 我还需要添加本文档的内容表。

我想知道是否有一种使用OpenPDF或PDFBox自动生成此目录的方法。

我注意到可以使用Itext这样做,但这不是免费的……

谢谢您的帮助。

In my current java/springboot project, I need to create a PDF dynamicaly containing paragraphs, images and tables.
And I also need to add the table of content of this document.

I'm wondering if there is a way to automatically generate this table of contents using either openPdf or pdfBox.

I noticed that it is possible to do so using IText, but it is not free...

Thanks in advance for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凤舞天涯 2025-02-03 17:29:51

实际上,OpenPDF和PDFBox都没有提供一种自动生成目录表的方法:-(

下无法使用...

Itext为我们提供了这样的功能,但是它在AGPL许可下,因此在我的情况 需要使用Apache POI,然后使用OpenSagres/XdocReport将生成的DOCX转换为PDF(请参阅:

Actually neither openPdf nor pdfBox provide a way to automatically generate table of contents :-(

iText provide us with such functionality, but it is under AGPL licence so cannot be used in my case...

For the time being, I will try acheive my needs using apache POI then convert the generated docx to pdf using opensagres/xdocreport (see: Trying to make simple PDF document with Apache poi)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文