Bookmark(Bookmark parent, PdfDestination destination, String title) { this.pdfOutline = new PdfOutline(parent.pdfOutline, destination, title, false); this.level = parent.level + 1; }
/** * Opens the document. * <P> * You have to open the document before you can begin to add content * to the body of the document. */ public void open() { if (!open) { super.open(); writer.open(); rootOutline = new PdfOutline(writer); currentOutline = rootOutline; } try { initPage(); } catch(DocumentException de) { throw new ExceptionConverter(de); } }
/** * Opens the document. * <P> * You have to open the document before you can begin to add content * to the body of the document. */ public void open() { if (!open) { super.open(); writer.open(); rootOutline = new PdfOutline(writer); currentOutline = rootOutline; } try { initPage(); } catch(DocumentException de) { throw new ExceptionConverter(de); } }
/** * Opens the document. * <P> * You have to open the document before you can begin to add content * to the body of the document. */ public void open() { if (!open) { super.open(); writer.open(); rootOutline = new PdfOutline(writer); currentOutline = rootOutline; } try { initPage(); } catch(DocumentException de) { throw new ExceptionConverter(de); } }
protected void drawBookmark( final RenderNode box, final String bookmark ) { if ( box.isNodeVisible( getDrawArea() ) == false ) { return; } final PdfOutline root = writer.getDirectContent().getRootOutline(); final AffineTransform affineTransform = getGraphics().getTransform(); final float translateX = (float) affineTransform.getTranslateX(); final float upperY = translateX + (float) ( globalHeight - StrictGeomUtility.toExternalValue( box.getY() ) ); final float leftX = (float) ( StrictGeomUtility.toExternalValue( box.getX() ) ); final PdfDestination dest = new PdfDestination( PdfDestination.FIT, leftX, upperY, 0 ); new PdfOutline( root, dest, bookmark ); // destination will always point to the 'current' page // todo: Make this a hierarchy .. }
private void writeBookmark(RenderingContext c, Box root, PdfOutline parent, Bookmark bookmark) { String href = bookmark.getHRef(); PdfDestination target = null; if (href.length() > 0 && href.charAt(0) == '#') { Box box = _sharedContext.getBoxById(href.substring(1)); if (box != null) { PageBox page = root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() - page.getTop(); target = new PdfDestination(PdfDestination.XYZ, 0, normalizeY(distanceFromTop / _dotsPerPoint), 0); target.addPage(_writer.getPageReference(_startPageNo + page.getPageNo()+1)); } } if (target == null) { target = _defaultDestination; } PdfOutline outline = new PdfOutline(parent, target, bookmark.getName()); writeBookmarks(c, root, outline, bookmark.getChildren()); }
private void writeBookmark(RenderingContext c, Box root, PdfOutline parent, Bookmark bookmark) { String href = bookmark.getHRef(); PdfDestination target = null; if (href.length() > 0 && href.charAt(0) == '#') { Box box = _sharedContext.getBoxById(href.substring(1)); if (box != null) { PageBox page = root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() - page.getTop(); target = new PdfDestination(PdfDestination.XYZ, 0, normalizeY(distanceFromTop / _dotsPerPoint), 0); target.addPage(_writer.getPageReference(_startPageNo + page.getPageNo()+1)); } } if (target == null) { target = _defaultDestination; } PdfOutline outline = new PdfOutline(parent, target, bookmark.getName()); writeBookmarks(c, root, outline, bookmark.getChildren()); }
private void writeBookmark(RenderingContext c, Box root, PdfOutline parent, Bookmark bookmark) { String href = bookmark.getHRef(); PdfDestination target = null; if (href.length() > 0 && href.charAt(0) == '#') { Box box = _sharedContext.getBoxById(href.substring(1)); if (box != null) { PageBox page = root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() - page.getTop(); target = new PdfDestination(PdfDestination.XYZ, 0, normalizeY(distanceFromTop / _dotsPerPoint), 0); target.addPage(_writer.getPageReference(_startPageNo + page.getPageNo()+1)); } } if (target == null) { target = _defaultDestination; } PdfOutline outline = new PdfOutline(parent, target, bookmark.getName()); writeBookmarks(c, root, outline, bookmark.getChildren()); }
private void writeBookmark(RenderingContext c, Box root, PdfOutline parent, Bookmark bookmark) { String href = bookmark.getHRef(); PdfDestination target = null; Box box = bookmark.getBox(); if (href.length() > 0 && href.charAt(0) == '#') { box = _sharedContext.getBoxById(href.substring(1)); } if (box != null) { PageBox page = root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() - page.getTop(); target = new PdfDestination(PdfDestination.XYZ, 0, normalizeY(distanceFromTop / _dotsPerPoint), 0); target.addPage(_writer.getPageReference(_startPageNo + page.getPageNo() + 1)); } if (target == null) { target = _defaultDestination; } PdfOutline outline = new PdfOutline(parent, target, bookmark.getName()); writeBookmarks(c, root, outline, bookmark.getChildren()); }
private void writeBookmark(RenderingContext c, Box root, PdfOutline parent, Bookmark bookmark) { String href = bookmark.getHRef(); PdfDestination target = null; Box box = bookmark.getBox(); if (href.length() > 0 && href.charAt(0) == '#') { box = _sharedContext.getBoxById(href.substring(1)); } if (box != null) { PageBox page = root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() - page.getTop(); target = new PdfDestination(PdfDestination.XYZ, 0, normalizeY(distanceFromTop / _dotsPerPoint), 0); target.addPage(_writer.getPageReference(_startPageNo + page.getPageNo() + 1)); } if (target == null) { target = _defaultDestination; } PdfOutline outline = new PdfOutline(parent, target, bookmark.getName()); writeBookmarks(c, root, outline, bookmark.getChildren()); }
PdfOutline outline = new PdfOutline(cb.getRootOutline(), destination, bookmark);
currentOutline = currentOutline.parent(); PdfOutline outline = new PdfOutline(currentOutline, destination, section.getBookmarkTitle(), section.isBookmarkOpen()); currentOutline = outline;
currentOutline = currentOutline.parent(); PdfOutline outline = new PdfOutline(currentOutline, destination, section.getBookmarkTitle(), section.isBookmarkOpen()); currentOutline = outline;
currentOutline = currentOutline.parent(); PdfOutline outline = new PdfOutline(currentOutline, destination, section.getBookmarkTitle(), section.isBookmarkOpen()); currentOutline = outline;