How to Convert Word to PDF/A in C# ?

PDF/A is an ISO-standardized version of the Portable Document Format (PDF) specialized for the digital preservation of electronic documents. It is widely used for long term archiving for PDF format. This article mainly shows how to convert word document (doc and docx) to PDF/A in C# by using Spire.Doc.

Make sure Spire.Doc for .NET Version 5.0.26 (or above) has been installed correctly and then add Spire.Doc.dll as reference in the downloaded Bin folder though the below path: "..\Spire.Doc\Bin\NET4.0\ Spire.Doc.dll".

First, check the original word document that will be converted to PDF/A.

Convert Word to PDF/A in C#

Here comes to the details of how developers convert word document to PDF/A directly by using Spire.Doc:

Step 1: Load a word document from the file.

Document document = new Document();
document.LoadFromFile(@"D:\test.docx",FileFormat.Docx);

Step 2: Sets the Pdf document's Conformance-level to PDF_A1B.

ToPdfParameterList toPdf = new ToPdfParameterList();
toPdf.PdfConformanceLevel = Spire.Pdf.PdfConformanceLevel.Pdf_A1B;

Step 3: Save word document to PDF

document.SaveToFile("result.Pdf",toPdf);

Please check the effective screenshot of the result PDF in PDF/A format.

Convert Word to PDF/A in C#