Recursive AI

Changelog

All onepdf-html docs

All notable changes are listed here. The format follows Keep a Changelog and the project follows Semantic Versioning.

Unreleased

1.0.0 - 2026-12-04

First release of OnePdf.Html: PDF to HTML (semantic and fixed-layout output, with OCR for scanned pages) and HTML to PDF, as a library and the onepdf-html tool.

Added

  • RecursiveAI.OnePdf.Html: PdfHtml.Convert and the per-page PdfHtmlConverter, with semantic and fixed-layout output, page ranges, passwords, limits, cancellation, parallel pages written in order, output as one file or a file per page with images inline or as files, and diagnostics.
  • Semantic output: tables in untagged pages (ruled, unruled, partly ruled, spans, header rows and columns, continued over pages, right-to-left and CJK), also from recognised text; structure from tags or from layout (headings, nested lists, tables the tags describe, figures, captions, footnotes, form fields, annotations), de-hyphenated paragraphs, headers and footers marked, kept or dropped, and paragraphs, lists and tables joined across page breaks.
  • Semantic output: inferred structure on untagged pages (headings by tier, hanging-indent list items, tight paragraph merges, notes only from prose-like small print, kept headers and footers are not notes), tagged and untagged text mixed per block on partly tagged pages, small pictures inline in their line, vector figures cut from the page picture, and the PDF's fonts as WOFF2 subsets built once per document and shared by all pages, in the document head or as font-<hash>.woff2 files (PdfHtmlOptions.Fonts, WebFonts default, CssFamilies for generic families), so documents and CJK pages stay small.
  • Semantic output, untagged pages: tables whose text runs sideways on the displayed page (page /Rotate of 90, 180 or 270 over upright content, or a table drawn turned on an upright page) are found as the table a reader sees, ruled or not, with the rows, columns, spans and header rows of the upright table. Generated test pages for every turn and look (testdata/eval/heldout/h-rot*, h-side*) are part of the held-out set.
  • Semantic output, untagged pages: a bullet the page draws as a small filled shape (a browser's list disc) makes a list item; an entry whose first line stands at the margin and whose other lines are indented (a reference list) is one paragraph; the centred lines of a title block or an address are paragraphs of their own; a slide (a landscape page with little text) has one title, the largest text near its top, and its other large text is not a heading; a bold line ending in a colon introduces something and is not a heading; a hyphen at the end of a line stays when the document spells the compound with one (or both halves are words of their own elsewhere) and goes when it only broke a word.
  • Semantic output: a table, paragraph or list that a page break cuts continues past a footnote, a source line or a caption at the foot of the page, and past a "(continued)" label or a letterhead picture at the top of the next; a single table row left at the top of the next page joins its table; a caption read after its table is put back in front of it, and a caption set wider than its small picture stays with it.
  • Semantic output, untagged pages: numbered items set in blocks of their own (a reference list cut by figures, steps separated by displays) stay list items when the page holds the neighbouring number at the same margin; a drawing does not repeat a running head, foot or page number as its hidden text.
  • Semantic output, untagged pages: sub-lists nest under their bullets, list items that wrap are joined, arrow bullets (repeated at one left edge) make list items, a chart title beside a list is kept as text, two-column text reads by column with each caption kept with its picture, centred author lines are joined, and a picture the document's own pages draw on most pages (a letterhead) is decoration.
  • Semantic output: contents lists, lists of figures, numbered definitions, court captions, equations set in parts or in symbol fonts, a few words under a wide ruled frame, journal header strips and chart keys are not taken for tables, and neither are whole-page forms ruled into numbered boxes. Header cells that wrap over several lines are one header row, and group labels in a later column span their rows in tables without rules.
  • Semantic output: the ruled boxes of a form are not written as a table; each box's label is a paragraph (or numbered list item) of its own, in page order.
  • Semantic output, untagged pages: vector figures are cut from the page picture with their text kept as visually hidden text, labels join their drawing, columns of short entries are read column by column, curved text scraps are decoration, and left-over text on partly tagged pages is placed inside the section it stands in.
  • Fixed-layout output (PdfHtmlMode.FixedLayout): one box per page that looks like the page. Text is real and selectable, positioned per glyph run in the PDF's own glyph shapes, rebuilt from the outlines as WOFF2 subsets whose character map leads the extracted Unicode to each glyph, so copied text is the extracted text. Vector content is SVG (paths, clips, gradients, patterns, groups, soft masks and blend modes); images are PNG, with JPEG passed through; what cannot be expressed comes from a page picture, per element or per page, with the text still selectable over it. One file or a file per page, assets inline or as files, Zoom, and LazyPages (CSS only, no script).
  • IPdfHtmlTextSource, so a page's text can come from the PDF or from recognition.
  • RecursiveAI.OnePdf.Html.Ocr: OcrTextSource recognises text with OneOcr for scanned pages and pages whose text layer is garbled or lies off the ink, in both modes, and hands over tables with their grid. OcrMode (never, auto, always), render resolution, pixel limit, languages, concurrency cap. Core gained PdfHtmlTextSources.Assess (the deterministic text-layer rules), PdfHtmlPageText.Tables and PdfHtmlTextBlock.Kind. The tool takes --ocr auto|always|never and --ocr-lang.
  • OCR for Chinese, Japanese (also vertical lines), Korean, Arabic, Persian, Urdu, Hebrew and nine Indic languages. Add RecursiveAI.OneOcr.Models.Cjk, .Arabic, .Hebrew or .Indic to the application; the default engine uses the models they install beside it. OcrTextSourceOptions.Languages and the tool's --ocr-lang pass the document's languages to the recogniser, and a language whose model is not installed gives ocr-language-unsupported. The onepdf-html tool includes all four families. Measured: scanned CJK pages 0.4 % text error (48.8 % with the Latin models alone), Arabic and Hebrew 2.9 % (89.7 %); Latin scans read the same with the family models installed.
  • RecursiveAI.OnePdf.Html.Render: HTML to PDF. HtmlToPdf (string, file, stream or URL in; bytes, stream or file out; batches in parallel) on HtmlToPdfConverter and HtmlSource. Options: page size, orientation and margins, header and footer templates with page number, total and title, link policy, an outline from the headings, metadata, tagging, PDF/UA-1 and PDF/A-2a. Files are read only below the input's folder; the network is off unless the input is a URL or HtmlNetworkOptions.Enabled is set, with http/https, size, count, time and redirect limits, and non-public addresses refused unless allowed. No script runs.
  • RecursiveAI.OnePdf.Html.Tool: the onepdf-html command.
  • onepdf-html: converts HTML (a file, a URL, standard input or several files) to PDF with flags for the options; the input is found among the arguments, so options and their values may come first.
  • Test pages for the table finder's refusals (grids drawn as art, line numbers down a margin, forms) and rules (cells that wrap or are centred, raised note marks) and for joins past notes, generated by OnePdf.Html.Eval gen --set refusals.
  • Web fonts built from open-licence outlines (the substitutes for fonts a PDF does not embed) carry the source font's copyright line, the SIL Open Font License 1.1 notice and the license URL in their name table (IDs 0, 13 and 14), in both modes. The converter asks for the RecursiveAI.OnePdf.Fonts substitutes before any installed font, so the output does not depend on the machine's fonts.
  • Documentation: a guide for each direction (docs/pdf-to-html.md, docs/html-to-pdf.md), the command-line reference (docs/cli.md, which quotes the tool's own help text and is checked against it), a list of diagnostic codes and limits (docs/diagnostics.md), a package readme for each package, and complete third-party notices. Every C# sample in the README and the guides is compiled and run by tests/OnePdf.Html.Docs.Tests.
  • RecursiveAI.OnePdf.Html.Tool installs as a native executable on linux-x64, linux-arm64, osx-arm64 and win-x64 (platform-specific tool packages, with a framework-dependent any package for other platforms). A small fixed-layout document converts about six times faster than with the framework-dependent tool, because there is no runtime start and no code compilation. Output is byte-identical.
  • Render: header and footer templates may be HTML. A template with an image, a table, a link or an element with its own class or style is drawn as HTML in its margin box, carried by a CSS running element; HtmlHeaderFooter.Html is one such template across the whole page area (a logo with a title beside it, a two-column footer). Images in templates load through the same rules as the document's (the input's folder; the network only when enabled). A date placeholder shows HtmlHeaderFooter.Date, and nothing when the caller gives none. Scripts, event attributes and style elements in a template are dropped. Text-only templates are drawn as text. The tool takes --header-html <file> and --footer-html <file>.

Limits and robustness

  • A page with too many stroked segments for its picture to be drawn in reasonable time and memory (over a million flattened segments together, or over a hundred thousand in one path) is not drawn: the converter counts the segments from the page's own content, with no clock, and past the bound (RasterBudget) reports raster-failed and goes on without the picture. Text, links and vector output are unaffected; a figure that needed the picture is left out. The bound is the same for every run and machine. Strokes that lie over themselves (plots drawn as a staircase of thousands of tiny steps) are drawn.
  • Memory stays flat with document size: a picture written inline reaches the output in pieces as the sink writes, never held as one base64 text, so a document of 86 pages and 137 MB of HTML with inline pictures converts in 0.74 GB (semantic) and 0.66 GB (fixed layout) on the command line. PdfHtmlPage.Html makes the whole text when read, so a custom sink sees the complete page. The pictures decoded and re-encoded at once are bounded across the pages converting in parallel (12 megapixels), and colour conversion works in strips.
  • Fixed-layout output: a page that sends thousands of elements to the page picture (a tiling pattern whose cells overlap) cuts at most 256 pieces from it and reports the rest as raster-limit.
  • A figure whose page picture cannot be drawn (a page whose transforms leave the finite range) is left out with a raster-failed error, in both modes, and the conversion goes on.
  • Fixed-layout output: a glyph width beyond what the font tables can store, or a noncharacter or out-of-range code point as a glyph's text, affects only that glyph, not the file.
  • The command-line tool collects garbage eagerly (no background collections, memory conservation on), so its peak memory follows the live data instead of the allocation rate.
  • Semantic output, untagged pages: lines of text that run sideways on the displayed page (a page turned by /Rotate, a table drawn along the long edge of an upright page) are paragraphs, not decoration.
  • Fixed-layout output: glyphs with no Unicode value that the page's text layer has no word for (a broken layer under recognised text, form field and annotation appearances, glyphs drawn twice) are drawn from generated content, so they are not part of the copied text, and a page with a broken text layer reads as the recognised text alone.
  • A page whose only pictures are smaller than 64 by 64 samples (colour swatches, bullets) is not taken for a scan, so it is neither drawn for the ink check nor read by the recogniser.