# GrapeCity.ActiveReports.Document.PageDocument.LoadSnapshot

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Document_PageDocument_LoadSnapshot_" data-uid="GrapeCity.ActiveReports.Document.PageDocument.LoadSnapshot*">LoadSnapshot Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Document_PageDocument_LoadSnapshot_" data-uid="GrapeCity.ActiveReports.Document.PageDocument.LoadSnapshot*"></a>
<h4 id="GrapeCity_ActiveReports_Document_PageDocument_LoadSnapshot_System_IO_FileInfo_" data-uid="GrapeCity.ActiveReports.Document.PageDocument.LoadSnapshot(System.IO.FileInfo)">LoadSnapshot(FileInfo)</h4>
<div class="markdown level1 summary"><p>Loads a page document with aids the specified file info.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static PageDocument LoadSnapshot(FileInfo snapshotFile)</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.fileinfo">FileInfo</a></td>
      <td><span class="parametername">snapshotFile</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.fileinfo">FileInfo</a> object to aids in the creation of <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.filestream">FileStream</a>.</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="GrapeCity.ActiveReports.Document.PageDocument.html">PageDocument</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_Document_PageDocument_LoadSnapshot_" data-uid="GrapeCity.ActiveReports.Document.PageDocument.LoadSnapshot*"></a>
<h4 id="GrapeCity_ActiveReports_Document_PageDocument_LoadSnapshot_System_IO_Stream_GrapeCity_ActiveReports_ResourceLocator_" data-uid="GrapeCity.ActiveReports.Document.PageDocument.LoadSnapshot(System.IO.Stream,GrapeCity.ActiveReports.ResourceLocator)">LoadSnapshot(Stream, ResourceLocator)</h4>
<div class="markdown level1 summary"><p>Loads a page document snapshot from the specified stream, verifying its digital signature and version compatibility.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static PageDocument LoadSnapshot(Stream snapshotStream, ResourceLocator resourceLocator = null)</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">snapshotStream</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> object containing the serialized document snapshot data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../MESCIUS.ActiveReports.Core.Rdl/GrapeCity.ActiveReports.ResourceLocator.html">ResourceLocator</a></td>
      <td><span class="parametername">resourceLocator</span></td>
      <td><p>An <a class="xref" href="../MESCIUS.ActiveReports.Core.Rdl/GrapeCity.ActiveReports.ResourceLocator.html">ResourceLocator</a> object used to resolve external resources referenced in the document.
The default is <code>null</code>.</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="GrapeCity.ActiveReports.Document.PageDocument.html">PageDocument</a></td>
      <td><p>A <a class="xref" href="GrapeCity.ActiveReports.Document.PageDocument.html">PageDocument</a> instance representing the page documet that loaded from snapshot.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Document_PageDocument_LoadSnapshot_System_IO_Stream_GrapeCity_ActiveReports_ResourceLocator__examples">Examples</h5>
<pre><code class="lang-csharp">// Loading a page document from the snapshot.
string path = System.IO.Path.Combine(rootPath, "SampleSnapshotFile.rdlx-snap");

using (var fs = new FileStream(path, FileMode.Open)
{
	 PageDocument document = PageDocument.LoadSnapshot(fs, new SampleResourceLocator());
}</code></pre>

<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.invaliddataexception">InvalidDataException</a></td>
      <td><p>Thrown if the digital signature is invalid or the snapshot version is not supported.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
