* @param bookmark the bookmark that has the data for the line
* @return a subsection of section
*/
private static Section createBookmark(String pdf, Section section, HashMap<String, Object> bookmark) {
Section s;
Paragraph title = new Paragraph((String)bookmark.get("Title"));
System.out.println((String)bookmark.get("Title"));
String action = (String)bookmark.get("Action");
if ("GoTo".equals(action)) {
if (bookmark.get("Page") != null) {
String page = (String)bookmark.get("Page");
StringTokenizer tokens = new StringTokenizer(page);
String token = tokens.nextToken();
Anchor anchor = new Anchor(" page" + token);
anchor.setReference(pdf + "#page=" + token);
title.add(anchor);
}
}
else if ("URI".equals(action)) {
String url = (String)bookmark.get("URI");
Anchor anchor = new Anchor(" Goto URL");
anchor.setReference(url);
title.add(anchor);
}
else if ("GoToR".equals(action)) {
String remote = (String)bookmark.get("File");
Anchor anchor = new Anchor(" goto " + remote);
if (bookmark.get("Named") != null) {
String named = (String)bookmark.get("Named");
remote = remote + "#nameddest=" + named;
}
else if (bookmark.get("Page") != null) {
String page = (String)bookmark.get("Page");
StringTokenizer tokens = new StringTokenizer(page);
String token = tokens.nextToken();
anchor.add(new Chunk(" page " + token));
remote = remote + "#page=" + token;
}
anchor.setReference(remote);
title.add(anchor);
}
if (section == null) {
s = new Chapter(title, 0);
}
else {