Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created February 12, 2026 15:42
Show Gist options
  • Select an option

  • Save GroupDocsGists/abcbb9e267907815cbc5b4762d0df8d1 to your computer and use it in GitHub Desktop.

Select an option

Save GroupDocsGists/abcbb9e267907815cbc5b4762d0df8d1 to your computer and use it in GitHub Desktop.
Demonstrates how to apply a digital signature to specialized ODT and OTT documents while preserving file structure with GroupDocs.Signature.

Add Digital Signatures to ODT and OTT Files using GroupDocs.Signature for .NET

This gist shows how to add a digital signature to OpenDocument Text (ODT) and OpenDocument Template (OTT) files while keeping their internal structure intact using the GroupDocs.Signature .NET library.

📦 Prerequisites

  • .NET environment (e.g., .NET 6.0 or later)
  • GroupDocs.Signature for .NET package – install via NuGet (Install-Package GroupDocs.Signature)
  • A digital certificate file (.pfx) and optional image for visual representation
  • Temporary license key (obtain from GroupDocs temporary license)

💡 Key Capabilities

  • Apply digital signatures to ODT and OTT documents
  • Preserve original document structure and formatting
  • Specify signature appearance and position
  • Secure signing with password‑protected certificates

💻 Code Example

See the following examples:

Teaser snippet

using (Signature signature = new Signature("sample.odt"))
{
    DigitalSignOptions options = new DigitalSignOptions("certificate.pfx")
    {
        ImageFilePath = "sample.jpg",
        Left = 100,
        Top = 100,
        Password = "1234567890"
    };
    signature.Sign("sampleSigned.pdf", options);
}

🛠️ How to Use

  1. Add the GroupDocs.Signature NuGet package to your project.
  2. Place your source ODT/OTT file, certificate (.pfx), and optional image in the project folder.
  3. Update the file paths, certificate password, and signature coordinates in the code files.
  4. Run the example – a signed PDF (sampleSigned.pdf) will be generated.

📚 Conclusion

These snippets provide a quick start for digitally signing ODT and OTT documents with GroupDocs.Signature for .NET. For more detailed information, refer to the official documentation: https://docs.groupdocs.com/signature/net/.

using (Signature signature = new Signature("sample.otd"))
{
// initialize digital option with certificate file path
DigitalSignOptions options = new DigitalSignOptions("certificate.pfx")
{
// optional: setup image file path
ImageFilePath = "sample.jpg",
// set signature position
Left = 100,
Top = 100,
// set certificate password
Password = "1234567890"
};
signature.Sign("sampleSigned.pdf", options);
}
using (Signature signature = new Signature("sample.ott"))
{
// initialize digital option with certificate file path
DigitalSignOptions options = new DigitalSignOptions("certificate.pfx")
{
// optional: setup image file path
ImageFilePath = "sample.jpg",
// set signature position
Left = 100,
Top = 100,
// set certificate password
Password = "1234567890"
};
signature.Sign("sampleSigned.pdf", options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment