Beispiel #1
0
 /// <summary>Marks object to be saved as indirect.</summary>
 /// <param name="document">a document the indirect reference will belong to.</param>
 /// <returns>object itself.</returns>
 public virtual PdfObject MakeIndirect(PdfDocument document, PdfIndirectReference reference)
 {
     if (document == null || indirectReference != null)
     {
         return(this);
     }
     if (document.GetWriter() == null)
     {
         throw new PdfException(PdfException.ThereIsNoAssociatePdfWriterForMakingIndirects);
     }
     if (reference == null)
     {
         indirectReference = document.CreateNextIndirectReference();
         indirectReference.SetRefersTo(this);
     }
     else
     {
         reference.SetState(MODIFIED);
         indirectReference = reference;
         indirectReference.SetRefersTo(this);
     }
     SetState(FORBID_RELEASE);
     ClearState(MUST_BE_INDIRECT);
     return(this);
 }