OpexPDF 2.0.0

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

// Install OpexPDF as a Cake Tool
#tool nuget:?package=OpexPDF&version=2.0.0

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. 
.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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on OpexPDF:

Package Downloads
OpexPDF.Extensions.DependencyInjection

.NET Core dependency injection extensions for OpexPDF

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.1 1,051 12/7/2022
2.1.0 354 12/6/2022
2.0.0 530 11/27/2020