PdfTurtleClientDotnet 2023.6.13.1446

dotnet add package PdfTurtleClientDotnet --version 2023.6.13.1446
                    
NuGet\Install-Package PdfTurtleClientDotnet -Version 2023.6.13.1446
                    
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="PdfTurtleClientDotnet" Version="2023.6.13.1446" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PdfTurtleClientDotnet" Version="2023.6.13.1446" />
                    
Directory.Packages.props
<PackageReference Include="PdfTurtleClientDotnet" />
                    
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 PdfTurtleClientDotnet --version 2023.6.13.1446
                    
#r "nuget: PdfTurtleClientDotnet, 2023.6.13.1446"
                    
#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 PdfTurtleClientDotnet@2023.6.13.1446
                    
#: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=PdfTurtleClientDotnet&version=2023.6.13.1446
                    
Install as a Cake Addin
#tool nuget:?package=PdfTurtleClientDotnet&version=2023.6.13.1446
                    
Install as a Cake Tool

PdfTurtle Client .NET

.NET Standard 2.0 library to use the PdfTurtle service

Nuget

HINT: This lib is in the beta.

See a working example in PdfTurtleClientDotnet.WebApiExample/Program.cs.

1. Prepare project

Get the package from nuget.

dotnet add package PdfTurtleClientDotnet
// register service
services.AddPdfTurtle("https://pdfturtle.gaitzsch.dev");
// resolve service over dependency injection
app.MapGet("/", (IPdfTurtleClient pdfTurtleClient) => { ... });

2. Design your PDF in the playground

Go to 🐢PdfTurtle-Playground, put an example model as JSON and design your PDF. Download the bundle as ZIP file and put it in your resources/assets.

3. Call the service with the client and your data

Call RenderBundleAsync to render the pdf to a Stream.

var pdfStream = await pdfTurtleClient.RenderBundleAsync(BUNDLE_AS_STREAM_OR_BYTES, MODEL_AS_OBJECT);

Done.

Hint: You can split your bundle

If you want to have the same header for all documents, you can create a ZIP file with with only the header.html file. Now you can call the Service with multiple bundle files. The service will assemble the files together.

var pdfStream = await pdfTurtleClient.RenderBundleAsync(
        new [] { BUNDLE_WITHOUT_HEADER_AS_STREAM_OR_BYTES, HEADER_BUNDLE_AS_STREAM_OR_BYTES },
        MODEL_AS_OBJECT
    );

How to use - Alternative ways

Without template (plain HTML)

If the described way does not match your expectations, you can use a template engine of your choice (for example RazorLight) and render HTML directly with PdfTurtle.

var pdfStream = await pdfTurtleClient.RenderAsync(new RenderData() {
    ...
});

With template but no bundle

If you want to render a HTML template without any images or assets, you can use the RenderTemplateAsync function.

var pdfStream = await pdfTurtleClient.RenderTemplateAsync(new RenderTemplateData() {
    ...
});

Open TODOs

  • Working examples for all methods
  • Add documentation as comments
  • Tests
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.  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. 
.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.

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
2023.6.13.1446 5,414 6/13/2023
2023.1.25.2030 840 1/25/2023
2023.1.25.2019 331 1/25/2023
2023.1.23.956 375 1/23/2023
2023.1.23.930 352 1/23/2023
2023.1.23.912 323 1/23/2023
2023.1.19.1115 369 1/19/2023
2023.1.19.936 354 1/19/2023
2023.1.19.844 340 1/19/2023
2023.1.19.805 340 1/19/2023
2023.1.18.1947 310 1/18/2023
2022.10.4.2112 475 10/4/2022
2022.10.4.1640 459 10/4/2022
2022.10.4.1619 442 10/4/2022
2022.10.2.1527 463 10/2/2022
2022.10.2.1517 440 10/2/2022
2022.9.29.1629 459 9/29/2022
2022.9.27.1644 499 9/27/2022
2022.9.26.1925 479 9/26/2022
2022.9.26.1912 468 9/26/2022
2022.9.26.1904 467 9/26/2022
2022.9.13.1618 467 9/13/2022
2022.9.3.1306 473 9/3/2022
2022.9.3.1305 468 9/3/2022
2022.9.3.1255 468 9/3/2022
2022.8.28.1952 474 8/28/2022
2022.8.27.1214 465 8/27/2022
0.1.0 507 8/25/2022