# GrapeCity.Documents.Pdf.GcPdfDocument.StartDoc

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Pdf_GcPdfDocument_StartDoc_" data-uid="GrapeCity.Documents.Pdf.GcPdfDocument.StartDoc*">StartDoc Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Pdf_GcPdfDocument_StartDoc_" data-uid="GrapeCity.Documents.Pdf.GcPdfDocument.StartDoc*"></a>
<h4 id="GrapeCity_Documents_Pdf_GcPdfDocument_StartDoc_System_IO_Stream_" data-uid="GrapeCity.Documents.Pdf.GcPdfDocument.StartDoc(System.IO.Stream)">StartDoc(Stream)</h4>
<div class="markdown level1 summary"><p>Starts document generation in sequential mode.</p>
<p>
In this mode, the content of the document is written directly into the underlying stream
as soon as it is created, without the use of temporary files.
When all content has been added, call <a class="xref" href="GrapeCity.Documents.Pdf.GcPdfDocument.EndDoc.html#GrapeCity_Documents_Pdf_GcPdfDocument_EndDoc">EndDoc()</a> to finish creating 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 StartDoc(Stream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub StartDoc(stream As Stream)</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.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The stream to which the PDF document will be written.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Pdf_GcPdfDocument_StartDoc_System_IO_Stream__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
Sequential mode may provide better performance,
but it does not allow modifying the already created pages
(which is possible when <a class="xref" href="GrapeCity.Documents.Pdf.GcPdfDocument.StartDoc.html#GrapeCity_Documents_Pdf_GcPdfDocument_StartDoc_System_IO_Stream_">StartDoc(Stream)</a> is not called,
and the document is saved by <a class="xref" href="GrapeCity.Documents.Pdf.GcPdfDocument.Save.html#GrapeCity_Documents_Pdf_GcPdfDocument_Save_System_IO_Stream_System_Boolean_">Save(Stream, bool)</a> or <a class="xref" href="GrapeCity.Documents.Pdf.GcPdfDocument.Save.html#GrapeCity_Documents_Pdf_GcPdfDocument_Save_System_String_System_Boolean_">Save(string, bool)</a>
after all content has been added instead.)
</p>
<a class="xref" href="GrapeCity.Documents.Pdf.GcPdfDocument.EndDoc.html#GrapeCity_Documents_Pdf_GcPdfDocument_EndDoc">EndDoc()</a>
<a class="xref" href="GrapeCity.Documents.Pdf.GcPdfDocument.Save.html#GrapeCity_Documents_Pdf_GcPdfDocument_Save_System_IO_Stream_System_Boolean_">Save(Stream, bool)</a>
<a class="xref" href="GrapeCity.Documents.Pdf.GcPdfDocument.Save.html#GrapeCity_Documents_Pdf_GcPdfDocument_Save_System_String_System_Boolean_">Save(string, bool)</a>
</div>
</div>
