ZX.Folio
1.0.0
dotnet add package ZX.Folio --version 1.0.0
NuGet\Install-Package ZX.Folio -Version 1.0.0
<PackageReference Include="ZX.Folio" Version="1.0.0" />
<PackageVersion Include="ZX.Folio" Version="1.0.0" />
<PackageReference Include="ZX.Folio" />
paket add ZX.Folio --version 1.0.0
#r "nuget: ZX.Folio, 1.0.0"
#:package ZX.Folio@1.0.0
#addin nuget:?package=ZX.Folio&version=1.0.0
#tool nuget:?package=ZX.Folio&version=1.0.0
ZX.Folio
Folio's document engine for .NET, in one package: Word-like documents with real pages, templates and mail merge, tagged PDF and Word output, Word and HTML input, and an accessibility check. It runs inside your application: no service, no web API, no other packages to install.
Install
dotnet add package ZX.Folio
Merge a template and make a PDF
using Folio.Core.Fonts;
using Folio.Core.Json;
using Folio.Core.Layout;
using Folio.Fonts;
using Folio.Pdf;
using Folio.Templating;
var template = DocumentJson.Parse(File.ReadAllText("invoice.json")); // a Folio document with {{tags}}
var merged = TemplateEngine.Merge(template, File.ReadAllText("invoice-data.json")).Document;
var fonts = new FontRegistry();
FolioFonts.Register(fonts); // Liberation Sans, included
var session = new LayoutSession(fonts);
session.Load(merged);
File.WriteAllBytes("invoice.pdf", PdfRenderer.Render(session)); // a tagged PDF, pages as laid out
XML data works the same way: TemplateEngine.MergeXml(template, xml). A JSON array merges one copy per record.
Also in the package
| Build a document in code | new DocumentBuilder().Heading("…").Paragraph(p => p.Text("…").Bold("…")).Build() (Folio.Core.Api) |
| Word | DocxWriter.Write(document) and DocxReader.Read(bytes) (Folio.Docx) |
| HTML | HtmlImport.FromMarkup(html) and ClipboardHtml.Write(blocks, images) (Folio.Html); HTML from Word, Excel, Outlook and Google Docs with new HtmlImportOptions { Dialects = OfficeDialects.All } (Folio.Html.Office) |
| Accessibility | AccessibilityChecker.Check(document, new A11yOptions()) (Folio.Core.Accessibility), or new PdfOptions { RequireAccessible = true } to refuse an inaccessible PDF |
| Documents as JSON | DocumentJson.Parse(json) and DocumentJson.Serialize(document) (Folio.Core.Json) |
Fonts
Layout needs at least one font. The package carries Liberation Sans in regular, bold, italic and bold italic, with the
widths of Arial and Helvetica; it stands in for any font a document names that is not registered. For documents in
other fonts, register those too: fonts.Register(File.ReadAllBytes("MyFont.ttf")). Liberation Sans is under the SIL
Open Font License 1.1, which comes with it (fonts/liberation/LICENSE in the package).
Licence
Free to use, commercial or not, and to build into your own applications; not to be changed, or distributed on its
own. The terms are in LICENSE.txt in the package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 0 | 11/10/2026 |