# C1.Pdf.PdfPageCollection.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Pdf_PdfPageCollection_Add_" data-uid="C1.Pdf.PdfPageCollection.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Pdf_PdfPageCollection_Add_" data-uid="C1.Pdf.PdfPageCollection.Add*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Add_C1_Pdf_PdfPage_" data-uid="C1.Pdf.PdfPageCollection.Add(C1.Pdf.PdfPage)">Add(PdfPage)</h4>
<div class="markdown level1 summary"><p>Adds a page to 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 int Add(PdfPage page)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(page As PdfPage) 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="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 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</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><p>The index of the new page in the document.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Pdf_PdfPageCollection_Add_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_Add_" data-uid="C1.Pdf.PdfPageCollection.Add*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Add" data-uid="C1.Pdf.PdfPageCollection.Add">Add()</h4>
<div class="markdown level1 summary"><p>Creates a new <a class="xref" href="C1.Pdf.PdfPage.html">PdfPage</a> and adds it to the end of 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 int Add()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add() As Integer</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</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><p>The index of the new page.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Pdf_PdfPageCollection_Add_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; 
</code></pre>
<p>property 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>
<p>You can also add pages to a <a class="xref" href="C1.Pdf.C1PdfDocument.html">C1PdfDocument</a> by calling the
<a class="xref" href="C1.Pdf.C1PdfDocumentBase.NewPage.html#C1_Pdf_C1PdfDocumentBase_NewPage">NewPage()</a> method.</p>
</div>


<a id="C1_Pdf_PdfPageCollection_Add_" data-uid="C1.Pdf.PdfPageCollection.Add*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Add_System_Drawing_SizeF_" data-uid="C1.Pdf.PdfPageCollection.Add(System.Drawing.SizeF)">Add(SizeF)</h4>
<div class="markdown level1 summary"><p>Creates a new <a class="xref" href="C1.Pdf.PdfPage.html">PdfPage</a> with the specified size and adds it to
the end of 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 int Add(SizeF pageSize)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(pageSize As SizeF) 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.drawing.sizef">SizeF</a></td>
      <td><span class="parametername">pageSize</span></td>
      <td><p>The size of the new page, in points.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</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><p>The index of the new page.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Pdf_PdfPageCollection_Add_System_Drawing_SizeF__remarks">Remarks</h5>
<div class="markdown level1 remarks"><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>
<p>You can also add pages to a <a class="xref" href="C1.Pdf.C1PdfDocument.html">C1PdfDocument</a> by calling the <a class="xref" href="C1.Pdf.C1PdfDocumentBase.NewPage.html#C1_Pdf_C1PdfDocumentBase_NewPage">NewPage()</a> method.</p>
</div>


<a id="C1_Pdf_PdfPageCollection_Add_" data-uid="C1.Pdf.PdfPageCollection.Add*"></a>
<h4 id="C1_Pdf_PdfPageCollection_Add_GrapeCity_Documents_Common_PaperKind_" data-uid="C1.Pdf.PdfPageCollection.Add(GrapeCity.Documents.Common.PaperKind)">Add(PaperKind)</h4>
<div class="markdown level1 summary"><p>Creates a new <a class="xref" href="C1.Pdf.PdfPage.html">PdfPage</a> with the specified size and adds it to
the end of 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 int Add(PaperKind paperKind)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(paperKind As PaperKind) 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><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>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</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><p>The index of the new page.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Pdf_PdfPageCollection_Add_GrapeCity_Documents_Common_PaperKind__remarks">Remarks</h5>
<div class="markdown level1 remarks"><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>
<p>You can also add pages to a <a class="xref" href="C1.Pdf.C1PdfDocument.html">C1PdfDocument</a> by calling the <a class="xref" href="C1.Pdf.C1PdfDocumentBase.NewPage.html#C1_Pdf_C1PdfDocumentBase_NewPage">NewPage()</a> method.</p>
</div>
</div>
