zPdfGenerator.TemplatePreview 0.1.8

dotnet tool install --global zPdfGenerator.TemplatePreview --version 0.1.8
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local zPdfGenerator.TemplatePreview --version 0.1.8
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=zPdfGenerator.TemplatePreview&version=0.1.8
                    
nuke :add-package zPdfGenerator.TemplatePreview --version 0.1.8
                    

zPdfGenerator.TemplatePreview

License: MIT NuGet NuGet (pre)

zPdfGenerator.TemplatePreview is a .NET global tool that provides a fast and generic way to preview HTML templates rendered with Fluid (Liquid syntax) using sample JSON data.

It is designed to help you author, debug, and iterate on HTML templates that will later be converted to PDF (for example using zPdfGenerator), without having to write code or regenerate PDFs constantly.


Features

  • Preview any HTML template using Fluid/Liquid syntax
  • Uses a side-by-side *.sample.json file as mock data
  • Opens the rendered HTML automatically in your browser
  • --watch mode to re-render instantly on file changes
  • Distributed as a .NET global tool
  • No knowledge of placeholders required — fully generic

Installation

The tool is distributed as a NuGet .NET Tool.

Prerequisites

  • .NET 8 SDK or Runtime installed

Install globally

dotnet tool install -g zPdfGenerator.TemplatePreview

Verify installation:

zg-templates --help

Usage

Basic usage

zg-templates preview Templates/Invoice.html

Using a full path (with spaces)

zg-templates preview "Templates/My Invoice.html"
zg-templates preview Templates/Invoice.html --watch
  • Re-renders automatically when the HTML or JSON changes
  • Refresh the browser (F5) to see updates

Options

Option Description
--watch Re-render when template or JSON changes
--pdf Output a PDF instead of opening a browser
--no-open Do not open browser automatically
--help Show help

Example:

zg-templates preview Templates/Invoice.html --watch 

Template conventions

HTML template

Use Fluid / Liquid syntax:

<h1>Invoice {{ InvoiceNumber }}</h1>

{% if ShowDiscounts %}
  <div>Discounts section</div>
{% endif %}

<ul>
{% for line in Lines %}
  <li>{{ line.Description }} - {{ line.Price }}</li>
{% endfor %}
</ul>

Sample JSON

{
  "InvoiceNumber": "INV-001",
  "ShowDiscounts": true,
  "Lines": [
    { "Description": "Consulting", "Price": 500 },
    { "Description": "License", "Price": 200 }
  ]
}

Design goals

  • No strong typing
  • No predefined placeholders
  • No coupling to PDF generation
  • Works with any HTML template
  • Optimized for template authoring and previewing

This tool is part of the zGenerators ecosystem:


License

MIT License © Juanjo Jiménez Zorrilla

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.1.8 34 1/9/2026
0.1.7 205 12/19/2025
0.1.6 261 12/18/2025
0.1.5 267 12/17/2025
0.1.4 235 12/15/2025