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.

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.
The next screenshot shows the attachment of the created 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.
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.
- Angular
- Blazor
- React
- JavaScript
- ASP.NET MVC, ASP.NET Core, and WebForms
Related Posts
Best Practices for Image Compression when Exporting to PDF in .NET C#
When generating PDFs programmatically, one of the most important factors affecting file size and rendering performance is how images are embedded and compressed. This article explores best…
Filtering and Sorting Repeating Blocks in MailMerge using C#
TX Text Control MailMerge's ability to filter and sort repeating merge blocks is a key strength, making it ideal for creating dynamic reports, lists, and catalogs.
Text Control at NDC Copenhagen Developers Festival 2025
Join Text Control at the 2025 NDC Copenhagen Developers Festival, where we will present our newest innovations and solutions for document processing, reporting, and PDF generation. This unique…
Why HTML is not a Substitute for Page-Oriented Formats like DOCX
In this blog post, we will discuss the limitations of HTML as a document format and explain why page-oriented formats, such as DOCX, remain essential for certain use cases. We will explore the…
Back from KCDC 2025 - Some Impressions
In this blog post, we will share our impressions of the KCDC 2025 conference and our key takeaways from it. We showcased our latest features and collected valuable feedback from attendees.