FossPDF 2024.5.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FossPDF --version 2024.5.2                
NuGet\Install-Package FossPDF -Version 2024.5.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FossPDF" Version="2024.5.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FossPDF --version 2024.5.2                
#r "nuget: FossPDF, 2024.5.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FossPDF as a Cake Addin
#addin nuget:?package=FossPDF&version=2024.5.2

// Install FossPDF as a Cake Tool
#tool nuget:?package=FossPDF&version=2024.5.2                

FossPDF is a modern open-source .NET library for PDF document generation - it's a fork of QuestPDF at the latest commit that still used a FOSS (Free, Open-Source Software license).

👨‍💻 Design PDF documents using C# and employ a code-only approach. Utilize your version control system to its fullest potential.

🧱 Compose PDF document with a range of powerful and predictable structural elements, such as text, image, border, table, and many more.

⚙️ Utilize a comprehensive layout engine, specifically designed for PDF document generation and paging support.

📖 Write code using concise and easy-to-understand C# Fluent API. Utilize IntelliSense to quickly discover available options.

🔗 Don't be limited to any proprietary scripting language or format. Follow your experience and leverage all modern C# features.

⌛ Save time thanks to a hot-reload capability, allowing real-time PDF document preview without code recompilation.

Simplicity is the key

How easy it is to start and prototype with FossPDF? Really easy thanks to its minimal API! Please analyse the code below that generates basic PDF document:

using FossPDF.Fluent;
using FossPDF.Helpers;
using FossPDF.Infrastructure;

// code in your main method
Document.Create(container =>
{
    container.Page(page =>
    {
        page.Size(PageSizes.A4);
        page.Margin(2, Unit.Centimetre);
        page.Background(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");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2024.5.4 288 7/23/2024
2024.5.3 138 7/16/2024
2024.5.2 121 7/15/2024
2024.5.1 231 5/15/2024
2022.12.10 266 12/2/2023
2022.12.5 236 5/28/2023

Version 2024.5.1:

- Fixed: Use font metrics to ensure that characters line up along the left hand side boundary when stacked vertically
- Improvement: add callback mechanism to allow for font-subsetting

Version 2022.12.0:
Feature: implemented LetterSpacing property for the Text element
Improvement: the Text element API accepts now only string values, objects are not automatically converted anymore
Fix: the Alignment element incorrectly limits size of its child when only one axis is set (horizontal or vertical)
Maintenance: Updated SkiaSharp dependency to 2.88.3

This release was possible thanks to enormous help of AntonyCorbett, thank you!

Version 2022.12.1:
Fixed: loading fonts from embedded resource via the FontManager.RegisterFontFromEmbeddedResource method
Fixed: better layout calculation stability for the Column element
Improvement: exposed missing API method for the Dynamic component, enabling applying more advanced optimizations
Improvement: better API documentation for the Settings.DocumentLayoutExceptionThreshold property

Version 2022.12.2:
Performance improvements in various areas
Text rendering stability improvements
Fixed: the Settings.CheckIfAllTextGlyphsAreAvailable setting does not work correctly

Version 2022.12.3:
Fix: inconsistent text height when using multiple lines with different TextStyles
Improvement: added validation for color arguments
Fix: the inlined element is shown only once in the header but should be repeated on each page

Version 2022.12.4:
Fix: the TextStyle.Fallback property incorrectly inherits parent's and global properties
Improvement: updated the CreateNotMatchingFontException message to mention that the glyph checking operation can be disabled with the Settings.CheckIfAllTextGlyphsAreAvailable setting

Version 2022.12.6:
Fix: fixed the rendering order of table cells in certain scenarios

Version 2022.12.7:
- Text rendering enhancement: a fake underline is drawn when the font typeface lacks an underline effect configuration or it is unavailable on runtime operating system
- Text rendering enhancement: a fake strikethrough is drawn when the font typeface lacks a strikethrough effect configuration or it is unavailable on runtime operating system
- Text rendering enhancement: a fake skew operation is applied to mimic an italic effect when the provided font lacks an italic variant
- Text rendering enhancement: a fake bold effect is applied when the font doesn't offer variants of higher weight

Version 2022.12.8:
- Updated SkiaSharp dependency from 2.88.3 to 2.88.6
- Updated QuestPDF Previewer dependencies: from Avalonia 0.10.X to 11.0.X

Version 2022.12.9:
- Enhanced developer experience by refining the accuracy of the exception message thrown when native SkiaSharp dependencies are unavailable in the runtime environment.

Version 2023.12.10
- Enhanced SkiaSharp native dependency detection for increased compatibility.
- Fixed rare instances of text rendering inaccurately due to cache-related faults.
- Fixed a rare problem where the Row element does not always respect layout issues in its children.