PeachPDF
PeachPDF.Layout.IContainer
IContainer.Html Method
| Overloads | |
|---|---|
| Html(byte[], PeachPdfCssContent, Action<SlotContext,IContainer>) | Places an HTML fragment loaded from raw bytes - see Html(string, PeachPdfCssContent, Action<SlotContext,IContainer>). Terminal - may be called at most once. |
| Html(string, PeachPdfCssContent, Action<SlotContext,IContainer>) | Parses html as an HTML fragment (through the same HTML parser and cascade the HTML-string rendering path uses) and splices the result into this container’s tree, in place, as one new child holding the fragment’s own top-level nodes (which may be more than one - unlike every other terminal method here, an HTML fragment can itself contain several sibling elements). Terminal - may be called at most once. stylesheet supplies the CSS the fragment’s own class/id-driven styling cascades against, layered under the fragment’s own <style> tags and the user-agent defaults every HTML element already gets; null styles the fragment with only those two. A <link rel="stylesheet"> inside the fragment is never loaded (there is no document context to resolve it through at this point in building the tree) - author it as a <style> tag, or pass it via stylesheet, instead. A float: footnote element inside the fragment renders as ordinary inline content rather than being detached into a footnote area, for the same reason. onSlot, when given, is invoked once per <slot> element the fragment contains (in document order, regardless of name, including more than one sharing a name), with a SlotContext describing it and an IContainer positioned to replace it - populate that container the same way any other container is populated (e.g. slotContainer.Text(...)) to fill the slot. Leaving it untouched (or passing no onSlot at all) keeps the slot’s own fallback content - whatever markup it contained in html - exactly as authored. |
| Html(Stream, PeachPdfCssContent, Action<SlotContext,IContainer>) | Places an HTML fragment read fully from a stream - see Html(string, PeachPdfCssContent, Action<SlotContext,IContainer>). Terminal - may be called at most once. |
IContainer.Html(byte[], PeachPdfCssContent, Action<SlotContext,IContainer>) Method
Places an HTML fragment loaded from raw bytes - see Html(string, PeachPdfCssContent, Action<SlotContext,IContainer>). Terminal - may be called at most once.
void Html(byte[] data, PeachPDF.PeachPdfCssContent? stylesheet=null, System.Action<PeachPDF.Layout.SlotContext,PeachPDF.Layout.IContainer>? onSlot=null);
Parameters
data System.Byte[]
stylesheet PeachPdfCssContent
onSlot System.Action<SlotContext,IContainer>
IContainer.Html(string, PeachPdfCssContent, Action<SlotContext,IContainer>) Method
Parses html as an HTML fragment (through the same HTML parser and cascade the HTML-string rendering path uses) and splices the result into this container’s tree, in place, as one new child holding the fragment’s own top-level nodes (which may be more than one - unlike every other terminal method here, an HTML fragment can itself contain several sibling elements). Terminal - may be called at most once.
stylesheet supplies the CSS the fragment’s own class/id-driven styling
cascades against, layered under the fragment’s own <style> tags and the user-agent
defaults every HTML element already gets; null styles the fragment with only those two. A
<link rel="stylesheet"> inside the fragment is never loaded (there is no document
context to resolve it through at this point in building the tree) - author it as a
<style> tag, or pass it via stylesheet, instead. A
float: footnote element inside the fragment renders as ordinary inline content rather than
being detached into a footnote area, for the same reason.
onSlot, when given, is invoked once per <slot> element the
fragment contains (in document order, regardless of name, including more than one sharing a
name), with a SlotContext describing it and an IContainer positioned
to replace it - populate that container the same way any other container is populated (e.g.
slotContainer.Text(...)) to fill the slot. Leaving it untouched (or passing no
onSlot at all) keeps the slot’s own fallback content - whatever markup it
contained in html - exactly as authored.
void Html(string html, PeachPDF.PeachPdfCssContent? stylesheet=null, System.Action<PeachPDF.Layout.SlotContext,PeachPDF.Layout.IContainer>? onSlot=null);
Parameters
html System.String
stylesheet PeachPdfCssContent
onSlot System.Action<SlotContext,IContainer>
IContainer.Html(Stream, PeachPdfCssContent, Action<SlotContext,IContainer>) Method
Places an HTML fragment read fully from a stream - see Html(string, PeachPdfCssContent, Action<SlotContext,IContainer>). Terminal - may be called at most once.
void Html(System.IO.Stream stream, PeachPDF.PeachPdfCssContent? stylesheet=null, System.Action<PeachPDF.Layout.SlotContext,PeachPDF.Layout.IContainer>? onSlot=null);
Parameters
stream System.IO.Stream
stylesheet PeachPdfCssContent