// methods /** Helper for the constructors. * @param parent the parent outline * @param title the title for this outline * @param open <CODE>true</CODE> if the children are visible */ internal void InitOutline(PdfOutline parent, string title, bool open) { this.open = open; this.parent = parent; writer = parent.writer; Put(PdfName.TITLE, new PdfString(title, PdfObject.TEXT_UNICODE)); parent.AddKid(this); if (destination != null && !destination.HasPage()) // bugfix Finn Bock { SetDestinationPage(writer.CurrentPage); } }
public override void ToPdf(PdfWriter writer, Stream os) { if (_color != null && !_color.Equals(BaseColor.Black)) { Put(PdfName.C, new PdfArray(new[] { _color.R / 255f, _color.G / 255f, _color.B / 255f })); } int flag = 0; if ((_style & text.Font.BOLD) != 0) { flag |= 2; } if ((_style & text.Font.ITALIC) != 0) { flag |= 1; } if (flag != 0) { Put(PdfName.F, new PdfNumber(flag)); } if (_parent != null) { Put(PdfName.Parent, _parent.IndirectReference); } if (_destination != null && _destination.HasPage()) { Put(PdfName.Dest, _destination); } if (_action != null) { Put(PdfName.A, _action); } if (_count != 0) { Put(PdfName.Count, new PdfNumber(_count)); } base.ToPdf(writer, os); }
/** * The local destination to where a local goto with the same * name will jump to. * @param name the name of this local destination * @param destination the <CODE>PdfDestination</CODE> with the jump coordinates * @return <CODE>true</CODE> if the local destination was added, * <CODE>false</CODE> if a local destination with the same name * already existed */ internal bool LocalDestination(String name, PdfDestination destination) { Destination dest; if (localDestinations.ContainsKey(name)) dest = localDestinations[name]; else dest = new Destination(); if (dest.destination != null) return false; dest.destination = destination; localDestinations[name] = dest; if (!destination.HasPage()) destination.AddPage(writer.CurrentPage); return true; }
/** * The local destination to where a local goto with the same * name will jump to. * @param name the name of this local destination * @param destination the <CODE>PdfDestination</CODE> with the jump coordinates * @return <CODE>true</CODE> if the local destination was added, * <CODE>false</CODE> if a local destination with the same name * already existed */ internal bool LocalDestination(String name, PdfDestination destination) { Object[] obj = (Object[])localDestinations[name]; if (obj == null) obj = new Object[3]; if (obj[2] != null) return false; obj[2] = destination; localDestinations[name] = obj; if (!destination.HasPage()) destination.AddPage(writer.CurrentPage); return true; }