# C1.C1Preview.C1PrintDocument.PageConfigureScript

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Preview_C1PrintDocument_PageConfigureScript_" data-uid="C1.C1Preview.C1PrintDocument.PageConfigureScript*">PageConfigureScript Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Preview_C1PrintDocument_PageConfigureScript_" data-uid="C1.C1Preview.C1PrintDocument.PageConfigureScript*"></a>
<h4 id="C1_C1Preview_C1PrintDocument_PageConfigureScript" data-uid="C1.C1Preview.C1PrintDocument.PageConfigureScript">PageConfigureScript</h4>
<div class="markdown level1 summary"><p>Gets or sets the script that is executed when a new page is added to the document.
This script executes after the page has been added to the <a class="xref" href="C1.C1Preview.C1PrintDocument.Pages.html#C1_C1Preview_C1PrintDocument_Pages">Pages</a> collection
but before it is resolved (i.e. when the content of the page has not been laid out yet).</p>
<p>
This script should be used only to change the page layout. Do not use this script
to change the page content, as it may cause errors. 
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public string PageConfigureScript { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property PageConfigureScript As String</code></pre>
</div>
<h5 id="C1_C1Preview_C1PrintDocument_PageConfigureScript_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
<a class="xref" href="C1.C1Preview.C1PrintDocument.html">C1PrintDocument</a> also fires the <a class="xref" href="C1.C1Preview.C1PrintDocument.PageConfigure.html">PageConfigure</a> event at this time.
</p>
<p>
The difference between events and scripts is that event handlers
belong to the application code, while scripts belong to the document.
Thus it is recommended that event handlers be used to perform tasks that
implement the overall application logic but do not depend on the
specific document being processed.
</p>
<p>
On the other hand, scripts should be used to perform tasks directly related
to the document itself. Scripts attached to a document are executed regardless
of the current application (e.g. when the document is regenerated after 
being loaded from file by a different program).
(For example, a document might contain a script that changes the value
of a field in that document when an error occurs.)
</p>
</div>
</div>
