word源文件有书签,但是转成pdf之后就不带书签了,之前尝试过以下代码(aspose技术人员提供的):
Document document = new Document(); DocumentBuilder builder = new DocumentBuilder(document); builder.insertBreak(BreakType.PAGE_BREAK); builder.startBookmark(“MyBookmark”); builder.writeln(“Text inside a bookmark.”); builder.endBookmark(“MyBookmark”); PdfSaveOptions options = new PdfSaveOptions(); options.getOutlineOptions().setDefaultBookmarksOutlineLevel(1); document.save(“E:\Temp\awjava-19.7.pdf”, options);
但是发现没有这个方法:options.getOutline微信图片_20190823134716.png (3.3 KB)
Options().setDefaultBookmarksOutlineLevel(1)
请查看附件