PeachPDF
PeachPDF.PdfGenerator
PdfGenerator.ParseStyleSheet Method
| Overloads | |
|---|---|
| ParseStyleSheet(string, bool) | Parses the given stylesheet into a reusable PeachPdfCssContent object. If combineWithDefault is true the parsed css blocks are added to the default css data (as defined by the CSS 2.1 default stylesheet for HTML), merged if class name already exists. If false only the data in the given stylesheet is returned. |
| ParseStyleSheet(ReadOnlyMemory<char>, bool) | Genuinely zero-copy counterpart of ParseStyleSheet(string, bool) - see the parser’s own remarks for why System.ReadOnlyMemory<>, not System.ReadOnlySpan<>, is what makes this possible. |
PdfGenerator.ParseStyleSheet(string, bool) Method
Parses the given stylesheet into a reusable PeachPdfCssContent object.
If combineWithDefault is true the parsed css blocks are added to the
default css data (as defined by the CSS 2.1 default stylesheet for HTML), merged if class name already exists. If false only the data in the given stylesheet is returned.
public System.Threading.Tasks.Task<PeachPDF.PeachPdfCssContent> ParseStyleSheet(string stylesheet, bool combineWithDefault=true);
Parameters
stylesheet System.String
the stylesheet source to parse
combineWithDefault System.Boolean
true - combine the parsed css data with default css data, false - return only the parsed css data
Returns
System.Threading.Tasks.Task<PeachPdfCssContent>
the parsed css data
PdfGenerator.ParseStyleSheet(ReadOnlyMemory<char>, bool) Method
Genuinely zero-copy counterpart of ParseStyleSheet(string, bool) - see the parser’s own remarks for why System.ReadOnlyMemory<>, not System.ReadOnlySpan<>, is what makes this possible.
public System.Threading.Tasks.Task<PeachPDF.PeachPdfCssContent> ParseStyleSheet(System.ReadOnlyMemory<char> stylesheet, bool combineWithDefault=true);
Parameters
stylesheet System.ReadOnlyMemory<System.Char>
the stylesheet source to parse
combineWithDefault System.Boolean
true - combine the parsed css data with default css data, false - return only the parsed css data
Returns
System.Threading.Tasks.Task<PeachPdfCssContent>
the parsed css data