---
title: "Generating PDF/UA from Excel templates | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/pdf-generation/spreadsheet-template-to-pdf-ua/"
md_url: "https://www.nutrient.io/guides/dotnet/pdf-generation/spreadsheet-template-to-pdf-ua.md"
last_updated: "2026-08-21T00:00:00.000Z"
description: "How to generate accessible PDF/UA files from Excel templates using Nutrient .NET SDK."
---

# Generating PDF/UA from Excel templates

This guide explains how to process an Excel template with JSON data and convert the generated workbook to PDF/UA.

Use this workflow for invoices, statements, reports, and other workbooks that share the same worksheet structure. The template keeps layout, formulas, and formatting in the Excel file, while the JSON model provides the variable content.

PDF/UA (Universal Accessibility) helps generated PDFs meet accessibility requirements for standards and policies such as Section 508, ADA, and EN 301 549.

[Download sample](https://www.nutrient.io/downloads/samples/gdpicture/spreadsheet-template-to-pdf-ua.zip)

## Preparing the project

Initialize licensing before you process templates or convert documents:

```csharp

using GdPicture14;

LicenseManager license = new LicenseManager();
license.RegisterKEY(""); // Set your license key

```

## Setting up template processing

Create a `GdPictureOfficeTemplater` instance and load the JSON data model:

```csharp

GdPictureOfficeTemplater templater = new GdPictureOfficeTemplater();

templater.SetTemplate(System.IO.File.ReadAllText("input_spreadsheet_model.json"));

```

The templater uses the JSON values to replace placeholders in the Excel template.

## Loading and processing the template document

Process the Excel template in three steps.

### Step 1 — Loading the template

Load the `.xlsx` template before applying the JSON model:

```csharp

templater.LoadFromFile(@"input_spreadsheet.xlsx");

```

`LoadFromFile` reads the workbook into memory and detects the Excel format.

### Step 2 — Processing template markers

Apply the data model to resolve placeholders and loop rows:

```csharp

templater.Process();

```

`Process` resolves placeholders using the JSON model, repeats loop rows for collection data, and preserves cell types, formatting, and layout.

### Step 3 — Saving the processed XLSX

Save the generated workbook as a new `.xlsx` file:

```csharp

templater.SaveToFile(@"output.xlsx");

```

`SaveToFile` writes the processed result as a new Excel workbook.

## Converting to PDF/UA

Convert the processed XLSX file to a PDF/UA document:

```csharp

using GdPictureDocumentConverter converter = new GdPictureDocumentConverter();

converter.LoadFromFile(@"output.xlsx");

converter.SaveAsPDF(@"output.pdf", PdfConformance.PDF_UA_1);

```

The converter loads the generated workbook and writes `output.pdf` with PDF/UA-1 conformance.

## Key features

This workflow covers the following tasks:

- Generate a workbook from an Excel template and JSON data.

- Replace placeholders and repeat row loops.

- Preserve cell types for numbers, dates, percentages, and Booleans.

- Preserve formatting and layout from the source template.

- Convert the generated XLSX file to PDF/UA.

## Conclusion

You now have a workflow for generating an Excel workbook from JSON data and converting it to PDF/UA. Use this pattern when you have a fixed worksheet design and variable content that comes from a data model.

---

## Related pages

- [Generate PDFs in.NET](/guides/dotnet/pdf-generation.md)
- [Create PDFs from byte arrays in C#](/guides/dotnet/pdf-generation/byte-array.md)
- [Create PDFs from scratch in C#](/guides/dotnet/pdf-generation/from-scratch.md)
- [Generate a PDF from a DOCX template in C#](/guides/dotnet/pdf-generation/from-word-template.md)
- [Generating PDF/UA from PowerPoint templates](/guides/dotnet/pdf-generation/presentation-template-to-pdf-ua.md)
- [Create tagged PDFs in C#](/guides/dotnet/pdf-generation/tagged.md)
- [Create thumbnails from PDFs in C#](/guides/dotnet/pdf-generation/thumbnail-preview.md)
- [Generating PDF/UA from Word templates](/guides/dotnet/pdf-generation/word-template-to-pdf-ua.md)

