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                
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="Fhi.PdfSkriver.Contract" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Fhi.PdfSkriver.Contract --version 1.1.0                
#r "nuget: Fhi.PdfSkriver.Contract, 1.1.0"                
#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 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.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
1.1.0 66 11/15/2024
1.0.3 336 6/26/2024
1.0.2 102 6/26/2024
1.0.1 65 6/25/2024
1.0.0 93 6/25/2024