OpexPDF 2.0.0
See the version list below for details.
dotnet add package OpexPDF --version 2.0.0
NuGet\Install-Package OpexPDF -Version 2.0.0
<PackageReference Include="OpexPDF" Version="2.0.0" />
paket add OpexPDF --version 2.0.0
#r "nuget: OpexPDF, 2.0.0"
// 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
Register an account at OpexPDF (free plans available), and create an API key to use in your application.
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
In your code, create a client.
var client = new OpexPdfClient("PDF-00000000-0000-0000-0000-000000000000");
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 | 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.Http (>= 3.1.9)
- Newtonsoft.Json (>= 12.0.3)
- System.ComponentModel.Annotations (>= 4.7.0)
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.