Products Technologies Demo Docs Blog Support Company

Creating Trusted Document Containers with PDF/A-3b in .NET C#

TX Text Control allows developers to do more than just generate PDFs. They can also build trusted digital archives that combine human-readable documents and machine-readable data in one secure, signed container.

Creating Trusted Document Containers with PDF/A-3b in .NET C#

Documents are more than just pages of text; they are containers of information. For example, a financial report is not only what you see on paper, it is also the structured data behind it. A contract may include supporting spreadsheets, audit logs, or annexes that provide the full picture.

With PDF/A-3b, you can combine everything into one trusted digital container:

  • A human-readable PDF for legal and business use
  • With machine-readable attachments (XML, JSON, CSV, Excel, CAD, images) embedded inside

These containers become tamper-proof packages when sealed with digital signatures, ensuring long-term integrity and compliance, even years or decades later. With TX Text Control, developers can automate the creation of these powerful document containers within their applications.

Why Document Containers Matter

Traditional PDFs only capture the visible representation of a document. However, business-critical processes require more, including the raw data, metadata, and supporting evidence. PDF/A-3b transforms a standard PDF into a container that combines all these elements, forming a single, secure, and archivable file.

The Power of Digital Signatures

PDF/A-3b becomes a trusted, verifiable data container when combined with digital signatures.

  • Signatures ensure that no content or attachment has been altered since signing.
  • Regulators, auditors, and courts can validate both the visible document and the embedded evidence.
  • Businesses can reduce the risk of mismatches between official documents and external data files.

Business Scenarios for PDF/A-3b Containers

TX Text Control allows developers to create applications that generate signed PDF/A-3b containers for a variety of industries.

  • Banking
    • Loan agreements with embedded financial data
    • Compliance documents with attached audit trails
    • One package that customers can read and finance apps can import
  • Insurance
    • Policy documents with embedded claims data
    • Regulatory submissions with attached evidence
    • It prevents disputes by linking the official signed view and the calculation data.
  • Healthcare
    • Patient records with embedded lab results
    • Insurance claims with attached medical evidence
    • Embedded DICOM image or sensor data
    • Ensures that medical notes and raw data are bound together and signed.
  • Legal
    • Contracts with embedded negotiation history
    • Litigation documents with attached evidence
    • All signed and archived in one compliant file

How TX Text Control Helps

TX Text Control enables developers to programmatically generate PDF/A-3b documents, attach files of various types (XML, JSON, CSV, Excel, CAD, images, etc.) to those PDFs, apply PAdES-compliant digital signatures, and ensure documents remain archivable, trustworthy, and tamper-proof. With just a few lines of C# code, developers can merge data, generate professional PDF contracts or reports, embed raw data sources, and digitally sign containers, all of which are fully automated in server-side workflows.

The following processes can be integrated into business applications with the help of TX Text Control.

  • Generate PDF/A-3b documents programmatically
  • Attach files of various types (XML, JSON, CSV, Excel, CAD, images, etc.) to those PDFs
  • Apply digital signatures to ensure document integrity and authenticity

The code below uses TX Text Control to create a new PDF document and attaches a document to the resulting PDF/A document.

// create a non-UI ServerTextControl instance
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {

  tx.Create();
  // set dummy content
  tx.Text = "PDF Document Content";

  // read the content of the attachment
  string sAttachment = System.IO.File.ReadAllText("attachment.txt");

  // create the attachement
  TXTextControl.EmbeddedFile attachment =
     new TXTextControl.EmbeddedFile(
        "attachment.txt",
        sAttachment,
        null) {
       Description = "My Text File",
       Relationship = "Unspecified",
       MIMEType = "application/txt",
       CreationDate = DateTime.Now,
     };

  // attached the embedded file
  tx.DocumentSettings.EmbeddedFiles =
     new TXTextControl.EmbeddedFile[] { attachment };

  // save as PDF/A
  tx.Save("document.pdf", TXTextControl.StreamType.AdobePDFA);
}

This concept is especially useful for archiving because the ISO standard PDF/A-3b allows attachments to be embedded directly within the document. This enables the legal compliance of archiving complete document containers, including supported attachments, whenever PDF/A is required.

Signing the PDF/A

