PeachPDF
PeachPDF.PeachPdfCssContent
PeachPdfCssContent.AddStyleSheet Method
| Overloads | |
|---|---|
| AddStyleSheet(string) | Parses an additional stylesheet and merges its rules into this content’s underlying style data. Sheets added later take precedence over earlier ones and over the base sheet this content was created from (matching the CSS cascade’s source order), so this can be called repeatedly to layer multiple user stylesheets on top of one another. |
| AddStyleSheet(ReadOnlyMemory<char>) | Genuinely zero-copy counterpart of AddStyleSheet(string) - see the stylesheet parser’s own remarks for why System.ReadOnlyMemory<>, not System.ReadOnlySpan<> (a ref struct that cannot cross this method’s own await), is what makes this possible. |
PeachPdfCssContent.AddStyleSheet(string) Method
Parses an additional stylesheet and merges its rules into this content’s underlying style data. Sheets added later take precedence over earlier ones and over the base sheet this content was created from (matching the CSS cascade’s source order), so this can be called repeatedly to layer multiple user stylesheets on top of one another.
public System.Threading.Tasks.Task AddStyleSheet(string stylesheet);
Parameters
stylesheet System.String
the stylesheet source to parse and add
Returns
Remarks
@import rules inside stylesheet are not resolved (there is no
document context here), the same limitation as ParseStyleSheet(string, bool).
PeachPdfCssContent.AddStyleSheet(ReadOnlyMemory<char>) Method
Genuinely zero-copy counterpart of AddStyleSheet(string) - see the stylesheet parser’s own remarks for why System.ReadOnlyMemory<>, not System.ReadOnlySpan<> (a ref struct that cannot cross this method’s own await), is what makes this possible.
public System.Threading.Tasks.Task AddStyleSheet(System.ReadOnlyMemory<char> stylesheet);
Parameters
stylesheet System.ReadOnlyMemory<System.Char>
the stylesheet source to parse and add