HtmlToPdfMaker 2.0.0
See the version list below for details.
dotnet add package HtmlToPdfMaker --version 2.0.0
NuGet\Install-Package HtmlToPdfMaker -Version 2.0.0
<PackageReference Include="HtmlToPdfMaker" Version="2.0.0" />
paket add HtmlToPdfMaker --version 2.0.0
#r "nuget: HtmlToPdfMaker, 2.0.0"
// Install HtmlToPdfMaker as a Cake Addin #addin nuget:?package=HtmlToPdfMaker&version=2.0.0 // Install HtmlToPdfMaker as a Cake Tool #tool nuget:?package=HtmlToPdfMaker&version=2.0.0
<a name='assembly'></a>
HtmlToPdfMaker
Contents
<a name='T-HtmlToPdfMaker-Convert'></a>
Convert type
Namespace
HtmlToPdfMaker
Summary
Class to convert html to Pdf
Example
Usage:
[TestMethod()]
public void ToPdfTest()
{
List<ContentSet> contentSets = [];
contentSets.Add(SetContents("<body><h3>Спокойной ночи</h3><p>शुभ रात्रि</p><p>Português para principiantes</p><hr /><p>আমি </p></body>", "<body><div><b>Спокойной ночи</b></div></body>", "Test Page"));
contentSets.Add(SetContents("<body><div><h1>Palash J Karmaker</h1></div></body>", "<body><h3><u>Header1</u></h3>", "My page"));
using Convert cvt = new(contentSets);
var data = cvt.ToPdfAsync(CancellationToken.None).Result;
File.WriteAllBytes(AppDomain.CurrentDomain.BaseDirectory + "\\Pdf\\test2.pdf", data);
Assert.IsTrue(data.Length > 0);
static ContentSet SetContents(string bodyHtml, string headerHtml, string footerHtml)
{
var header = Content.CreateDefaultStyledHeader(headerHtml);
var footer = Content.CreateDefaultStyledFooter(footerHtml);
var body = Content.CreateDefaultStyledBody(bodyHtml);
return new(body, header, footer);
}
}
See Also
<a name='M-HtmlToPdfMaker-Convert-#ctor-System-Collections-Generic-IReadOnlyList{HtmlToPdfMaker-ContentSet},System-String,DinkToPdf-Orientation,DinkToPdf-PaperKind-'></a>
#ctor() constructor
Summary
Class to convert html to Pdf
Parameters
This constructor has no parameters.
Example
Usage:
[TestMethod()]
public void ToPdfTest()
{
List<ContentSet> contentSets = [];
contentSets.Add(SetContents("<body><h3>Спокойной ночи</h3><p>शुभ रात्रि</p><p>Português para principiantes</p><hr /><p>আমি </p></body>", "<body><div><b>Спокойной ночи</b></div></body>", "Test Page"));
contentSets.Add(SetContents("<body><div><h1>Palash J Karmaker</h1></div></body>", "<body><h3><u>Header1</u></h3>", "My page"));
using Convert cvt = new(contentSets);
var data = cvt.ToPdfAsync(CancellationToken.None).Result;
File.WriteAllBytes(AppDomain.CurrentDomain.BaseDirectory + "\\Pdf\\test2.pdf", data);
Assert.IsTrue(data.Length > 0);
static ContentSet SetContents(string bodyHtml, string headerHtml, string footerHtml)
{
var header = Content.CreateDefaultStyledHeader(headerHtml);
var footer = Content.CreateDefaultStyledFooter(footerHtml);
var body = Content.CreateDefaultStyledBody(bodyHtml);
return new(body, header, footer);
}
}
See Also
<a name='F-HtmlToPdfMaker-Convert-tempFolder'></a>
tempFolder constants
Summary
The tempFolder
<a name='M-HtmlToPdfMaker-Convert-GeneratePdf-System-Collections-Generic-List{DinkToPdf-ObjectSettings}-'></a>
GeneratePdf(objSettings) method
Summary
Generates the PDF.
Returns
Parameters
Name | Type | Description |
---|---|---|
objSettings | System.Collections.Generic.List{DinkToPdf.ObjectSettings} | The object settings. |
<a name='M-HtmlToPdfMaker-Convert-ReleaseResources'></a>
ReleaseResources() method
Summary
Releases the resources.
Parameters
This method has no parameters.
<a name='M-HtmlToPdfMaker-Convert-ToPdfAsync-System-Threading-CancellationToken-'></a>
ToPdfAsync(token) method
Summary
Converts to pdf.
Returns
Parameters
Name | Type | Description |
---|---|---|
token | System.Threading.CancellationToken | The token. |
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
- HtmlToPdfConverter.Core (>= 2.0.0)
- System.Net.Http (>= 4.3.4)
- Ulid (>= 1.3.3)
- Utility.Disposable (>= 1.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.