title: Merging two PdfDocument objects
body: <p>Simple question , how to merge two PdfDocument objects using itext7 .net Library ?</p>
  
  <p>this is how am trying but it's not working</p>
  
  <pre><code>PdfDocument GlobalPdfDocument = new PdfDocument(new PdfWriter(multiContentPdf));
  
  PdfDocument InitialPdfDoc = new PdfDocument(new PdfWriter(memStreamOfAddressAndBarcode));
  InitialPdfDoc.CopyPagesTo(1, InitialPdfDoc.GetNumberOfPages(), GlobalPdfDocument);
  </code></pre>
  
  <p>also this code throw same exception </p>
  
  <pre><code>Merger.Merge(InitialPdfDoc,1,InitialPdfDoc.GetNumberOfPages());
  </code></pre>
  
  <blockquote>
    <p>Cannot copy indirect object from the document that is being written</p>
  </blockquote>
  
  <p>tried also to write the nested pdf to the disk ---> read --> another exception</p>
  
  <p>any ideas !!</p>