PdfTurtleClientDotnet 2023.6.13.1446
dotnet add package PdfTurtleClientDotnet --version 2023.6.13.1446
NuGet\Install-Package PdfTurtleClientDotnet -Version 2023.6.13.1446
<PackageReference Include="PdfTurtleClientDotnet" Version="2023.6.13.1446" />
<PackageVersion Include="PdfTurtleClientDotnet" Version="2023.6.13.1446" />
<PackageReference Include="PdfTurtleClientDotnet" />
paket add PdfTurtleClientDotnet --version 2023.6.13.1446
#r "nuget: PdfTurtleClientDotnet, 2023.6.13.1446"
#addin nuget:?package=PdfTurtleClientDotnet&version=2023.6.13.1446
#tool nuget:?package=PdfTurtleClientDotnet&version=2023.6.13.1446
PdfTurtle Client .NET
.NET Standard 2.0 library to use the PdfTurtle service
HINT: This lib is in the beta.
How to use - Recommended way for ASP.NET Core and bundles
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 | Versions 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. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0.0)
- System.Text.Json (>= 6.0.5)
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,236 | 6/13/2023 |
2023.1.25.2030 | 818 | 1/25/2023 |
2023.1.25.2019 | 311 | 1/25/2023 |
2023.1.23.956 | 356 | 1/23/2023 |
2023.1.23.930 | 333 | 1/23/2023 |
2023.1.23.912 | 305 | 1/23/2023 |
2023.1.19.1115 | 350 | 1/19/2023 |
2023.1.19.936 | 335 | 1/19/2023 |
2023.1.19.844 | 321 | 1/19/2023 |
2023.1.19.805 | 320 | 1/19/2023 |
2023.1.18.1947 | 291 | 1/18/2023 |
2022.10.4.2112 | 456 | 10/4/2022 |
2022.10.4.1640 | 439 | 10/4/2022 |
2022.10.4.1619 | 422 | 10/4/2022 |
2022.10.2.1527 | 443 | 10/2/2022 |
2022.10.2.1517 | 420 | 10/2/2022 |
2022.9.29.1629 | 439 | 9/29/2022 |
2022.9.27.1644 | 479 | 9/27/2022 |
2022.9.26.1925 | 460 | 9/26/2022 |
2022.9.26.1912 | 449 | 9/26/2022 |
2022.9.26.1904 | 448 | 9/26/2022 |
2022.9.13.1618 | 447 | 9/13/2022 |
2022.9.3.1306 | 454 | 9/3/2022 |
2022.9.3.1305 | 447 | 9/3/2022 |
2022.9.3.1255 | 447 | 9/3/2022 |
2022.8.28.1952 | 454 | 8/28/2022 |
2022.8.27.1214 | 445 | 8/27/2022 |
0.1.0 | 487 | 8/25/2022 |