From: Vincent Vanwaelscappel Date: Tue, 29 Mar 2022 18:44:09 +0000 (+0200) Subject: wip #5195 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ee54bf808f524e4b5d0cc1ff6df10ccc6f8f5eb5;p=cubist_pdf.git wip #5195 @0.5 --- diff --git a/.idea/misc.xml b/.idea/misc.xml index b658e95..b44ac24 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar b/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar index 256d77f..4cf3dee 100644 Binary files a/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar and b/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar differ diff --git a/resources/tools/fwstk/src/com/fluidbook/fwstk/Main.java b/resources/tools/fwstk/src/com/fluidbook/fwstk/Main.java index 32ca9ce..3909385 100644 --- a/resources/tools/fwstk/src/com/fluidbook/fwstk/Main.java +++ b/resources/tools/fwstk/src/com/fluidbook/fwstk/Main.java @@ -403,12 +403,17 @@ public class Main { PDOutlineNode bookmark, int level) throws IOException { PDOutlineItem current = bookmark.getFirstChild(); while (current != null) { - res.add("BookmarkTitle:\t\t" + StringEscapeUtils.escapeHtml4(current.getTitle())); - res.add("BookmarkLevel:\t\t" + level); - res.add("BookmarkPage:\t\t" - + getPageFromAction(doc, current.getAction())); - addBookmark(doc, res, current, level + 1); + try { + res.add("BookmarkTitle:\t\t" + StringEscapeUtils.escapeHtml4(current.getTitle())); + res.add("BookmarkLevel:\t\t" + level); + res.add("BookmarkPage:\t\t" + + getPageFromAction(doc, current.getAction())); + addBookmark(doc, res, current, level + 1); + }catch (Exception e){ + + } current = current.getNextSibling(); + } } @@ -688,6 +693,15 @@ public class Main { out.close(); } + public static String getPageFromRemoteGoToAction(PDDocument doc, PDAction a) throws IOException{ + PDActionGoTo aa = (PDActionGoTo) a; + if (null == a) { + return "-1"; + } + PDDestination d = aa.getDestination(); + return getPageFromDestination(doc, d); + } + public static String getPageFromAction(PDDocument doc, PDAction a) throws IOException { PDActionGoTo aa = (PDActionGoTo) a; if (null == a) {