I am using apsose pdf to merge a pdf and add bookmarks to it , but the bookmark names are coming correctly when viewed in chrome browser but is not working well with microsoft edge
Edge
image.png (1.4 KB)
Chrome
image.png (82.6 KB)
Logic is this
private static void addBookmark(Document mergedDoc, String inputFile, int pageIndex) {
OutlineItemCollection bookmark = new OutlineItemCollection(mergedDoc.getOutlines());
bookmark.setTitle(StringUtils.substringBeforeLast(Paths.get(inputFile).getFileName().toString(), "."));
bookmark.setBold(true);
bookmark.setItalic(false);
bookmark.setAction(new GoToAction(mergedDoc.getPages().get_Item(pageIndex)));
mergedDoc.getOutlines().add(bookmark);
}