Weasyprint.Wrapped 3.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Weasyprint.Wrapped --version 3.0.1
NuGet\Install-Package Weasyprint.Wrapped -Version 3.0.1
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="Weasyprint.Wrapped" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Weasyprint.Wrapped --version 3.0.1
#r "nuget: Weasyprint.Wrapped, 3.0.1"
#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 Weasyprint.Wrapped as a Cake Addin
#addin nuget:?package=Weasyprint.Wrapped&version=3.0.1

// Install Weasyprint.Wrapped as a Cake Tool
#tool nuget:?package=Weasyprint.Wrapped&version=3.0.1

build-test-code-scan

Introduction

Wrapper around the weasyprint library which allows you to print html to a pdf file. This package does not require any external software or packages to be installed in order to use weasyprint.

Getting started

Installation

NuGet Badge

dotnet add package Weasyprint.Wrapped

Usage

You might want to provide the printer class using your DI Container.

  1. Initialize
    This will unzip the needed asset, it is best done during startup procedure. The printer will check if the asset is already unzipped, so the process is only done once (or when the package is upgraded and the version changed).
await new Printer().Initialize();
  1. Print
await new Printer().Print("<html><body><h1>TEST</h1></body></html>");

Warning

This is a large package, try to limit the projects where it will be installed.

  • +-104 MB zipped resource (standalone python, gtk3 for windows and weasyprint) which will be unzipped on initialization in the same folder (for windows).
  • +-89.7 MB zipped resource (standalone python and weasyprint) which will be unzipped on initialization in the same folder (for linux).

Extra resources

Thanks to all these great repos and the guys maintaining them!!!

Contribute

Create test package and run example

Windows:

.\build-on-windows.ps1

Linux:

.\build-on-linux.ps1

Create package:

cd .\src\Weasyprint.Wrapped\
dotnet pack -p:PackageVersion=0.0.[[NUMBER HERE]] --output nupkgs

Update the example project package version (Weasyprint.Wrapped.Example.csproj) and run the example to test it

Building assets

Windows (build-on-windows.ps1 does approximately this)

$Env:PATH += ";C:\weasyprint.wrapped\standalone-win-64\gtk3\bin"
  • Install weasyprint in the standalone python
cd c:\weasyprint.wrapped\standalone-win-64\python
.\python.exe -m pip install weasyprint
.\python.exe -m weasyprint --info

Linux (build-on-linux.ps1 does approximately this)

cd c:\weasyprint.wrapped\standalone-linux-64\python\bin\
python3 -m pip install weasyprint
python3 -m weasyprint --info

Help

  • Check PATH in python
.\python.exe -c "import os; print(*os.environ['PATH'].split(os.pathsep), sep='\n')"
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 was computed.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.
  • .NETStandard 2.0

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
6.0.1 5,471 3/2/2024
6.0.0 486 3/2/2024
5.0.0 16,280 1/1/2024
4.0.1 940 1/1/2024
4.0.0 33,952 6/18/2023
3.0.4 884 5/24/2023
3.0.3 635 5/24/2023
3.0.1 47,568 12/22/2022
3.0.0 9,776 10/21/2022
2.0.1 1,011 10/21/2022
2.0.0 18,031 7/8/2022
1.0.9 5,321 5/26/2022