PDF digital signatures use Public Key Infrastructure (PKI) to ensure authenticity and prevent tampering. First, a cryptographic hash of the document is generated. Then, it is encrypted with the signer's private key to create the digital signature. Both the signature and the signer's certificate are embedded in the PDF. When the document is opened, the PDF reader decrypts the hash using the signer's public key and compares it with a newly calculated hash. A match confirms that the document has not been altered, while a mismatch marks the signature as invalid, safeguarding both the document's integrity and the trust in its authenticity.

The following code creates a PDF/A-3b document with an attachment and digitally signs the document, creating a trusted document container.

// Load the signing certificate (PFX with private key)
using System.Security.Cryptography.X509Certificates;
using TXTextControl;

var cert = new X509Certificate2("MyTXCert.pfx", "123", X509KeyStorageFlags.Exportable);

using (var tx = new ServerTextControl())
{
    tx.Create();
    tx.Text = "PDF Document Content";

    // Read the attachment content
    string attachmentContent = File.ReadAllText("attachment.txt");

    // Create the embedded file (attachment)
    var attachment = new EmbeddedFile(
        "attachment.txt",
        attachmentContent,
        null)
    {
        Description = "My Text File",
        Relationship = "Unspecified",
        MIMEType = "application/txt",
        CreationDate = DateTime.Now
    };

    // Attach the embedded file to the document
    tx.DocumentSettings.EmbeddedFiles = new[] { attachment };

    // Prepare digital signature
    var saveSettings = new SaveSettings
    {
        DigitalSignature = new DigitalSignature(cert, null)
    };

    // Save as PDF/A (with embedded file and digital signature)
    tx.Save("document.pdf", StreamType.AdobePDFA, saveSettings);
}

Console.WriteLine("PDF/A saved with embedded file and digital signature.");

The screenshot below illustrates the document as it appears in Acrobat Reader, highlighting the digital signature.

Resulting PDF/A-3b Document

The next screenshot shows the attachment of the created document.

Resulting PDF/A-3b Document

A Future-Proof Digital Archive

Businesses can create self-contained, future-proof archives that meet the highest compliance standards by combining PDF/A-3b, attachments, and digital signatures. TX Text Control enables organizations to preserve legal authenticity, reduce the risk of data loss, improve transparency and trust, and streamline compliance with regulations such as eIDAS, ESIGN, and industry-specific mandates.

Conclusion

With TX Text Control, developers can do more than just generate PDFs. They can also build trusted digital archives that combine human-readable documents and machine-readable data in one secure, signed container.

This combination of archival compliance, data integrity, and automation creates opportunities for new business applications in finance, insurance, healthcare, legal services, and more.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

ASP.NET

Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.

ASP.NET Core
Angular
Blazor
JavaScript
React
  • Angular
  • Blazor
  • React
  • JavaScript
  • ASP.NET MVC, ASP.NET Core, and WebForms

Learn more Trial token Download trial

Related Posts

ASP.NETASP.NET CorePDF

Validate Digital Signatures and the Integrity of PDF Documents in C# .NET

Learn how to validate digital signatures and the integrity of PDF documents using the PDF Validation component from TX Text Control in C# .NET. Ensure the authenticity and compliance of your…


ASP.NETASP.NET CoreC#

Day-1 Support for .NET 10 in TX Text Control 34.0

Microsoft has officially released .NET 10. TX Text Control 34.0 offers day-one support for .NET 10 and has undergone thorough testing to ensure compatibility with the latest .NET version and…


ASP.NETASP.NET CorePDF

Validate PDF/UA Documents and Verify Electronic Signatures in C# .NET

The new TXTextControl.PDF.Validation NuGet package enables you to validate PDF/UA documents and verify digital signatures directly in your code without relying on third-party tools or external…


ASP.NETASP.NET CoreC#

How To Choose the Right C# PDF Generation Library: Developer Checklist

To make your choice easy, this guide provides a systematic evaluation framework for two library categories: basic and enterprise PDF libraries. It covers matching features to use cases, evaluating…


ActiveXASP.NETWindows Forms

Introducing TX Text Control 34.0: Your Next Leap in Document Processing.

We are happy to announce the release of TX Text Control 34.0. This version is packed with new features and enhancements that will elevate your document processing experience. This version…

Summarize this blog post with:

Share on this blog post on: