Recursive AI

Architecture

All onepdf-html docs

How the converter is put together and where each kind of work belongs. HTML to PDF lives in OnePdf.Html.Render, a separate package; everything below is PDF to HTML.

Flow

PDF -> PdfHtmlConverter -> per page: PageAnalyzer -> PdfHtmlPageAnalysis -> emitter -> PdfHtmlPage -> IPdfHtmlSink
       (open, options,      size, text layer,       (shared by both        Semantic or   fragment,      single file,
        page selection)     text source, links      emitters)              FixedLayout   assets,        file per page,
                            after safety rules                                           diagnostics    or your own

ConvertTo converts a window of pages in parallel and hands them to the sink in page order, so memory depends on the degree of parallelism, not the page count. Output does not depend on the degree.

A picture written inline (a data: URI) is not turned into text while its page is built: AssetStore puts a placeholder (a random per-conversion nonce and the picture's number) in the markup and keeps the bytes, PdfHtmlPage keeps the markup and the bytes together, and the file and stream sinks write the page with WriteHtml, which streams each picture as base64 in small pieces. PdfHtmlPage.Html makes the whole text on demand for sinks that want a string. ImageBudget bounds the pixels of pictures decoded and re-encoded at once across the pages converting in parallel, and RasterBudget decides from the page's strokes whether drawing the page picture is affordable (see docs/diagnostics.md, raster-failed).

Where things go (src/OnePdf.Html)

FolderHoldsWork that belongs here
rootPdfHtml (happy path), PdfHtmlConverter (per page, streaming), options, diagnostics, page rangesAPI shape, coordination of pages, limits
Analysis/PageAnalyzer, Tables/ (TableDetector, PdfHtmlTable), PdfHtmlPageAnalysis, DocumentContext, PageGeometry, PageRasterizerEverything computed once per page and shared by both emitters: text, links, the display list (built on first use), page geometry, outline lookups. New facts about a page (figures, footnotes, images from the display list) are added to the analysis, not to an emitter
Text/IPdfHtmlTextSource, the page-text model (PdfHtmlPageText and below), the text-layer sourceThe text seam. A source returns blocks, lines and words with geometry; both emitters read only this model, so extracted and recognised text behave alike
Semantic/SemanticEmitterReflowing output: structure (headings, paragraphs, lists, tables, figures, footnotes, headers and footers), de-hyphenation and line joins, accessible markup
Fixed/FixedLayoutEmitterFixed-layout output: positioned text and fonts, vector graphics as SVG, images, raster fallback per element or page
Output/IPdfHtmlSink and its implementations, AssetStore, DocumentShellBuilderWhere bytes go: single file, page files, asset files or data URIs, the document head and metadata
Html/HtmlBuilder, LinkPolicy, CssFormatBuilding markup through OneHtml and the output safety rules

An emitter implements PageEmitter.Emit(EmitContext): it reads the analysis, builds one page element with the HtmlBuilder, puts images through context.Assets and reports with context.Report. Emitters hold no per-page state, because one instance serves every thread. SemanticEmitter and FixedLayoutEmitter share nothing but the analysis, so they can be worked on independently.

OnePdf.Html.Ocr implements IPdfHtmlTextSource (see below). OnePdf.Html.Tool is the onepdf-html command; its IConversionCommand list (Cli.cs) is where each direction plugs in.

OCR (src/OnePdf.Html.Ocr)

OcrTextSource decides per page whether the PDF's own text is used. The rules are in core (PdfHtmlTextSources.Assess, Text/PdfHtmlTextLayerAssessment.cs), need no model and look at the page's text first:

  • No text and a picture with ink on it (page resources hold an image of at least 64 by 64 samples, so colour swatches and bullets do not make a scan, a 72 dpi drawing of the page has at least 0.2 % ink): a scan.
  • Garbled: over 20 % of the characters are replacement, private-use or control characters (or over 20 % of the glyphs have no Unicode value); UTF-8 read as a single-byte encoding; words that are not words: 40 % of the letters in words of 25 letters or more, more than half of the words with digits among capitals while the page has almost no lowercase, a page whose distinct words have letter proportions no language has (vowels outside 24 to 68 %, more than 15 % of words with no vowel; words in capitals only are left out so code tables pass, unless the page has no lowercase at all).
  • Misplaced: a layer of invisible text over a picture where fewer than half of up to 200 sampled words lie on ink.
  • Everything else is used as it is. A page with no text and no picture, or with a picture and no ink, is left alone.

A page that needs it is drawn at 300 dpi (lowered to fit MaxPixels, 40 million by default) through the request's RenderPage, read by OneOcr, and its page model (pixels, y down) is mapped to points, y up: words with boxes, lines with direction, blocks with header/footer role and Kind (title, list, text, form field) from the recognizer's regions, and tables with row/column spans as PdfHtmlPageText.Tables. Font sizes come from the line's ink height (measured: 0.855 of the em). The engine loads once per source and is shared by all pages; at most MaxConcurrentPages (2) pages are recognised at once. The text does not depend on the degree of parallelism. The recognizer reads Latin, Greek and Cyrillic; Languages naming only other scripts leaves pages alone with a warning.

Semantic output (Semantic/)

The reflowing mode builds a small model per page (SPage of SNodes and styled SRuns) and renders it afterwards, so what a page break cuts can be joined first.

  • Two phases. PageEmitter.Prepare builds a page's model (pages of a window in parallel), Join moves what continues from the next page into the page before (a paragraph, a list, a table, a note; one that ends a page and goes on at the top of the next is written once), Render writes the DOM. A page whose content all moved up is empty, and the next page joins the last page that still has content. Output is the same at any degree of parallelism.

  • Tagged pages (TaggedBuilder): when any of a page's marked content is in the structure tree, the tree decides each block it covers (and the page is mixed, below): headings, paragraphs, lists (Lbl dropped, LBody kept), tables (THead/TBody/TFoot, TH scope, spans), figures with alt text, captions (next to a figure they go in its figcaption), notes (Note and FENote), formulas, quotes, code, links, Span language and ActualText; /RoleMap is followed and artifacts are dropped. Small pictures (under about two lines tall) inside a text element, or loose in a section, are inline img runs of that line (SRun.Inline); a figure drawn with paths has no image object, so its area is cut from the page picture drawn once at the raster resolution and written as the figure's image (text inside the area is part of the picture). A figure has no text of its own, so it is placed in reading order after the last text block above it that shares some of its width.

  • Artifacts are not leftovers. Words drawn inside /Artifact marked content (PageObjects.IsArtifactWord, matched by glyph origin) are page furniture the producer declared, so they never count as text the tree left out. Before this, running heads and page numbers re-emerged as paragraphs on partly tagged pages.

  • Repeated table headers. A table that goes on over a page break and repeats its header (PageJoiner): header rows that arrive as the continuing table's own thead are dropped when their text equals the first part's header, and header cells that arrive as plain blocks (each cell, or the whole row, before the table or right after it in reading order) are dropped when together they spell exactly the first part's header cells and a table follows. Then the two tables join as usual. A repeated header that differs at all is kept.

  • Joins past notes and pictures. A picture that repeats on most pages (a letterhead or logo, written as a decoration) and opens a page does not stop the paragraph before it from continuing when the text under it starts in lower case (PageJoiner.PeelLeadingDecorations); a picture that closes a page is peeled like a note. What stands at the foot of a page after the text that goes on (a footnote, or a short unmarked paragraph that is a caption or source line such as "Table 2." or "Source: ...") does not stop that text from continuing on the next page: the unit joins past it and the note stays at the end of its own page (PageJoiner.PeelTail). A paragraph that only says "Table 5 (continued)" at the top of the next page is dropped when the table joins, and kept when it does not (DropContinuedMarks). A caption whose halves the text layer cut apart ("Table 5." at the left, its title at the right, the table read between them) is put back in front of the table it stands over, not after it (JoinLabels).

  • Mixed pages (SemanticEmitter.Mix): text the tree leaves out (at least half of a line's characters untagged) is built by UntaggedBuilder for just those blocks and put among the tagged elements by reading-order index, inside the document element (which stays one node so pages still join). Notes need prose-like text and kept headers and footers are not notes.

  • Untagged pages (UntaggedBuilder): blocks come from OnePDF's extraction (columns, RTL, vertical text). Headings come from the outline (a line that is exactly an outline title stands alone), then from size and weight against the document's type facts (TextStats, a sample of at most 40 pages; heading sizes within 10 % of the tier's largest size are one tier, so a ladder of close sizes is cut where the page cuts it, and in a document of more than three sampled pages a size set on one line, unless it is the largest, is a pull quote or a sidebar title and not a level); consecutive heading lines of one level are one heading. Wrapped lines under a bullet or number stay in their item (hanging indent), and tightly set paragraph blocks that go on are one paragraph. Paragraph lines are joined, with line-end hyphens removed when the next line starts in lower case, and without spaces between CJK lines. Bullet and numbered lists nest by marker and indent and keep their start number. Small print at the foot of a page, led by a marker or set apart, becomes a note linked both ways. Pictures become figures (JPEG passed through, otherwise PNG) with a caption attached when one stands next to them. Form fields and annotations are written as text or real controls and as asides.

  • Figures, labels, columns and decoration in untagged pages (UntaggedFigures, UntaggedBuilder). A vector figure (marks from PageObjects.Marks: shapes, bars or lines on a common baseline, at least 50 x 36 pt and six marks, not prose, not mostly a table) is cut from the page picture and written as one image (role=img, aria-label the caption, else its labels). Its text stays in the picture and is also written as visually hidden text inside the figure (span.figure-text) so find and copy work and the text is not lost from content metrics; separate paragraphs of axis numbers would break reading order and are noise to assistive technology. Labels near a drawing join it; caption and note labels are kept in a block of their own. A forced line end starts a paragraph, a list item goes on in the next column's paragraph, and lists merge across columns. Text scraps drawn along a curve are decoration (aria-hidden). Lines the text layer kept in one block that are two to four columns wide with their columns at the same places are read column by column, one paragraph per short entry; a column of numbers (a contents list with page numbers) marks rows read across instead. Text the tree leaves out on a partly tagged page is placed inside the section it stands in.

  • Layout rules for untagged text (UntaggedBuilder, UntaggedBullets, TextVocabulary). A bullet drawn as a small filled shape (1.2 to 14 pt, about as wide as high, level with a line and up to 3.5 text sizes before its first word) is a list marker; browsers print list discs this way and the text layer has no character for them. A block whose indented lines each follow a line that went on because the next word did not fit is a hanging-entry block (a reference list): an indented line there continues its entry, and a line back at the margin starts the next. Three or more centred lines, one of which stops short of the column by more than the next line's first word, are separate paragraphs. On an upright landscape page with at most 400 words (a slide; not a page turned by /Rotate, not sideways text) the only heading is a line in the top 14 % set larger than the body text or in bold (a slide's body is large, so 4 % above it is enough), else text at least 85 % of the page's largest size in its top 40 %, level 2; other large text is body. A numbered coloured line ranks one level lower for each larger heading size the document has above it (its title). A line that is only a web or e-mail address, or a regular label followed by a bold value, is not a heading. A run of at least three centred lines inside a block is a stack of separate paragraphs, and an entry of a reference list that stands alone in its block is hanging when at least three entries of the page share its margin and indent. A column of bullets that the text layer read as a table is a list. Running heads and feet are looked for in the bands of the displayed page (a page turned by /Rotate keeps the band depth of the page as made). A bold short line ending in a colon is a label, not a heading. A hyphen at the end of a line is kept when the document spells the compound with it elsewhere (words of the sampled pages, TextStats.Vocabulary), when the hyphen is inside a chain ("end-to-"), or when both halves are words of their own (at least three letters) elsewhere; otherwise it only broke a word and goes with the join. Untuned thresholds: the bullet size and gap, the 85 % and 40 % of the slide title, the 400 words.

  • Headers and footers. The text layer of one page cannot tell what repeats, so the document sample decides: text in the top or bottom 12 % of a page that repeats, with its digits masked, on at least two sampled pages and 40 % of them. PdfHtmlOptions.HeadersAndFooters marks them (doc-pageheader / doc-pagefooter, the default), keeps them in the flow or drops them.

  • Page boundaries. A zero-size doc-pagebreak marker with the id page-N by default; PdfHtmlPageBoundaries.Section wraps each page.

  • Landmark. The pages sit in one main.

  • Tables in untagged pages (Analysis/Tables, UntaggedTables): PdfHtmlPageAnalysis.Tables finds each page's tables from its words and, when the page has two or more rows of separate cells, from the rules and fills the page draws (the display list is interpreted again only then). A table is a grid of cells with row and column spans, header rows (from bold type, a rule under the first rows, shading, larger type or text above columns of numbers) and header columns (PdfHtmlTable.HeaderColumns: the first column when it is bold where the rest is not, and, in a table without header rows, each later column of bold words, as in a list of facts laid out as label, value, label, value; they are th scope="row"). Ruled grids come from the lines; unruled tables from the gaps that stay open down a run of rows. Recognised text brings its own grid (PdfHtmlPageText.Tables), which is used as given. Refused: label and value lines, contents lines, bulleted lists, columns of prose (also in the unruled search: words of prose blocks and running heads are left out of it), line-number columns, chart, map and diagram grids (many curves or slanted strokes inside, or a picture under more than about a third of the grid), form grids (below), grids that are mostly empty, and small grids that have neither a header, rules between rows, shading nor numbers. A header drawn as a ruled box with the body set without rules under it is one table; footnote marks join their row; a cell's text centred over several lines belongs to the fuller row below it. Tables a page ends and the next page goes on with (same columns, header repeated or not) are one <table>: a repeated header shows that the earlier part's first rows are header rows even when only the later page recognised them, and a first row on the next page with an empty first column and text under cells of the last row is that row's second half (its text joins those cells). A table is also joined past what stands under it or over it: a note, a source line, a footnote or a caption under the earlier part, and a "(continued)" label over the later one, do not count as body text when the finder decides whether the table reaches the foot or the top of its page (TableDetector.FindAsideLines).

  • Rows, wraps and refusals added after real files (TableDetector). Words of one size on one baseline join a row even when East Asian and Latin words sit in boxes of different heights (a Korean cell beside "O" or "$35"). A header cell that wraps against the bottom of its row has its first line, one word alone above the row over the same cell, taken in; a last row's cell may wrap over up to six lines; wrapped lines may sit up to 1.6 em apart when the table's rows are further apart than that. A numbered heading ("7.1" and a title) right over a table is not its first row. Two rules under four points apart with no text between them bound no row. A ruled grid at most three rows deep that is mostly empty cells (squares to write a number in) is not a table. Columns that each stand in a filled box of their own (cards on a slide), when most of the columns do, are not a table; a few shaded columns in a data table are. A column's cells count words per line, so stacked single numbers do not read as running text. In tagged files, a table cell with no marked content (TagIndex) is kept as an empty cell, so the cells after it stay in their columns.

  • Form grids. A ruled grid whose cells are labels over room to write is a form, not a table. The test (LooksLikeForm, ruled grids only): the text fills under about a third of the area of the boxes it stands in (under a fifth when the grid is regular, i.e. has a cell for most of its rows and columns), and at least half of the labelled boxes are sentence-long (four words or more) or start with a field number ("1. Name", "13A. Are", "(2) Date"); a grid whose first row holds one short label per column (a questionnaire with YES and NO columns) stays a table. Evidence: 193 ruled grids in 164 real files; the rule refuses five, all the boxes of forms, and keeps the two with the same profile that are tables (a regular matrix of long cells, a questionnaire with YES and NO columns); data tables have a word or a number in each cell, or fill their boxes. What a form becomes instead: the refused grid's boxes go to the page analysis (PdfHtmlPageAnalysis.FormBoxes), and the builder cuts the text blocks at the box edges, so each label is a paragraph (or list item, when it starts with a number) of its own, read in the order of the page, and a line never runs from one box into the next. Fields of an AcroForm are placed as before.

  • Lists, equations, strips and keys that line up like tables (TableDetector.Listings.cs). Each refusal needs several signs at once, and rules or shading around the text turn most of them off. Contents lists and lists of figures (dot leaders in a few columns without a column of figures; titles with page numbers that count up in jumps; a column of section numbers that step 3.1, 3.2, 3.2.1 beside running text), a column of closing brackets (a court caption), lines of Label: value, equations set in parts (most cells are fragments of mathematics, few hold words or numbers), a one-row strip of non-numeric cells in the top or bottom 9 % of the page (a journal's header), a small ruled grid with plot strokes on both sides (a chart's key), a ruled grid that text runs across, and a page-sized ruled grid of numbered fields (a form). Header cells that wrap to several lines against the bottom of the header row are one header row, and a column of group labels in the second or later column spans the rows of its group when its first body row begins a group. tools/OnePdf.Html.TableScan lists the tables found on each page of a corpus so the share of pages with a table that is not one can be compared between builds.

  • Sideways text (TableFrame, PdfHtmlTextWord.Turn). Each word carries the quarter turn of the direction its glyphs run in on the displayed page (0 upright, 1 downward, 2 upside down, 3 upward; vertical writing counts as upright). A page /Rotated over upright content, or a wide table drawn turned on an upright page, has all its text in one sideways direction. The table finder searches each direction that has at least six words in a frame turned to read it: words, rules, fills, pictures and art are mapped into the frame (the text runs left to right and the next line is below, whatever the page's axes are), the same detector runs, and the table's bounds and cell bounds are mapped back to page space. Rows and columns are those a reader sees; a table of one frame never joins one of another (PdfHtmlTable.Turn). Upright text is searched exactly as before. What the frame does not reach: the headings, lists and paragraph rules of the reflowing builder still read line geometry in page space, so a heading set sideways is written as a paragraph (its size is taken from the line's box, which is turned); lines of sideways text are never taken for scraps of one line drawn along a curve, which hid them as decoration.

  • Limits of the table detector: a continuation page with one leftover row and no header is joined only when that row is one line standing alone at the top of its page, with words in at least two of the earlier table's columns and at least half of them (PdfHtmlTables.LoneRow; a row of several lines is not); a column filled in under a quarter of the rows can merge into a gutter; row spans are only inferred in the first column of unruled bodies; header detection needs bold, a rule, fill, size or numbers to go on; diagrams drawn as boxes of text and lists set in two columns can still be taken for tables. PdfHtmlTables.Continues, Merge and Flow place and join them.

  • Fonts (PdfHtmlOptions.Fonts). WebFonts (default): each PDF font becomes a WOFF2 subset, built once per document (a prepass collects the characters every page uses, merged in page order; SemanticFaces, reusing the fixed-layout glyph capture and font builder) whose characters are the Unicode text the extraction read from the glyphs, so the HTML text stays the extracted text and only its look is the PDF's; runs are wrapped in a class that names the face, with the standard fallback family after it, and the face's own weight and slant are not added to again by strong/em. The rules sit in the document shell's style element, with the font data inline or as font-<hash>.woff2 files written with the first page (page-per-file pages refer to assets/font-*.woff2), so a face used on many pages is written once; family names are wf0, wf1, ... A single page converted alone (ConvertPage) keeps page-local faces in its own style element. CssFamilies: no font is written; runs use the generic family mapping of FontMapping.

Output safety

  • Every string that comes from a PDF reaches the output through OneHtml's serialiser (HtmlBuilder). No code writes markup built from document text.
  • LinkPolicy is the only place a link target is accepted: http, https and mailto, with no control characters. Internal links become page anchors or page-file URLs from the sink, and only for pages in the conversion.
  • Emitters write numbers through CssFormat and never put document text in a style value.
  • No script, no remote reference. A page that fails (a damaged page, a limit) is written empty with an error diagnostic; it does not stop the document.

Determinism

No emitter reads the clock, the culture or thread identity. Numbers are formatted by CssFormat. Asset names come from the page number and a counter. Diagnostics are ordered by page, and OnePDF's own by object number and offset.

Known gaps in this version

  • Semantic: a figure's picture includes the text inside its area, a tagged table whose repeated header is not recognised as page furniture on a short last page can stay split from its first part, and the ordering of text the tree leaves out among sections (not the document element) is coarse.
  • Fixed layout: vector content, text and images are drawn as markup in painting order; no page picture is used unless a diagnostic with code raster-fallback says which element and why. Elements that fall back (cropped from one render of the page, PNG, or JPEG for large pieces): mesh shadings (types 4 to 7: browsers have no mesh gradient, and tessellating into triangles leaves seams and per-pixel colour differences), function-based shadings, radial shadings whose inner circle is not extended, tiling patterns whose cells overlap, and image masks painted with a pattern. If a page's display list cannot be built, the whole page is a picture.
  • Fixed layout, constructs a browser can't composite (the reference is the OneImage.Pdf render):
    • Knockout groups (/K true, ISO 32000-2 11.4.6.2): CSS and SVG groups never knock out. A knockout group whose content is painted with alpha, a blend mode or a soft mask (or holds a non-opaque group) is cut from the page picture, raster-fallback reason knockout group; with only opaque content knocking out changes nothing and the group is written as markup. Inside a soft mask, a pattern cell or an enclosing alpha, blend or mask frame the picture can't stand in, so the group is drawn as an ordinary group and reported once per page (knockout-group).
    • Overprint (/OP, /op, /OPM, 8.6.7) is not simulated, as in the reference render: content knocks out what is below (reported once per page, overprint).
    • A soft mask's backdrop colour (/BC) is written: the mask gets a page-sized rectangle in that colour under its content, so unpainted areas take the backdrop's luminosity (black by default), also under a transfer function.
    • A shading pattern's /ExtGState is not applied, as in the reference render (reported once per page, pattern-extgstate).
    • A soft mask's transfer function (/TR) is written as an SVG filter on the mask content. The reference render of the bridge version in use ignores /TR, so where a file has one the page differs from it by design; the markup follows the specification.
  • Fixed layout: only images are shared between pages (written once per document); clip paths, patterns and gradients are repeated on each page. Large opaque non-JPEG images are written as PNG.
  • Fixed-layout text (Fixed/Text/): the page's text is written once, as real text. Each line of the extraction is one absolutely positioned, transformed element holding spans of the extracted Unicode; the spans are set in WOFF2 fonts built (OneFont FontBuilder) from the glyph shapes the PDF draws, whose character map leads each character to its shape and each ligature or cluster to its glyph (MapSequence, GSUB ccmp/rlig). A character that leads to different shapes in one PDF font (Arabic forms, stylistic variants) gets a font of its own. A glyph the extraction has no text for is mapped to a private-use character in a span that is aria-hidden and user-select:none; when the text layer has no word for the glyph at all (recognised text stands in for the layer, an annotation's appearance, a glyph drawn twice) the character is generated content (data-g and ::before), so it is drawn but never part of the page's text. Lines sit in one container that is not a stacking context, in reading order; the composer gives layers even and text odd z-index values so painting order comes from stacking. Text that must stay inside a soft mask, group, blend mode or non-rectangular clip is written in that frame instead, at its painting position. Text that is not drawn by the text itself (invisible, stroked, clipping, Type 3, pattern-filled) is transparent text in a font that carries only advances. Words that run against their line's direction (numbers in right-to-left text) are spans that set their own direction, so glyph order and copied text both stay logical. PdfHtmlOptions.Fonts = CssFamilies writes no font: words are set in CSS families chosen from the font name and each word is placed where the PDF has it.
  • The page picture is drawn by a bridge that parses the file again for each page.
  • Page pictures are PNG only.

HTML to PDF (src/OnePdf.Html.Render)

HtmlSource -> HtmlToPdfConverter -> read input (ResourceLoader: file root | HttpFetcher) -> facts (title, lang, meta) -> PageCss (@page: size, margins, margin boxes)
           -> OneRender HtmlPdf (layout for print, pages, tagged PDF, outline, links, PDF/UA or PDF/A) -> stream | file | bytes

The package is a thin layer: OneRender lays the HTML out and writes the PDF; this package decides what the document may load and fills in what a converter API offers.

  • Page options become one @page rule appended before the last </body>, so it follows the document's own style sheets and wins over them for the properties the caller set. Properties left null defer to the document's rules, then to A4 with 0.5 inch margins.
  • Headers and footers are templates turned into CSS page-margin boxes: text becomes quoted strings (escaped, < as \3C, so a template cannot close the style element), the classes pageNumber and totalPages become counter(page) and counter(pages), title and url become text. OneRender's own pagination fills the counters.
  • HTML templates: a template that holds more than text (TemplateMarkup.IsRich: an element other than br, p, div, span, b, i, u, em, strong, small, sub or sup, or one of those with class, style or id) and HtmlHeaderFooter.Html are parsed and written out again (scripts, style, iframes, event attributes dropped; text and attribute values escaped; placeholder elements become empty spans filled by counter(page)/counter(pages) rules, or spans holding the title, URL or caller's date) inside a div[data-onepdf-hf] placed at the start of the body. A rule gives that div position: running(name) and the margin box content: element(name); Html uses the centre box made as wide as the page area. At the start of the body so OneRender assigns it to page 1. Images are loaded by the same resource loader as the document's.
  • Resources. OneRender never fetches; it asks ResourceLoader for each address. A caller hook is asked first. file: addresses must lie below the input's folder after .. is resolved and links are followed. http/https need the network to be on (or a URL input); HttpFetcher follows redirects by hand (each hop checked), caps bytes and time, and checks the address of the connection it makes, which also covers names that change their answer. The host and port of a URL the caller named are trusted; everything else non-public is refused unless allowed. Refusals and limit hits are diagnostics, and the document goes on without the resource.
  • Outline, link policy, profiles live in OneRender (HtmlPdfOptions.Outline, PdfOutputOptions.Links, PdfOutputOptions.Profile); this package maps its options to them.
  • Batches run one converter per input on Parallel.For; the converter holds no state between calls, so each result equals its one-by-one conversion.