Skip to content
 
 

Latest commit

 

History

682 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

ShinyPDF

ShinyPDF is a modern open-source .NET library for PDF document generation. Offering comprehensive layout engine powered by concise and discoverable C# Fluent API. Shiny PDF is based on the latest fully open source version of QuestPDF.

👨‍💻 Build production-ready PDFs in pure C# with a code-first workflow that fits naturally into your existing development process.
🧱 Compose rich layouts with predictable building blocks: text, images, borders, tables, layers, headers, footers, and more.
⚙️ Rely on a layout engine purpose-built for document generation, with robust paging, measurement, and rendering behavior.
📖 Stay productive with a concise Fluent API and full IntelliSense discoverability across the entire document DSL.
🔗 No proprietary template language. Use modern .NET features, reusable abstractions, and the tools you already trust.

Let's get started

Begin exploring the ShinyPDF library today.

Install the NuGet package:

dotnet add package ShinyPDF

On Linux, also add the native assets for SkiaSharp and HarfBuzzSharp:

dotnet add package SkiaSharp.NativeAssets.Linux
dotnet add package HarfBuzzSharp.NativeAssets.Linux

Then describe your document with the Fluent API and generate the PDF:

using ShinyPDF.Fluent;
using ShinyPDF.Helpers;
using ShinyPDF.Infrastructure;

Document.Create(container =>
{
    container.Page(page =>
    {
        page.Size(PageSizes.A4);
        page.Margin(2, Unit.Centimetre);
        page.PageColor(Colors.White);
        page.DefaultTextStyle(x => x.FontSize(20));

        page.Header()
            .Text("Hello PDF!")
            .SemiBold().FontSize(36).FontColor(Colors.Blue.Medium);

        page.Content()
            .PaddingVertical(1, Unit.Centimetre)
            .Column(x =>
            {
                x.Spacing(20);

                x.Item().Text(Placeholders.LoremIpsum());
                x.Item().Image(Placeholders.Image(200, 100));
            });

        page.Footer()
            .AlignCenter()
            .Text(x =>
            {
                x.Span("Page ");
                x.CurrentPageNumber();
            });
    });
})
.GeneratePdf("hello.pdf");

The result:

Generated PDF page with a blue 'Hello PDF!' heading, a paragraph of placeholder text, a gradient placeholder image and a 'Page 1' footer

Placeholders generates sample text and images, which is handy while designing a layout. More examples are in src/ShinyPDF.Examples.

About

ShinyPDF is a fully open‑source .NET library for generating and editing PDF documents using a modern and intuitive C# Fluent API.

Topics

Resources

Code of conduct

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages