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" />
paket add PdfTurtleClientDotnet --version 2023.6.13.1446
#r "nuget: PdfTurtleClientDotnet, 2023.6.13.1446"
// Install PdfTurtleClientDotnet as a Cake Addin
#addin nuget:?package=PdfTurtleClientDotnet&version=2023.6.13.1446
// Install PdfTurtleClientDotnet as a Cake Tool
#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. |
.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 | 4,151 | 6/13/2023 |
2023.1.25.2030 | 756 | 1/25/2023 |
2023.1.25.2019 | 251 | 1/25/2023 |
2023.1.23.956 | 295 | 1/23/2023 |
2023.1.23.930 | 271 | 1/23/2023 |
2023.1.23.912 | 258 | 1/23/2023 |
2023.1.19.1115 | 290 | 1/19/2023 |
2023.1.19.936 | 276 | 1/19/2023 |
2023.1.19.844 | 264 | 1/19/2023 |
2023.1.19.805 | 259 | 1/19/2023 |
2023.1.18.1947 | 246 | 1/18/2023 |
2022.10.4.2112 | 391 | 10/4/2022 |
2022.10.4.1640 | 388 | 10/4/2022 |
2022.10.4.1619 | 356 | 10/4/2022 |
2022.10.2.1527 | 379 | 10/2/2022 |
2022.10.2.1517 | 354 | 10/2/2022 |
2022.9.29.1629 | 368 | 9/29/2022 |
2022.9.27.1644 | 412 | 9/27/2022 |
2022.9.26.1925 | 392 | 9/26/2022 |
2022.9.26.1912 | 385 | 9/26/2022 |
2022.9.26.1904 | 396 | 9/26/2022 |
2022.9.13.1618 | 381 | 9/13/2022 |
2022.9.3.1306 | 402 | 9/3/2022 |
2022.9.3.1305 | 382 | 9/3/2022 |
2022.9.3.1255 | 384 | 9/3/2022 |
2022.8.28.1952 | 389 | 8/28/2022 |
2022.8.27.1214 | 393 | 8/27/2022 |
0.1.0 | 416 | 8/25/2022 |