# C1.Pdf.PdfPageCollection.Insert

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Pdf_PdfPageCollection_Insert_" data-uid="C1.Pdf.PdfPageCollection.Insert*">Insert Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Pdf_PdfPageCollection_Insert_" data-uid="C1.Pdf.PdfPageCollection.Insert*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Insert_System_Int32_C1_Pdf_PdfPage_" data-uid="C1.Pdf.PdfPageCollection.Insert(System.Int32,C1.Pdf.PdfPage)">Insert(int, PdfPage)</h4>
<div class="markdown level1 summary"><p>Inserts a page at a specific position in the document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Insert(int index, PdfPage page)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Insert(index As Integer, page As PdfPage)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">index</span></td>
      <td><p>Position where the new page will be inserted in the document.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Pdf.PdfPage.html">PdfPage</a></td>
      <td><span class="parametername">page</span></td>
      <td><p><a class="xref" href="C1.Pdf.PdfPage.html">PdfPage</a> to add to the document.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Pdf_PdfPageCollection_Insert_System_Int32_C1_Pdf_PdfPage__remarks">Remarks</h5>
<div class="markdown level1 remarks"><pre><code>&lt;p&gt;Since the &lt;xref href=&quot;C1.Pdf.PdfPage&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; class has no public constructors, the only 
</code></pre>
<p>way to use this overload is to remove an existing page from the document
first, then add that page back into the document.</p>
<p>Each page can appear only once in the document. Trying to add the same
page twice will throw an exception.</p>
</div>


<a id="C1_Pdf_PdfPageCollection_Insert_" data-uid="C1.Pdf.PdfPageCollection.Insert*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Insert_System_Int32_" data-uid="C1.Pdf.PdfPageCollection.Insert(System.Int32)">Insert(int)</h4>
<div class="markdown level1 summary"><p>Creates a new page and inserts it at a specific position in the document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Insert(int index)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Insert(index As Integer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">index</span></td>
      <td><p>The position where the new page will be inserted.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Pdf_PdfPageCollection_Insert_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><pre><code>&lt;p&gt;The size of the new page is determined by the &lt;xref href=&quot;C1.Pdf.C1PdfDocument.PageSize&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; property 
</code></pre>
<p>of the parent document.</p>
<p>The new page becomes current after it is added to the document (see the <a class="xref" href="C1.Pdf.C1PdfDocument.CurrentPage.html#C1_Pdf_C1PdfDocument_CurrentPage">CurrentPage</a> property).</p>
</div>


<a id="C1_Pdf_PdfPageCollection_Insert_" data-uid="C1.Pdf.PdfPageCollection.Insert*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Insert_System_Int32_System_Drawing_SizeF_" data-uid="C1.Pdf.PdfPageCollection.Insert(System.Int32,System.Drawing.SizeF)">Insert(int, SizeF)</h4>
<div class="markdown level1 summary"><p>Creates a new page with the specified size and inserts it at a specific
position in the document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Insert(int index, SizeF pageSize)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Insert(index As Integer, pageSize As SizeF)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">index</span></td>
      <td><p>The position where the new page will be inserted.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><span class="parametername">pageSize</span></td>
      <td><p>The size of the new page, expressed in points.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Pdf_PdfPageCollection_Insert_" data-uid="C1.Pdf.PdfPageCollection.Insert*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Insert_System_Int32_GrapeCity_Documents_Common_PaperKind_" data-uid="C1.Pdf.PdfPageCollection.Insert(System.Int32,GrapeCity.Documents.Common.PaperKind)">Insert(int, PaperKind)</h4>
<div class="markdown level1 summary"><p>Creates a new page with the specified size and inserts it at a specific
position in the document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Insert(int index, PaperKind paperKind)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Insert(index As Integer, paperKind As PaperKind)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">index</span></td>
      <td><p>The position where the new page will be inserted.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">PaperKind</span></td>
      <td><span class="parametername">paperKind</span></td>
      <td><p>The size of the new page, expressed as a <span class="xref">GrapeCity.Documents.Common.PaperKind</span>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
