Fhi.PdfSkriver.Contract
1.1.0
dotnet add package Fhi.PdfSkriver.Contract --version 1.1.0
NuGet\Install-Package Fhi.PdfSkriver.Contract -Version 1.1.0
<PackageReference Include="Fhi.PdfSkriver.Contract" Version="1.1.0" />
paket add Fhi.PdfSkriver.Contract --version 1.1.0
#r "nuget: Fhi.PdfSkriver.Contract, 1.1.0"
// Install Fhi.PdfSkriver.Contract as a Cake Addin #addin nuget:?package=Fhi.PdfSkriver.Contract&version=1.1.0 // Install Fhi.PdfSkriver.Contract as a Cake Tool #tool nuget:?package=Fhi.PdfSkriver.Contract&version=1.1.0
Fhi.PdfSkriver.Contract
Om ønskelig kan du kan ta i bruk et forhåndsdefinert Refit-interface, IPdfSkriverClient
i Fhi.PdfSkriver.Contract
.
var client = RestService.For<IPdfSkriverClient>(new HttpClient() { BaseAddress = new Uri("https://fhi-felles-pdf.azurewebsites.net/") });
var data = new HtmlDocumentData()
{
HtmlBody = "<b>Test!</b>"
};
var response = await client.PdfFromHtml(data);
using var fs = new FileStream("out.pdf", FileMode.Create, FileAccess.Write);
await response.Content.CopyToAsync(fs);
Se https://www.nuget.org/packages/Fhi.ClientCredentials.Refit for hvordan du tar den i bruk med HelseId.
Du kan og bruke programvare som f.ex. NSwagStudio (https://github.com/RicoSuter/NSwag/wiki/NSwagStudio) til å generere modeller fra spesifikasjonene i Swagger:
Pdf From Files
When creating a PDF from multiple files you can use the helper method .AddFile of FileDocumentData. It will read the file from disk and base64 encode it:
var data = new FileDocumentData()
{
EntryFile = "index.html"
};
data.Addfile("myfiles/index.html");
data.Addfile("myfiles/style.css");
data.Addfile("myfiles/mylogo.png");
(!) Note that the path "myfiles" will be stripped from the filename when it is added!
Product | Versions 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. |
-
net8.0
- Refit (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.