Visual Studio 2022+
Extensions → Manage Extensions → search for “XtudioPdf” → Install, and restart Visual Studio.
Get started
You design the template visually inside Visual Studio or VS Code. When you build, it is embedded in your DLL. In production your code generates the PDF on the server, without a browser and without files to copy.
Install only one. XtudioPdf.AspNetCore already includes the engine.
| Your project | Package |
|---|---|
| Web API, Minimal API, MVC or Razor Pages (ASP.NET Core) | XtudioPdf.AspNetCore |
| Worker Service, console, desktop (WPF, WinForms, MAUI), Azure Functions or your own library | XtudioPdf.Core |
Requires .NET 8 or .NET 10. Runs on Windows, Linux, macOS and Docker. .NET Framework (4.x) is not supported.
Extensions → Manage Extensions → search for “XtudioPdf” → Install, and restart Visual Studio.
Extensions (Ctrl+Shift+X) → search for “XtudioPdf” → Install.
That's all. The first time you open a .pdfx, the extension installs the designer by itself (the xtudiopdf tool) and keeps it up to date. Without an extension, install it by hand: dotnet tool install -g XtudioPdf.Tool
Double-click a .pdfx file in your project and the designer opens as one more tab, with the live PDF preview. Save with Ctrl+S. You don't need to run your app.
Without extensions, open the designer on a template with:
With AddXtudioPdf() the designer is also available at /xtudiopdf while your app runs in Development, to design with real data. It never opens in production.
Create a new report with its DTO and template: xtudiopdf new Invoice or right-click a project folder: Add → XtudioPdf document… in Visual Studio, New XtudioPdf document… in VS Code.
Every .pdfx in the project is embedded when you build and checked against its DTO: if a field doesn't exist, the compiler warns you.
// Program.cs
builder.Services.AddPdfReports();
// Invoice.cs: your DTO and its report
[PdfDataSource]
public sealed record InvoiceDto(string Number, string Customer, decimal Total, List<LineDto> Lines);
public sealed class InvoiceReport(PdfTemplates templates) : PdfReport<InvoiceDto>(templates);
// Your endpoint returns the PDF
app.MapGet("/invoices/{id}.pdf", async (int id, InvoiceReport report, AppDb db) =>
Results.File(report.Render(await db.GetInvoiceAsync(id)), "application/pdf", $"invoice-{id}.pdf"));
Without ASP.NET Core (XtudioPdf.Core):
var templates = new PdfTemplates().AddAssembly(typeof(Program).Assembly);
byte[] pdf = templates.Render("Invoice", invoice);
What you do with the bytes is up to you: return them from your API, save them, attach them to an email or send them to the tax authority with the XML.
Community works without a key. With a Pro key, put it in appsettings.json or in the XTUDIOPDF_LICENSE_KEY environment variable. It is validated offline.
"XtudioPdf": { "LicenseKey": "XTPD.…" }