---
title: "Chrome headless modes with .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/deployment/headless-modes-google-chrome/"
md_url: "https://www.nutrient.io/guides/dotnet/deployment/headless-modes-google-chrome.md"
last_updated: "2026-05-28T01:45:39.246Z"
description: "Run the packaged Docker sample for Chrome-backed conversions with .NET SDK."
---

# Chrome headless modes with .NET SDK

This guide shows how to run the [packaged Docker sample](https://www.nutrient.io/downloads/samples/gdpicture/headless-modes-google-chrome.zip) for Chrome-backed conversions with.NET SDK.

## Run this packaged.NET sample with Docker

From the packaged sample folder, run:

```bash

docker run --rm \
  --platform linux/amd64 \
  --security-opt seccomp=chrome-seccomp.json \
  -w /app \
  -v "$PWD:/app" \
  -e HOME=/home/appuser \
  "$(docker build -q --platform linux/amd64 -f Dockerfile.)" \
  /bin/sh -c 'chmod -R o+rwX /app && exec runuser -u appuser -- dotnet run --project /app -c Release'

```

## Run this packaged.NET sample with Docker Compose

From the packaged sample folder, run:

```bash

docker compose -f docker-compose.yml run --build --rm appuser

```

If the run succeeds, the package writes `output.pdf` to the sample folder.

You can also download [this packaged sample](https://www.nutrient.io/downloads/samples/gdpicture/headless-modes-google-chrome.zip) and run it directly.

> On some machines, `.NET` may emit a workload verification warning during startup. If `output.pdf` is generated successfully, the sample still completed as expected.

## What this packaged.NET sample does

The packaged.NET sample loads the included `input.html` file and writes the converted result to `output.pdf`. In the packaged Docker environment, `chrome-headless-shell` is already available to the SDK.

Email conversion workflows such as MSG and EML to PDF also rely on Chrome-backed rendering in Docker.

The SDK code executed by the packaged sample is:

```csharp

using System;
using GdPicture14;

LicenseManager licence = new LicenseManager();
licence.RegisterKEY("");

using GdPictureDocumentConverter converter = new GdPictureDocumentConverter();

GdPictureStatus status = converter.LoadFromFile("input.html");
if (status!= GdPictureStatus.OK)
{
    throw new Exception($"Load failed: {status}");
}

status = converter.SaveAsPDF("output.pdf");
if (status!= GdPictureStatus.OK)
{
    throw new Exception($"Save failed: {status}");
}

```

## Related guides

- [HTML to PDF](https://www.nutrient.io/guides/dotnet/conversion/html-to-pdf.md)

- [HTML to PDF logging diagnostics](https://www.nutrient.io/guides/dotnet/conversion/html-to-pdf-logging-diagnostics.md)

- [HTML to PDF file logging diagnostics](https://www.nutrient.io/guides/dotnet/conversion/html-to-pdf-file-logging-diagnostics.md)

- [Handling errors with.NET SDK](https://www.nutrient.io/guides/dotnet/troubleshoot.md)
---

## Related pages

- [Deploy an application in C# .NET](/guides/dotnet/deployment.md)

