Exemple #1
0
 /// <summary>
 /// Writes the object.
 /// </summary>
 /// <param name="obj">The obj.</param>
 /// <param name="renderRef">if set to <c>true</c> [render ref].</param>
 public void WriteObject(PdfObjectBase obj, bool renderRef)
 {
     if (obj == null)
     {
         obj = PdfNull.Null;
     }
     if (obj.IsLabeled)
     {
         this.WriteLabeledObjectRef(obj, renderRef);
     }
     else
     {
         obj.ToPdf(this);
     }
 }
Exemple #2
0
 /// <summary>
 /// Writes the labeled object.
 /// </summary>
 /// <param name="obj">The obj.</param>
 protected void WriteLabeledObject(PdfObjectBase obj)
 {
     if (!this.crossTable.Contains(obj))
     {
         if (obj is IVersionDepend)
         {
             PdfVersion version = ((IVersionDepend)obj).Version();
             if (version > this.version)
             {
                 this.version        = version;
                 this.refreshVersion = true;
             }
         }
         this.crossTable.Add(new PdfFileCrossRef(obj, this.psw.Position, true));
         this.psw.WriteString(string.Format("{0} {1} ", new object[] { (int)obj.ObjectIndex, (int)obj.Generation }));
         this.psw.WriteBytes(objPrefix);
         obj.ToPdf(this);
         this.psw.WriteBytes(objSuffix);
     }
 }