Generate and download Word and PDF reports in ASP.NET Core
The request a web application actually gets is give me this as a Word file. Everything in memory, a file out, a preview of page one, and the four things to fix before this goes to production.
Generate Excel reports from a template in C# — and keep the workbook
Finance asked for the workbook, not a PDF of it. That means numbers in numeric cells, formulas intact and filters usable — which is a different job from rendering a table into a sheet.
Generate PowerPoint presentations from JSON in C#
The monthly review deck, the product catalogue, the partner one-pager: the layout is fixed and the content is data. The template stays a .pptx a designer owns, and your code never learns what a slide is.
Generate Word and PDF documents from LLM output in C#
A model reads a contract well and writes a finished business document badly. Split the work: the model returns data, a template produces the document. The piece that makes it hold up in production is a JSON Schema used on both sides.
Generate Word documents from templates in C#
The template stays a document your colleagues edit in Word, the data stays in your code, and one call puts them together. Here is the whole path, from a three-line text template to a PDF.
Generating documents in Docker with .NET: it is almost always the fonts
A .NET runtime image has no fonts. Nothing fails when they are missing — the document is produced, laid out with a substitute, and wrong in ways nobody sees until a reader opens it. Here is the fix and how to prove it worked.
Templates that survive incomplete data in C#
The report fills in perfectly on your machine and fails on the third customer of the night batch. A JSON Schema, AllowMissingMembers and InlineErrorMessages each answer a different version of that, and picking the wrong one hides a real problem.
A hundred personalised PDFs from one prompt: mail merge with an AI agent
Mail merge is the oldest automation in the office and still the one people do by hand. With an MCP tool that fans a template out over a JSON array, an agent writes one file per customer, names each one by a field, and lists the records that failed instead of stopping.
Let the model fill in the data, not write the document
An agent asked to write a contract invents the layout, the clauses and sometimes the numbers. Give it a template instead: it asks the template which fields it needs, fills a JSON skeleton from your notes, and the engine renders the document.
The chart comes from the template, the numbers come from the data
Asking a model to draw a table or a chart from a CSV invites invented rows and rounded numbers. Put the table and the chart in a template, hand the data file to the engine, and the agent only decides which template and which file.