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) {