OpexPDF.Extensions.DependencyInjection 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OpexPDF.Extensions.DependencyInjection --version 2.0.0
                    
NuGet\Install-Package OpexPDF.Extensions.DependencyInjection -Version 2.0.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="OpexPDF.Extensions.DependencyInjection" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpexPDF.Extensions.DependencyInjection" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OpexPDF.Extensions.DependencyInjection" />
                    
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 OpexPDF.Extensions.DependencyInjection --version 2.0.0
                    
#r "nuget: OpexPDF.Extensions.DependencyInjection, 2.0.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.
#:package OpexPDF.Extensions.DependencyInjection@2.0.0
                    
#: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=OpexPDF.Extensions.DependencyInjection&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OpexPDF.Extensions.DependencyInjection&version=2.0.0
                    
Install as a Cake Tool

OpexPDF

This package allows you to easily use OpexPDF's HTML to PDF api in your application. With just one call to the api, you can transform the HTML code you supply to a PDF document.

Documentation & support

The full API reference documentation can be found here. If you encounter any issues while using this library or have any feature requests, feel free to contact us at support@opexpdf.com.

Getting started

  1. Register an account at OpexPDF (free plans available), and create an API key to use in your application.

  2. Install the standard Nuget package into your application.

    Package Manager : Install-Package OpexPDF -Version 2.0.0
    CLI : dotnet add package --version 2.0.0 OpexPDF
    
  3. In your code, create a client.

    var client = new OpexPdfClient("PDF-00000000-0000-0000-0000-000000000000");
    
  4. Call the api and save the results to a file.

    // prepare the request
    var conversionRequest = new HtmlConversionRequest() {
        BodyHtmlContent = "<h1>Hello world!</h1>",
        Options = new ConvertOptions() {
            MarginTop = 0,
            MarginBottom = 0,
            MarginLeft = 0,
            MarginRight = 0
        }
    };
    
    // convert the html to a pdf document, and save the document to a file
    using (var result = await client.ConvertHtmlAsync(conversionRequest)) 
    using (var fileStream = File.Create(@"output.pdf")) {
        result.Stream.CopyTo(fileStream);
    }
    

Dependency Injection support for .NET Core

To add support for Dependency Injection in .NET Core applications, please install the OpexPDF.Extensions.DependencyInjection package, and add the following in the ConfigureServices method of Startup.cs:

using OpexPDF;
services.AddOpexPdf(options => {
    options.ApiKey = "PDF-00000000-0000-0000-0000-000000000000";
});

After that, you can inject an OpexPdfClient instance in your constructors in the usual way.

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.
  • .NETStandard 2.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
2.1.1 1,513 12/7/2022
2.1.0 362 12/6/2022
2.0.0 536 11/27/2020