HtmlToPdfMaker 2.0.4

dotnet add package HtmlToPdfMaker --version 2.0.4                
NuGet\Install-Package HtmlToPdfMaker -Version 2.0.4                
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="HtmlToPdfMaker" Version="2.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HtmlToPdfMaker --version 2.0.4                
#r "nuget: HtmlToPdfMaker, 2.0.4"                
#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 HtmlToPdfMaker as a Cake Addin
#addin nuget:?package=HtmlToPdfMaker&version=2.0.4

// Install HtmlToPdfMaker as a Cake Tool
#tool nuget:?package=HtmlToPdfMaker&version=2.0.4                

<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&lt;ContentSet&gt; contentSets = [];
     contentSets.Add(SetContents("&lt;body&gt;&lt;h3&gt;Спокойной ночи&lt;/h3&gt;&lt;p&gt;शुभ रात्रि&lt;/p&gt;&lt;p&gt;Português para principiantes&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;আমি &lt;/p&gt;&lt;/body&gt;", "&lt;body&gt;&lt;div&gt;&lt;b&gt;Спокойной ночи&lt;/b&gt;&lt;/div&gt;&lt;/body&gt;", "Test Page"));
     contentSets.Add(SetContents("&lt;body&gt;&lt;div&gt;&lt;h1&gt;Palash J Karmaker&lt;/h1&gt;&lt;/div&gt;&lt;/body&gt;", "&lt;body&gt;&lt;h3&gt;&lt;u&gt;Header1&lt;/u&gt;&lt;/h3&gt;", "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 &gt; 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&lt;ContentSet&gt; contentSets = [];
     contentSets.Add(SetContents("&lt;body&gt;&lt;h3&gt;Спокойной ночи&lt;/h3&gt;&lt;p&gt;शुभ रात्रि&lt;/p&gt;&lt;p&gt;Português para principiantes&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;আমি &lt;/p&gt;&lt;/body&gt;", "&lt;body&gt;&lt;div&gt;&lt;b&gt;Спокойной ночи&lt;/b&gt;&lt;/div&gt;&lt;/body&gt;", "Test Page"));
     contentSets.Add(SetContents("&lt;body&gt;&lt;div&gt;&lt;h1&gt;Palash J Karmaker&lt;/h1&gt;&lt;/div&gt;&lt;/body&gt;", "&lt;body&gt;&lt;h3&gt;&lt;u&gt;Header1&lt;/u&gt;&lt;/h3&gt;", "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 &gt; 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-handler'></a>

handler constants

Summary

The http client handler

<a name='F-HtmlToPdfMaker-Convert-tempFolder'></a>

tempFolder constants

Summary

The tempFolder

<a name='M-HtmlToPdfMaker-Convert-GeneratePdf-System-Collections-Generic-IEnumerable{DinkToPdf-ObjectSettings}-'></a>

GeneratePdf(objSettings) method

Summary

Generates the PDF.

Returns
Parameters
Name Type Description
objSettings System.Collections.Generic.IEnumerable{DinkToPdf.ObjectSettings} The object settings.

<a name='M-HtmlToPdfMaker-Convert-HttpImagePattern'></a>

HttpImagePattern() method

Parameters

This method has no parameters.

Remarks

Pattern:

http(s)?:\\/\\/[\\w\\.\\/\\:\\-]+\\.(?&lt;ext&gt;(png)|(webp))

Options:

RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture

Explanation:

○ Match a character in the set [Hh].

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

<a name='T-System-Text-RegularExpressions-Generated-HttpImagePattern_0'></a>

HttpImagePattern_0 type

Namespace

System.Text.RegularExpressions.Generated

Summary

Custom Regex-derived type for the HttpImagePattern method.

<a name='M-System-Text-RegularExpressions-Generated-HttpImagePattern_0-#ctor'></a>

#ctor() constructor

Summary

Initializes the instance.

Parameters

This constructor has no parameters.

<a name='F-System-Text-RegularExpressions-Generated-HttpImagePattern_0-Instance'></a>

Instance constants

Summary

Cached, thread-safe singleton instance.

<a name='T-System-Text-RegularExpressions-Generated-HttpImagePattern_0-RunnerFactory-Runner'></a>

Runner type

Namespace

System.Text.RegularExpressions.Generated.HttpImagePattern_0.RunnerFactory

Summary

Provides the runner that contains the custom logic implementing the specified regular expression.

<a name='M-System-Text-RegularExpressions-Generated-HttpImagePattern_0-RunnerFactory-Runner-Scan-System-ReadOnlySpan{System-Char}-'></a>

Scan(inputSpan) method

Summary

Scan the inputSpan starting from base.runtextstart for the next match.

Parameters
Name Type Description
inputSpan System.ReadOnlySpan{System.Char} The text being scanned by the regular expression.

<a name='M-System-Text-RegularExpressions-Generated-HttpImagePattern_0-RunnerFactory-Runner-TryFindNextPossibleStartingPosition-System-ReadOnlySpan{System-Char}-'></a>

TryFindNextPossibleStartingPosition(inputSpan) method

Summary

Search inputSpan starting from base.runtextpos for the next location a match could possibly start.

Returns

true if a possible match was found; false if no more matches are possible.

Parameters
Name Type Description
inputSpan System.ReadOnlySpan{System.Char} The text being scanned by the regular expression.

<a name='M-System-Text-RegularExpressions-Generated-HttpImagePattern_0-RunnerFactory-Runner-TryMatchAtCurrentPosition-System-ReadOnlySpan{System-Char}-'></a>

TryMatchAtCurrentPosition(inputSpan) method

Summary

Determine whether inputSpan at base.runtextpos is a match for the regular expression.

Returns

true if the regular expression matches at the current position; otherwise, false.

Parameters
Name Type Description
inputSpan System.ReadOnlySpan{System.Char} The text being scanned by the regular expression.

<a name='T-System-Text-RegularExpressions-Generated-HttpImagePattern_0-RunnerFactory'></a>

RunnerFactory type

Namespace

System.Text.RegularExpressions.Generated.HttpImagePattern_0

Summary

Provides a factory for creating RegexRunner instances to be used by methods on Regex.

<a name='M-System-Text-RegularExpressions-Generated-HttpImagePattern_0-RunnerFactory-CreateInstance'></a>

CreateInstance() method

Summary

Creates an instance of a RegexRunner used by methods on Regex.

Parameters

This method has no parameters.

<a name='T-System-Text-RegularExpressions-Generated-Utilities'></a>

Utilities type

Namespace

System.Text.RegularExpressions.Generated

Summary

Helper methods used by generated Regex-derived implementations.

<a name='F-System-Text-RegularExpressions-Generated-Utilities-s_defaultTimeout'></a>

s_defaultTimeout constants

Summary

Default timeout value set in AppContext, or InfiniteMatchTimeout if none was set.

<a name='F-System-Text-RegularExpressions-Generated-Utilities-s_hasTimeout'></a>

s_hasTimeout constants

Summary

Whether s_defaultTimeout is non-infinite.

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.

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.0.4 84 8/6/2024
2.0.3 74 8/5/2024
2.0.2 75 8/4/2024
2.0.1 65 8/2/2024
2.0.0 109 7/4/2024
1.0.0 94 7/3/2024