QuantumFroge 1.0.0

dotnet add package QuantumFroge --version 1.0.0
                    
NuGet\Install-Package QuantumFroge -Version 1.0.0
                    
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="QuantumFroge" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="QuantumFroge" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="QuantumFroge" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add QuantumFroge --version 1.0.0
                    
#r "nuget: QuantumFroge, 1.0.0"
                    
#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.
#:package QuantumFroge@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=QuantumFroge&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=QuantumFroge&version=1.0.0
                    
Install as a Cake Tool

QuantumFroge

QuantumFrogePDF is a versatile NuGet package designed for easy generation of PDFs and XPS documents from enumerables, DataGridViews in Windows Forms, and DataGrids in WPF. It provides customization options for column settings using attributes, allowing users to get a byte array, save to a file path, and even display the generated PDF in the browser.

Installation

You can install QuantumFroge using the NuGet Package Manager:

dotnet add package QuantumFroge

Features

  • Generate PDFs from enumerables.
  • Generate PDFs from DataGridViews in Windows Forms.
  • Generate PDFs from DataGrids in WPF.
  • Generate XPS from enumerables.
  • Generate XPS from DataGridViews in Windows Forms.
  • Generate XPS from DataGrids in WPF.
  • Customize column settings using attributes.
  • Include headers and footers with flexible font families and colors in the generated PDF.
  • Get a byte array of the generated document.
  • Save the document to a specified file path.
  • Save the document to a Stream.
  • Display the generated PDF directly in the browser.

Usage

Customization Options

  • Customize the Class columns
public class AccountModel // Test class 
{
    [QuantumFrogeName(displayName: "Account number")] // To display the attribute value in the generated document.
    public int Id { get; set; }
    [QuantumFrogeName(displayName: "Account name")]
    [QuantumFrogeWidth(width: 200)] // To set the column width in the generated document.
    public string Name { get; set; } = "";
    public string Phone { get; set; } = "";
    public DateTime Birthdate { get; set; }
    [QuantumFrogeCanSum] // If the column is numeric you can set QuantumFrogeCanSum to display the summation of the column in the table footer.
    [QuantumFrogeSummationText(summationText: "Balance", reverse: true)] // You can change the summation text to any thing.
    public decimal Balance { get; set; }
    [QuantumFrogeIgnore] // To ignore the columns to be generated in the document.
    public bool Active { get; set; }
}
  • Customize Header and Footer
var accounts = InvoiceDataSource.GetAccounts();

var settings = new QuantumFrogePageSettings
{
    Background = "#739072"
};

settings.Header.Value = "Test company header";
settings.Header.Settings = new()
{
    Background = "#3A4D39",
    TextStyle = TextStyle.Default.FontColor("#ECE3CE")
                                  .FontSize(18)
};
settings.Header.Height = 50;

settings.TableHeader = new()
{
    Background = "#4F6F52",
    TextStyle = TextStyle.Default.FontColor("#ECE3CE")
                                 .FontSize(14)
};

settings.TableContent.Background = "#739072";
settings.TableContent.TextStyle = TextStyle.Default.FontColor("#ECE3CE");

settings.TableFooter.Background = "#739072";
settings.TableFooter.TextStyle = TextStyle.Default.FontColor("#ECE3CE");

settings.Footer.Value = "Test company footer";
settings.Footer.Settings = new()
{
    Background = "#3A4D39",
    TextStyle = TextStyle.Default.FontColor("#ECE3CE")
                                 .FontSize(10)
};
QuantumFrogeService.GeneratePdfAndShow<AccountModel>(accounts, settings);

Getting Byte Array

  • Getting Byte Array from Enumerables
var accounts = InvoiceDataSource.GetAccounts();
var bytes = QuantumFrogeService.GeneratePdf<AccountModel>(accounts);
  • Getting Byte Array DataGridViews (Windows Forms)
var bytes = QuantumFrogeService.GeneratePdf<AccountModel>(dataGridView1.DataSource);
  • Getting Byte Array DataGrids (WPF)
var bytes = QuantumFrogeService.GeneratePdf<AccountModel>(dataGrid.ItemsSource);

Saving to File Path

  • Saving to File Path from Enumerables
var filePath = "[YOUR PATH]";
var accounts = InvoiceDataSource.GetAccounts();
QuantumFrogeService.GeneratePdf<AccountModel>(accounts, filePath);
  • Saving to File Path DataGridViews (Windows Forms)
var filePath = "[YOUR PATH]";
QuantumFrogeService.GeneratePdf<AccountModel>(dataGridView1.DataSource, filePath);
  • Saving to File Path DataGrids (WPF)
var filePath = "[YOUR PATH]";
QuantumFrogeService.GeneratePdf<AccountModel>(dataGrid.ItemsSource, filePath);

Saving to Stream

  • Saving to Stream Path from Enumerables
var accounts = InvoiceDataSource.GetAccounts();
using var stream = new MemoryStream();
QuantumFrogeService.GeneratePdf<AccountModel>(accounts, stream);
  • Saving to Stream Path DataGridViews (Windows Forms)
using var stream = new MemoryStream();
QuantumFrogeService.GeneratePdf<AccountModel>(dataGridView1.DataSource, stream);
  • Saving to Stream Path DataGrids (WPF)
using var stream = new MemoryStream();
QuantumFrogeService.GeneratePdf<AccountModel>(dataGrid.ItemsSource, stream);

Displaying generated document

  • Displaying generated document from Enumerables
QuantumFrogeService.GeneratePdfAndShow<AccountModel>(accounts);
  • Displaying generated document DataGridViews (Windows Forms)
QuantumFrogeService.GeneratePdfAndShow<AccountModel>(dataGridView1.DataSource);
  • Displaying generated document DataGrids (WPF)
QuantumFrogeService.GeneratePdfAndShow<AccountModel>(dataGrid.ItemsSource);

License

  • This project is licensed under the MIT License.
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.

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 225 2/7/2024