/// <summary> /// Writes the given object to the page (writes it on the document and adds it on this page). /// Returns an object reference to the object. /// </summary> public virtual PdfObjectRef WriteObject(PdfObject obj) { if (obj is PdfScriptObject) { foreach (var font in ((PdfScriptObject)obj).ReferencedFonts) { DocumentWriter.RegisterFont(font); } } var objRef = DocumentWriter.WriteObject(obj); this.WriteObjectRef(objRef); return(objRef); }