PDF to PDF/A C# Overview
Leverage our PDF to PDF/A C# library to convert your PDFs into the PDF/A format, tailored for archival and preservation needs.
This tool supports PDF/A ISO conformance levels, such as PDF/A-1a, PDF/A-1b, PDF/A-2a, PDF/A-2b, PDF/A-2u, PDF/A-3a, PDF/A-3b, PDF/A-3u, PDF/A-4, PDF/A-4e, and PDF/A-4f, ensuring your documents meet strict archival standards.
E-Invoice ready. Optionally embed structured e-invoice XML in the output PDF/A. We support Factur-X 1.0 and ZUGFeRD 1.0/2.0 profiles, ideal for compliant archiving and exchange. Use with PDF/A-3 to include the XML payload alongside the visual PDF.
It's ideally suited for professionals and organizations looking for a dependable solution for document preservation, offering customizable options to fit various compliance and archival requirements. With our C# library, secure and long-term document storage becomes straightforward and efficient.
VeraPDF Certified
Industry-leading VeraPDF compliance for trusted validation.
Full ISO Compliance
Supports PDF/A-1a/1b, PDF/A-2a/2b/2u, PDF/A-3a/3b/3u, and PDF/A-4/4e/4f with full conformance options.
Batch Conversion Ready
Convert large volumes of PDFs to PDF/A efficiently.
Regulatory Archiving
Meet archiving standards required by governments worldwide.
E-Invoice Embedding
Embed Factur-X or ZUGFeRD XML in PDF/A-3 (a/b/u) for compliant e-invoicing.
Future-Proof Viewing
Ensure documents display correctly now and decades later.
Customizable Parameters
Fine-tune your automation with these powerful conversion options
File
File Supported formats: .pdfFile to be converted. Value can be URL or file content.
Password
StringSets the password to open protected PDF.
PdfaVersion
Collection Default: pdfA2bSet PDF/A version.
Values: pdfA1a pdfA1b pdfA2a pdfA2b pdfA2u pdfA3a pdfA3b pdfA3u pdfA4 pdfA4e pdfA4fInvoiceFormat
Collection Default: noneSelects the e-invoice format to embed. Choosing any e-invoice format overrides the selected PDF/A version and outputs PDF/A-3. Requires a valid structured invoice XML.
Values: none facturX zugferd1 zugferd2InvoiceFile
File Supported formats: .xmlSpecifies the structured invoice XML (ZUGFeRD / Factur-X) to embed for hybrid-invoice compatibility. Required when InvoiceFormat is enabled.
Linearize
Bool Default: FalseLinearize PDF file and optimize for fast Web View.
StoreFile
Bool Default: FalseWhen the StoreFile parameter is set to True, your converted file is written to ConvertAPI’s encrypted, temporary storage and made available via a time-limited secure download URL, valid for up to 3 hours. After this period, the file is permanently deleted.
When StoreFile is set to False, conversion happens entirely in-memory. The raw file bytes are streamed back in the API response without touching disk or external storage, ensuring maximum security and zero persistence so that only you can access the content.
Integrate using C#
Ready-to-run code samples for quick conversion and automation.
Install
Add the official ConvertAPI client to your project.
.NET CLI
dotnet add package ConvertApi
Package Manager (Visual Studio)
Install-Package ConvertApiSetup
Initialize the client once and point it to the v2 platform.
using ConvertApiDotNet;
var token = Environment.GetEnvironmentVariable("CONVERTAPI_TOKEN") ?? "YOUR_API_TOKEN";
var convertApi = new ConvertApi(token);
// Target the v2 endpoint
ConvertApi.ApiBaseUri = "https://v2.convertapi.com";Quick start — PDF → PDF/A (default PdfA2b)
Make a minimal call to convert a single PDF and save the output to disk.
var result = await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", @"C:\docs\document.pdf")
);
await result.SaveFilesAsync(@"C:\out");Choose a specific PDF/A version
Target the exact ISO profile your policy requires (e.g., PdfA4e, PdfA3b).
var result = await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", @"C:\docs\document.pdf"),
new ConvertApiParam("PdfaVersion", "PdfA4e") // 1a/1b, 2a/2b/2u, 3a/3b/3u, 4/4e/4f
);
await result.SaveFilesAsync(@"C:\out");Embed e-invoice (Factur-X 1.0) — PDF + XML
Pair your visual PDF with machine-readable XML for compliant e-invoicing (use PDF/A-3).
var result = await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", @"C:\docs\document.pdf"),
new ConvertApiFileParam("InvoiceFile", @"C:\docs\invoice.xml"),
new ConvertApiParam("PdfaVersion", "PdfA3b"),
new ConvertApiParam("InvoiceFormat","facturX")
);
await result.SaveFilesAsync(@"C:\out");Embed e-invoice (ZUGFeRD 2.0) — PDF + XML
Swap the format to ZUGFeRD 2.0 while keeping the same PDF/A-3 pattern.
var result = await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", @"C:\docs\document.pdf"),
new ConvertApiFileParam("InvoiceFile", @"C:\docs\invoice.xml"),
new ConvertApiParam("PdfaVersion", "PdfA3b"),
new ConvertApiParam("InvoiceFormat","zugferd2")
);
await result.SaveFilesAsync(@"C:\out");Batch convert a folder (auto-embed XML when present)
Process entire directories at once; if a matching .xml exists, embed it as an invoice automatically.
var inputDir = @"C:\docs\in";
var outputDir = @"C:\docs\out";
Directory.CreateDirectory(outputDir);
foreach (var pdf in Directory.EnumerateFiles(inputDir, "*.pdf"))
{
var xml = Path.ChangeExtension(pdf, ".xml");
ConvertApiResponse result;
if (File.Exists(xml))
{
result = await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", pdf),
new ConvertApiFileParam("InvoiceFile", xml),
new ConvertApiParam("PdfaVersion", "PdfA3b"),
new ConvertApiParam("InvoiceFormat","facturX")
);
}
else
{
result = await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", pdf)
);
}
await result.SaveFilesAsync(outputDir);
}Put it together (tiny console app)
Drop these calls into Main to verify your setup end-to-end.
public static async Task Main()
{
var token = Environment.GetEnvironmentVariable("CONVERTAPI_TOKEN") ?? "YOUR_API_TOKEN";
var convertApi = new ConvertApi(token);
ConvertApi.ApiBaseUri = "https://v2.convertapi.com";
await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", @"C:\docs\document.pdf")
).Result.SaveFilesAsync(@"C:\out");
await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", @"C:\docs\document.pdf"),
new ConvertApiParam("PdfaVersion", "PdfA4e")
).Result.SaveFilesAsync(@"C:\out");
await convertApi.ConvertAsync("pdf", "pdfa",
new ConvertApiFileParam("File", @"C:\docs\document.pdf"),
new ConvertApiFileParam("InvoiceFile", @"C:\docs\invoice.xml"),
new ConvertApiParam("PdfaVersion", "PdfA3b"),
new ConvertApiParam("InvoiceFormat", "facturX")
).Result.SaveFilesAsync(@"C:\out");
}Helpful notes
- Invoice params: Use
InvoiceFile(XML) +InvoiceFormat(facturX,zugferd1,zugferd2) with a PDF/A-3 profile (PdfA3a,PdfA3b, orPdfA3u). - Validation: Outputs are intended to be VeraPDF-validated for ISO conformance.
- Large jobs: Add retry logic or raise timeouts for very large documents.
Integrate within minutes
Easy PDF to PDF/A automation using our simple C# SDK
Compatible With All .NET Frameworks & Tools
Frequently Asked Questions
What is ConvertAPI C# SDK?
The ConvertAPI C# SDK is a lightweight, easy-to-use library for .NET developers to integrate document and file conversions into their applications with minimal code. It connects directly to the ConvertAPI REST service, allowing you to automate file conversions, merging, splitting, and more.
What types of conversions are supported?
ConvertAPI offers 300+ converters and tools, including DOCX to PDF, XLSX to PDF, PDF to JPG, HTML to PDF, image processing, metadata extraction, compression, and advanced document workflows. You can automate complex document processing scenarios within your .NET applications using the SDK.
Can I build complex conversion workflows using the SDK?
Yes, the ConvertAPI .NET C# SDK allows you to chain conversions, merge documents, extract pages, and apply advanced parameters to automate end-to-end document workflows within your applications.
Is there a file size limit when using ConvertAPI?
The maximum file size you can convert depends on your ConvertAPI plan type. Higher-tier plans allow larger files and increased concurrency for high-volume document processing needs.
Can I convert files entirely in memory without storing them on your servers?
Yes, ConvertAPI supports in-memory conversions, allowing you to send and receive files as streams without saving them to disk on ConvertAPI servers. This enables secure, diskless workflows for sensitive or temporary files.
Which .NET versions does the ConvertAPI SDK support?
The SDK supports .NET Framework 4.5+, .NET Core, .NET 5, 6, 7, and 8, ensuring compatibility across your existing and new projects.
Businesses trust us
Highest rated File Conversion API on major B2B software listing platforms: Capterra, G2, and Trustpilot.
"ConvertAPI has been a game-changer for our document automation workflows. Their conversion accuracy and API reliability are unmatched in the industry for over 7 years."
"ConvertAPI is a reliable, cost-effective solution with a proven track record of stability. It has grown significantly in maturity, adopting enterprise-grade practices over the years."
"We've integrated ConvertAPI across our entire document processing platform. The performance is exceptional and the support team is always responsive. Highly recommended!"
Enterprise-Grade Security
We ensure that all document processing is handled securely in the cloud, adhering to industry-leading standards like ISO 27001, GDPR, and HIPAA. To enhance security even further, we can ensure that no files or data are stored on our servers and never leave your country.
Learn more about security