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.
- .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)
- 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
See the following examples:
SignOdtFile.cs– adds a digital signature to an ODT document.SignOttFile.cs– adds a digital signature to an OTT document.
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);
}- Add the
GroupDocs.SignatureNuGet package to your project. - Place your source ODT/OTT file, certificate (
.pfx), and optional image in the project folder. - Update the file paths, certificate password, and signature coordinates in the code files.
- Run the example – a signed PDF (
sampleSigned.pdf) will be generated.
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/.