This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dotnet/signatures/digital-signatures/add-document-timestamp-to-pdf.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Add a document timestamp to a PDF in C# | Nutrient .NET SDK

A document timestamp proves that a PDF existed in a specific state at a specific time. It protects the current document bytes, including signatures and validation material already present in the file.

Use document timestamps when archival or compliance workflows require independent timestamp evidence for the whole PDF.

This guide shows how to:

  • Load a PDF document
  • Configure a timestamp authority (TSA)
  • Append a document timestamp to the PDF

This sample contacts an RFC 3161 timestamp authority. Replace the sample timestamp URL with the TSA endpoint approved for your environment.

Prepare the project

Register the SDK license before running timestamp operations. For setup details, refer to the getting started with .NET SDK guide.

using System;
using GdPicture14;
void CheckStatus(GdPictureStatus status, string operation)
{
if (status != GdPictureStatus.OK)
{
throw new InvalidOperationException($"{operation} failed. Status: {status}");
}
}
LicenseManager license = new LicenseManager();
license.RegisterKEY(""); // Set your license key

Load the PDF document

Create a GdPicturePDF instance and load the source file:

using GdPicturePDF pdf = new GdPicturePDF();
CheckStatus(pdf.LoadFromFile(@"input.pdf", false), "LoadFromFile");

Configure the timestamp authority

Set the timestamp server URL and credentials. Leave the username and password empty for a public TSA that doesn’t require authentication.

CheckStatus(pdf.SetSignatureTimestampInfo("http://timestamp.digicert.com", "", ""), "SetSignatureTimestampInfo");

SetSignatureTimestampInfo stores the TSA configuration used by ApplyDocumentTimestamp.

Apply the document timestamp

Append the timestamp as an incremental update:

CheckStatus(pdf.ApplyDocumentTimestamp(@"timestamped.pdf"), "ApplyDocumentTimestamp");

The output PDF contains a document timestamp signature that covers the current document state.

Error handling

Check the result of ApplyDocumentTimestamp. InvalidParameter indicates missing timestamp configuration. Network, TSA, or response-validation failures return a status that identifies the failed operation.

Conclusion

This workflow loads a PDF, configures a TSA, and writes a timestamped PDF for archival validation workflows.