All notable changes to @awacloud/oconv will be documented in this file.
The format is based on Keep a Changelog, and this package adheres to Semantic Versioning.
See README.md for the usage guide.
[Unreleased]
[2.0.0] - 2026-11-19
Breaking
-
convert'slayoutis on by default where a pair honours it. An absentlayoutistrueondocx → odt(the page, the paragraphs' alignment and breaks, the runs' values, the headers and footers, the page fields and the notes reach the odt) andfalseon every other pair.layout: falsegives tier 2, the output of 1.x;layout: trueon another pair still throwsoconv: layout needs docx to odt. The worker forwards a convert message'slayout, so a worker caller can turn it off. -
The odt reader reads a
text:noteas the IRnote. It reads with@awacloud/odf'snotes, sotoMdof an odt with notes, and odt → docx and → pdf, drop each note withnote/droppedinstead of running its citation and body into the paragraph (inline/flattenedin 1.x). -
The pdf reader is built on
@awacloud/pdf'spdfFontDecoderandpdfPageText;oconvPdfFontDecoderis gone. oconv kept its own copy of pdf's font decoder (and of its page walk) since pdf gained them as extras; the copy leaves the manifest, andmodulesregisters pdf'spdfFontDecoderandpdfPageTextin its place. A composer that resolvedoconvPdfFontDecoderresolvespdfFontDecoder(the samebuildDecoderanddecodeShow).oconvPdfTextExtractkeeps its name and its output: it ispdfPageText.extractPagewith its rules, image items and pictures built on the walk'svisithook, equal to the 1.x walk on every page of 1,706 corpus PDFs, with and withoutrules,imagesandcellKerns.pkg_requirenamespdfFontDecoderandpdfPageText, and no longer the pdf and fonts modules only the copy used (pdfFont,pdfFontEncoding,pdfResources,pdfContentStream,cmapToUnicode,encodingLookup,encodingAgl,encodingTexMath). -
A document past 256 MiB of text throws
oconv: output too largeby default. The output budget moves intoirToMd(opts.outputBudget,toMdforwarding its own) and takes{ bytes: 268435456, overflow: 'throw' }when absent, sotoMd, the worker and every caller of the renderer, oview's copy among them, fail by name before any markdown is built, where 1.x rendered until it ran out of memory (a 110 KB xlsx whose cells share one 1 MB string reached 2.2 GB and aRangeError). A missingbytestakes 256 MiB, so{ overflow: 'truncate' }alone truncates there and{}is the default;bytes: Number.MAX_SAFE_INTEGERrenders as 1.x did. Of 5,586 corpus documents, that xlsx is the one refused; the largest other output is 11.4 MB. -
A sheet past 5,000,000 padded cells takes the sparse form by default.
xlsxToIrandodsToIrtakeopts.cellBudget5,000,000 when it is absent (ooxml's ownmaxCellsPerSheet), sotoMd'ssheetCellBudget,convertand every caller of the readers do too: a sheet whose padded table would hold more cells is written one<A1 address>: <text>paragraph per value (its rows unpadded undersheets'csv'/'tsv'), recordedsheet/sparse-form, where 1.x padded it (one wide row in a long sheet made tens of millions of cells and tens of GB).Number.MAX_SAFE_INTEGERpads every sheet as 1.x did. No corpus spreadsheet changes: the widest of 787 pads to 1,010,025 cells. -
toMdopens an encrypted pdf with the empty password by default (@awacloud/pdf's default; RC4 files too, oconv passingpdfLegacyRc4Readto every pdf read). The conversion carries onepdf/opened-with-empty-user-passwordloss, its detail the permission bits, so it islossy; a file the empty password does not open still throwspdf/document/encrypted.pdfEmptyPassword: falsekeeps the 1.x refusal. On the corpus, 17 of 42 encrypted files convert this way, among them ISO 32000-1 itself. -
toMdreads a pdf whose cross-reference chain is broken.@awacloud/pdfrebuilds an unusable chain by default, so such a file converts with nopdfRecoverXref;pdfRecoverXref: falseis now forwarded and reads strictly, the chain's error thrown as in 1.x. -
An untagged pdf infers headings and tables by default.
toMdwith nopdfInferreads a pdf aspdfInfer: ['headings', 'tables']: headings from font size and weight, tables from rules or aligned text. PasspdfInfer: []for the text-first read of 1.x. A tagged pdf is read through its structure tree as before. opendataloader-bench, default read: 0.5754 → 0.8370. On 2,422 corpus PDFs, 105 read differently (the untagged ones the inference changes), at +9.5 % of the pdf-to-IR time on those. The default sits inoconvPdfToIr.pdfToIritself: an absentopts.inferreads as['headings', 'tables'], so a read chain composed withouttoMd(oview's copy, an app's own chain) infers astoMddoes;infer: []is the text-first read.
Changed
-
The TeXCMMaths fonts read as the signs they draw. A simple font of the
TeXCMMathsSymbols,TeXCMMathsItalicorTeXCMMathsExtensionfamily names each glyph by a Computer Modern position, and its ToUnicode repeats the names:=was read as¼,+asþ,(and)asðandÞ, the minus sign as U+FFFD,/as=. The decoder now reads those three families through@awacloud/fonts'encodingTexMathbefore the ToUnicode (the glyph name gives the position); every other font is read as before. The decoder depends onencodingTexMath, which@awacloud/fonts' manifest registers. -
A table drawn with horizontal rules only reads as a table. Under
'tables', a line between two horizontal rules that span it (one within 1 em below its baseline, one within 2 em above) is cut into cells at a gap over 0.4 em instead of 0.8 em, so the tables oconv's own md → pdf writes (rules above and under every row, columns 0.55 em apart) come back as tables in md → pdf → md. No table of 2,422 corpus PDFs changes; opendataloader-bench holds at 0.8375. -
The heading inference keeps labels, values and table rows out. On an untagged pdf, a line the
'headings'inference would make a heading stays a paragraph when it has more digits than letters (a leading section number set aside), ends with a space and a colon with no section number, is a short label:a numeric value, holds an email address, a URL or an amount with a currency, or is an address (two commas and a 4- or 5-digit number that is no year); and a bold line of three cells or more (a table's header row) is no bold heading. The Factur-X sample invoice reads 1 heading, not 11; opendataloader-bench 0.8370 → 0.8375. -
md → pdf takes a face without a
<style>`.nametable. With@awacloud/fontsreading such a font by default, a face posted inopts.pdf.fonts(or a default face) that has nonametable embeds, its subset named<prefix>+Font, where 1.x threw `oconv: bad pdf font -
Breaking: the worker is
@awacloud/oconv/worker.js, a bundle.src/worker.jsis now a self-contained build of the worker's source,src/worker/entry.js(bun run gen:worker): it imports nothing, so a static page starts it with no import map (a module worker has none). Itsexportskey is./worker.js→./src/worker.js, the/vendoridentity rule (@awacloud/oconv/<p>→src/<p>); the 1.x key./src/worker.jsis removed. The message protocol is unchanged. -
Breaking: the pivot IR is
oconv-ir/v2. v2 is v1's 13 node kinds and props plus optional typed props for styles and page layout (tier 3):document.page;alignandbreakBeforeonparagraphandheading;size,font,color,underlineandscriptonrun; the document's header and footer,document.headeranddocument.footer(null, or the slotsdefault,firstandeven, each an array of blocks,firstandevennullwhen not distinct); and one inline kind,field(name'page'or'pages',textthe value the source shows, and a run's formatting props) and one inline container,note(class'footnote'or'endnote',marka custom mark ornull, its children the note's blocks), soKINDShas 15 kinds.withoutNotesgives a tree without its notes, for a writer without notes.withFieldsAsRunsgives a tree's fields as plain runs, for a writer without fields. A node without them, as a v1 producer writes it, validates unchanged;node()gives each its default, so a reader'sdocumentnode now carriespage: null, header: null, footer: null, everyparagraphandheadingalign: null, breakBefore: false, and everyrunsize: null, font: null, color: null, underline: false, script: null.IR_VERSIONand theirkey oftoMd's front matter now sayoconv-ir/v2;profilestaysv1. A consumer that compares either withoconv-ir/v1must accept v2.
Added
-
Zapf Dingbats glyph names and the Standard 14 symbol fonts read as characters (the pdf reader). A font whose family names Dingbats resolves its glyph names through the ITC Zapf Dingbats Glyph List (
a73→■), and a non-embeddedSymbolorZapfDingbatsfont with no base in/Encodingtakes its built-in encoding (a24→✘, not8). On 2,422 corpus PDFs (first 60 pages each), the undecodable codes fall from 3,017 to 2,744. -
Symbol and Wingdings private-use text read as characters (the pdf reader). A ToUnicode entry at 0xF020–0xF0FF in a
Symbol,SymbolMTorWingdingsfont is read again: Symbol's throughSymbolEncodingand the AGL (U+F0B7 →•), Wingdings' for the pairs Word itself writes (U+F0A7 →▪, U+F0FC →✓). On 2,422 corpus PDFs (first 60 pages each), the private-use characters fall from 50,675 to 438. -
pdfInfer: ['tables']reads ruled tables drawn in segments. Two touching segments of one rule line, such as a vertical cut at every row border, now make one line of the grid. A grid in which the aligned-text rule finds more rows than the grid has is left to that rule: it is a grid without rules between its body rows. opendataloader-bench layout: 0.8313 → 0.8367, 3 documents up and none down. The default read is unchanged. -
pdfInfer: ['tables']reads rows on several baselines and one long column. On the lines no table holds, a region where the content order goes back up inside a row (cells drawn one by one, a cell centred against a two-line neighbour) is re-cut by baseline: baselines closer than 0.75 em are one row, and each cell is joined top down. Such a table needs 3 rows, one size and whole lines. With 3 columns or more, one column other than the first may hold cells of up to 120 characters. opendataloader-bench layout: 0.8239 → 0.8313, 4 documents up and none down. The default read is unchanged. -
The pdf reader reads a symbolic font's built-in encoding.
oconvPdfFontDecoder(the copy of pdf'spdfFontDecoder) decodes a symbolicType1orMMType1font through its embedded Type 1 or CFF program's built-in encoding when its/Encodingnames no base (ISO 32000-2 §9.6.6.1). Before,StandardEncodingwas used. pdfLaTeX's Computer Modern text and math without/ToUnicodenow converts to Markdown as text instead of wrong punctuation ortext/undecodablelosses. -
convert's opt-inlayoutcarries the footnotes and endnotes ondocx → odt. Withlayout: true, a docx note reads as an IRnoteat its reference, holding the note's blocks, and the odt writer writes it astext:note(@awacloud/odf's typed note run): its class, its number among its class's automatic notes or its custom mark, its body typed as the body is. A reference whose note did not read is recorded (note/unresolved); a note in a note's body is not written (note/dropped, detailnested). The md, docx and pdf writers write no note and record each (note/dropped, detail its class). -
convert's opt-inlayoutcarries the headers and footers ondocx → odt. Withlayout: true, the docx's last section gives the odt's master page its header and footer: the default one, the first page's undertitlePgand the even pages' under the settings'evenAndOddHeaders(style:header,style:header-first,style:header-left, and the footers'), read and written as the body is, their styles instyles.xml(MP<n>,MT<n>).- A
PAGEfield reads as a page number and is written astext:page-number;NUMPAGESandSECTIONPAGESastext:page-count. This holds in the body too, underlayout. - Another field in a header or footer keeps the text it shows
(
field/static, once per name). - A reference whose part did not read is recorded
(
layout/region-unresolved). - The md, docx and pdf writers write a field as its text, and record a
stated header or footer as
layout/region-dropped.
- A
-
convert's opt-inlayoutcarries the page ondocx → odt. Withlayout: true, the docx body's page size, orientation and margins reach the odt as its page layout (document.page, in points).- A document of several sections takes its last section's page
(
layout/sections-merged). - A gutter is dropped (
layout/gutter-dropped). - A negative top or bottom margin is kept as its absolute value
(
layout/margin-negative). - A
layoutthat is not a boolean throwsoconv: bad layout option; on another pair,oconv: layout needs docx to odt. - The docx reader takes it as
docxInclude: ['layout'].
It also carries each paragraph's and heading's effective alignment (its
jc, else up its style chain, elsedocDefaults) and its page breaks (pageBreakBefore, a break alone in or at the end of the paragraph before, one at its start), written as automatic paragraph styles. Adistributeor kashida alignment reads asjustify(layout/align-approximated); several breaks before one block are one (layout/breaks-merged); a break inside a paragraph stays a space (layout/break-inside); one that reaches a table, a code block, a quote, the end of a text box or of the document is dropped (layout/break-dropped).And each run's effective size, font, colour, underline and super- or subscript (its
rPr, its character style's chain, its paragraph style's chain,docDefaults; a theme font read from the theme part), written as automatic text styles. A theme font the theme does not name is dropped (layout/font-theme-unresolved); another underline kind is written as single (layout/underline-approximated).Without the option the output is unchanged.
- A document of several sections takes its last section's page
(
-
pdfInclude: ['images']places inline images and CMYK pictures. An inline image (BI … EI) is read as an image XObject is, its colour space looked up in the resources when it is a name, and named after its bytes (image-inline-<hash>). Raw DeviceCMYK, ICCBased with/N4 and Indexed on them are converted to RGB without a profile. Over 1,763 PDFs, the dropped pictures go from 3,847 to 159. The default read is unchanged. -
pdfInfer: ['tables']reads a table row drawn as oneTJ. On an untagged document, aTJarray with 2 or more kerns of over 1 em between its strings is cut there into one piece per cell, so the aligned-text rule sees its columns (oconvPdfTextExtract's newopts.cellKerns). On opendataloader-bench, read with['headings', 'tables']: 0.8176 → 0.8239. The default read is unchanged. -
pdfInferfinds more headings and fewer false ones. Four rules, on the untagged path under the opt-in only:- a font named with URW's bold suffix (
-Medi,-MediItal) is bold; - a figure or table caption (
Figure 3.,Table 2:…) set in bold or larger stays a paragraph; - a title set at two heading sizes on one line (small caps) is one heading;
- a table of contents (entries, then page numbers that do not
decrease) stays text under
'tables'.
On opendataloader-bench, read with
['headings', 'tables']: 0.7949 → 0.8176. The default read is unchanged. - a font named with URW's bold suffix (
-
The text and pictures of a pptx group shape. The pptx reader reads with
pptx.read'stypedGroupsand walks a group's shapes in place: their text, pictures and media are read as the slide's. Earlier releases dropped them without a loss (in the wild corpus, 620 paragraphs and 132 pictures in 17 decks). -
opts.pdf.pdfUAandopts.pdf.lang: md → pdf and docx / odt → pdf claiming PDF/UA-1 or PDF/UA-2. The document is built withpdfBuilder'spdfUAand its structure API: headings, paragraphs, quotes, lists (L/LI/Lbl/LBody), tables (THscoped to its column), code blocks and pictures (Figurewith the alt text) are tagged, every drawn item marked; rules and page numbers are artifacts. A picture without alt text is an artifact, recordedimage/decorative. The title is the front matter'stitle, the source's, else the first heading's (oconv: pdf/UA needs a title (front matter or a heading)); every drawn style class needs an embedded face (oconv: pdf/UA needs embedded faces (<classes>));langis required withpdfUA, andpdfUAis refused withpdfA(oconv: bad pdf option <key>). With the default faces, veraPDF 1.30.3 judges the documents conforming. WithoutpdfUAthe output is unchanged. -
opts.pdf.pdfA: md → pdf and docx / odt → pdf claiming PDF/A-4 or PDF/A-2b. The document is built withpdfBuilder'spdfA(XMP metadata, an sRGB output intent, the profile's version) and every font embedded: each style class drawn needs an embedded face — the caller'sopts.pdf.fontsor the registered default faces (@awacloud/oconv-fonts) — elseoconv: pdf/A needs embedded faces (<classes>)before anything is written; another value isoconv: bad pdf option pdfA. With the default faces, veraPDF 1.30.3 judges the documents conforming. WithoutpdfAthe output is unchanged.
Fixed
-
A span whose style states no emphasis is no longer a loss (the odt reader). A span with no emphasis flag recorded
run/format-unresolvedeven when its style is defined and states none, a size, a font or a colour alone; the code now fires only for an undefined style, or one whose chain states an emphasis property. oconv's own docx → odt runs read back clean (60,591 such losses on the 1,469 wild docx converted by default, before). -
A dropped note's custom mark is dropped with it (the docx reader, without
layout). The text that follows a footnote or endnote reference withcustomMarkFollowsis the note's mark; it was kept as body text when the note was not read (a stray*, or an invisible Symbol-font character on a line of its own). -
A ToUnicode entry of U+FFFD no longer hides a glyph name that reads. The entry says the producer knew no character; the decoder now reads the code through the font's encoding instead, and keeps U+FFFD only when that reads nothing either. With
@awacloud/fonts' fuller glyph-name reading,one.SPreads1where the text had U+FFFD. -
A docx smart tag's text is written.
docxToIrreads a smart tag's runs in place (@awacloud/ooxmltypes it now), where they were dropped without a loss: 90 of 90 smart-tag words in the wild docx, from 48. -
A pdf read's own losses reach the ledger.
pdfToIrputs the read document's records first in its ledger, read after the extraction:pdf/document/xref-rebuilt,pdf/document/xref-tolerated,pdf/document/free-entry-fallback,pdf/document/free-object,pdf/document/reference-cycle, and the empty password aspdf/opened-with-empty-user-password(moved here fromtoMd, so an app's own read chain records it too, once). A pdf read by a tolerance or a rebuild no longer converts as lossless: 54 of 2,422 corpus PDFs. -
Qrestores the text font. The pdf page walk:qnow saves the font in force, its size and the leading with the CTM,Tc,TwandTz, andQbrings them back (ISO 32000-2 §8.4.1). Text drawn after aq … Tf … Q, as after a list label in a bullet font, was decoded through the font set inside theq. On 2,422 corpus PDFs (first 60 pages each), the undecodable codes fall from 14,410 to 3,017. -
Text boxes are read from a docx, and a shape is no longer an image. The docx reader dropped the content of every text box without a loss. Each
w:txbxContent— in a run's VML (w:pict,w:object: the fallback of a Word 2010 shape, which the read takes, or VML alone) or in a Word 2010 shape, group or canvas drawing — is now read as body blocks after the paragraph that anchors it (after its list or quote when it is in one), a picture in it with its bytes. Such a drawing is not written as an image any more: one holding no text box recordsinline/dropped(detailwps:wsp,wpg:wgporwpc:wpc) instead of an image reference withimage/bytes-unavailable. In the real-world docx files of the test corpus, 191 hold 502 text boxes in their body (3,418 words, of which at most 413 reached the Markdown); 3,340 do now, the rest being a word split across two runs, which the Markdown joins, smart-tag runs, which the body drops too, and one shape whose fallback differs from it. 189 files change output; theoconvDocxToIrmodule now depends ondocxStructure.
[1.2.0] - 2026-11-02
Added
- A docx table of contents, opt-in.
oconvDocxToIr.docxToIr(read, { include: ['toc'] })reads a table of contents control (w:docPartObjgalleryTable of Contents) in place as one paragraph per entry, the text the document shows (page numbers included, links not), as the odt reader'sinclude: ['toc']; the facade forwardsdocxInclude(another format:oconv: docx include needs format docx; a bad value:oconv: bad docx include). Without it nothing changes. Measured on the 1,491 wild docx: the 28block/droppedtoclosses (27 files) go to 0 with the option, 26 files gaining their entries (the 27th's table of contents is a tracked deletion, which shows nothing); without it no output moves. - An ODT table of contents, opt-in.
toMd's newodtIncludeinput (odtonly;oconvOdtToIr.odtToIr'sopts.include):['toc']reads a table of contents' entries and title as paragraphs at its place, as the document shows them (page numbers kept, links not). Without it the table of contents is dropped as before (block/dropped). On the ODF 1.4 specification ODTs the words missing against their HTML text fall from 357 / 16,214 / 5,212 (parts 2 / 3 / 4) to 42 / 1,306 / 2,995. New errors on the new input only:oconv: bad odt include,oconv: odt include needs format odt. - Inference on an untagged PDF, opt-in.
toMd's newpdfInferinput (pdfonly;oconvPdfToIr.pdfToIr'sopts.infer) turns on, by name, what the text-first read does not do on the untagged path:['headings']makes a short line set larger than the body text, or a short line set wholly in bold, a heading, its level ranked by size;['tables']reads a table drawn with rules (a grid of crossing lines) and a block of lines whose short pieces align in columns;['running']leaves out running headers and footers: on a PDF of 3 pages or more, a line in the top or bottom 12 % of the page whose text, each run of digits read as#, recurs within 2 pt of one height on half the pages (and 3) is left out of every page, recorded by the new losstext/running-dropped(its pattern; pypdf-benchmarks: 0.9287 → 0.9300). Without the input the read is unchanged (tier 1, text-first); a tagged PDF keeps its own structure. New errors on the new input only:oconv: bad pdf infer,oconv: pdf infer needs format pdf. The pdf font decoder and the extracted text pieces gainbold; the page extraction collects, on request (opts.rules), the page's rules (stroked straight segments, thin filled rectangles) as items{ kind: 'rule', x0, y0, x1, y1 }. - The untagged pdf structure declared, opt-in.
toMd's newpdfDeclareinput (pdfonly;oconvPdfToIr.pdfToIr'sopts.declare):['positional']records onestruct/positionalloss when the untagged path built the structure from positioning (the detail names what:paragraphs,headings,tables). Without it, every result is unchanged. New errors on the new input only:oconv: bad pdf declare,oconv: pdf declare needs format pdf. - Pictures from a PDF, opt-in.
toMd's newpdfIncludeinput (pdfonly;oconvPdfToIr.pdfToIr'sopts.include,oconvPdfTextExtract'sopts.images):['images']places each JPEG or JPEG 2000 (JP2) image XObject, and each DeviceGray, DeviceRGB, ICCBased or Indexed raw-pixel one written as a PNG by the newoconvPdfImagePng(1–16 bits, a same-size soft mask or a colour-key mask as alpha, the ICC profile iniCCP), a page's or a form's, as an IRimagewhere it is drawn (on a tagged PDF, with the struct element that lists it), its bytes inescapes.pdfand intoMd'sassets; a mask not applied is recorded as the newimage/mask-dropped; every other picture keepsimage/dropped. The default read is unchanged. The docx, odt, md and pdf writers readescapes.pdfafterescapes.docxandescapes.odt. New errors on the new input only:oconv: bad pdf include,oconv: pdf include needs format pdf. - Line-end hyphens in a PDF, opt-in.
toMdtakespdfLineHyphens(pdfonly;oconvPdfToIr.pdfToIr'sopts.lineHyphens):'drop'joins a word a hyphen cuts at a line end without the hyphen (information),'keep'with it (infor-mation); by default it staysinfor- mation, which opendataloader-bench's ground truth prefers. New errors on the new input only:oconv: bad pdf line hyphens,oconv: pdf line hyphens needs format pdf. - Encrypted and damaged PDFs, opt-in.
toMdtakespdfPassword(a string or bytes, the user or owner password,''for an empty user password) andpdfRecoverXref(truerebuilds an unusable cross-reference chain), bothpdfonly and forwarded topdf.read, which already supported them; an encrypted PDF could not be converted before. With a password, oconv also passes pdf's read-onlypdfLegacyRc4Read(thelegacyRc4read option), so an RC4-encrypted PDF (V1 / V2, 40- or 128-bit) opens as well; oconv now composes that module (@awacloud/pdf/extra/legacy-rc4-read.js). New errors on the new inputs only:oconv: pdf password needs format pdf,oconv: pdf recover xref needs format pdf,oconv: bad pdf recover xref. WithoutpdfPasswordan encrypted PDF still throwspdf/document/encrypted; without either input the read is unchanged. - Spreadsheet sheets as CSV or TSV, opt-in.
toMd's newsheetsinput (xlsxandods; the readers'opts.sheets):'csv'or'tsv'writes each sheet as one fencedcsv/tsvblock under its heading instead of a GFM table (RFC 4180 quoting; tsv escapes recorded as the newsheet/tsv-escaped).'table', the default, leaves every result unchanged. New errors on the new input only:oconv: bad sheets,oconv: sheets needs format xlsx or ods. - A cell budget for wide sheets, opt-in.
toMdtakessheetCellBudget(xlsx/odsonly; the readers'opts.cellBudget): a sheet whose padded table would hold more cells — one very wide row pads every other row to its width — is written unpadded instead, one<A1 address>: <text>paragraph per value (its rows unpadded undersheets'csv'/'tsv'), recorded by the new losssheet/sparse-form; every value is kept and the memory follows the values, not the padding. Without the input no budget applies and every sheet is padded as before. New errors on the new input only:oconv: bad cell budget,oconv: sheet cell budget needs format xlsx or ods. - Archive limits per call, opt-in.
toMdtakesarchiveLimits(office sources only):{ maxParts, maxUncompressed, maxRatio, maxDepth }, any of them, passed to the docx, xlsx, pptx, odt, ods or odp reader, so a caller can read a large deck or a workbook that inflates past the readers' defaults; the ODF readers take the first three. Without the input each reader keeps its own defaults. New errors on the new input only:oconv: bad archive limits,oconv: archive limits need an office source. - An output budget, opt-in.
toMdtakesoutputBudget: { bytes, overflow }(every source): after the read and before the render, the UTF-8 size of the IR's text is compared withbytes, with an early stop, so a caller can refuse, or cut, a small file that expands to gigabytes of text before the render runs out of memory. Past the budget,overflow'throw'(when absent) throwsoconv: output too large;'truncate'keeps the top-level blocks and a crossing table's leading rows that fit, recorded by the new lossdoc/truncated. Without the input no budget applies and the output is unchanged. New error on the new input only:oconv: bad output budget. - A compact front matter, opt-in.
toMd'sopts(forwarded toirToMd) takesfrontMatter:'compact'writes the loss ledger with one entry per distinct(code, detail)and itscount;'none'writes the body alone. The default ('full') is unchanged. New error on the new option only:oconv: bad front matter.
Changed
toMdstates the source's own title in the front matter. When a source states a non-empty title,toMdwritestitle:right aftersourceName, trimmed: for a pdf its XMPdc:title(x-defaultfirst), else its Info/Title, decoded (pdfInfo.decodeTextString,pdfXmpExtended.dcTitleandpdfFilterDispatch, which oconv now composes, the XMP module from@awacloud/pdf/extra/xmp-extended.js); for a docx, xlsx or pptx from its core properties (opcCoreProperties, new in@awacloud/ooxml); for an odt, ods or odp from itsmeta.xml.oconvIrToMdwrites it frommeta.title. The profile staysv1and no other byte of the output moves: a consumer that compares front matter byte for byte sees one more key where a title is stated. Measured on 1,119 public PDFs: 334 state a title; on the 2,972 wild office files: 654 outputs gain the key (207 docx, 395 pptx — about 300 of them an application placeholder such asPowerPoint Presentation—, 6 xlsx, 21 odt, 25 ods).- A dropped PDF picture is named by its object and size. The
image/droppeddetail of a PDF read was the resource name alone, a label local to one page's resources: two different pictures both calledIm1counted as one infrontMatter: 'compact'(and convert'slossSummary), and nothing told a decorative glyph from a figure. It is now<name> (<num> <gen> R, <w>x<h>)(Im1 (12 0 R, 1103x599)),inline (<w>x<h>)for an inline image; the ledger still holds one entry per draw. Measured on 1,119 public PDFs: 496 entries, unchanged in number, now naming 323 pictures by their object, none under two names. - odt emphasis and nested numbering read.
toMdandconvertread odt with@awacloud/odf'ssemanticStyles: the bold, italic, strike or monospace a style states reaches the output even when the style holds more (an rsid, a size, a colour, Asian variants) or inherits it, and a nested unstyled list takes its ancestor's numbering — fewerrun/format-unresolved, nolist/numbering-unresolvedfor such lists. - pptx pictures carried.
toMdof a pptx (oconvPptxToIr) now places each slide picture as a Markdown image at its place among the slide's body paragraphs, its bytes inassets(namedimage<k>.<ext>per distinct picture of the deck, alt text from the picture's description) instead of recordingslides/media-dropped; a linked picture recordsimage/bytes-unavailable. A deck of pictures no longer converts to an empty body. Tables, charts and other graphic frames are still dropped. The writers read the newescapes.pptxafterescapes.docx,.odtand.pdf.
Fixed
- A body-level content control is read, not dropped. The docx
reader recorded
block/dropped(detailblockSdt) for a block-level content control and dropped its content: cover pages, form and date fields, bibliographies, repeating sections (100 controls in 75 wild docx). Its paragraphs, tables and nested controls are now read in place, in the body and in a cell. A table of contents control is still dropped, as the odt reader drops one by default, its loss now naming it (block/dropped, detailtoc). - Range markup between blocks is not a dropped block. The docx reader
skips the bookmarks, comment ranges, revision range markers and other
range markup
@awacloud/ooxmlnow reads between blocks without ablock/droppedloss and without closing an open list; the Markdown of the 1,491 wild docx is unchanged. - Tracked moves and links inside insertions reach the Markdown. The
docx reader reads a move destination (
moveTo) as accepted, like an insertion, and drops a move source (moveFrom) like a deletion; with@awacloud/ooxmlnow typing every child of a tracked change, a hyperlink inside an insertion keeps its link. - Nested docx lists keep their levels. The docx reader flattened
every list paragraph at
ilvl > 0into its group's single-level list (list/nesting-flattened). It now builds the list tree by level, each list ordered by its own level's numbering format, a deeper paragraph of anothernumIdnesting in the open list (as the docx writer and Word lay it out);list/nesting-flattenedis no longer emitted. Over the wild docx, 21 outputs change, each gaining its levels. - Distinct docx pictures no longer share an asset. The docx reader
named an image after its drawing name, which a document may repeat:
the
toMdasset list, keyed by name, then kept the first picture's bytes only, and the odt writer's unique frame names renamed the others. The first image of a name now keeps it, a later one takes the first free<name> (k). Over the wild docx, 8 outputs change, 3 of them regaining pictures the asset list lost. - A docx table without a row is skipped, and an odt one is not
written. The odt writer wrote a table of one empty cell for a table
without a row (ODF needs a row), which the return reading showed as an
empty table; it now writes nothing, and the docx reader skips such a
table without a loss, as it skips an empty paragraph (the Markdown
writer left two blank lines for it). With
@awacloud/ooxmlreading the cells of a content control in place, a docx table whose cells sit in content controls now reads its text. - An empty odt paragraph is a spacer, as in docx. The odt reader kept
an empty paragraph as an empty IR paragraph, which the Markdown writer
wrote as extra blank lines (and, in a table cell, as an empty
;segment); the docx reader skips it. It now skips it too, without a loss, wherever blocks are walked, and a paragraph of only an empty text run or span (which the odt reader used to map to an empty IR run, so thatodt → docxwrote a blank line) is skipped the same way. Over the 319 wild odt, 168 bodies change: 164 by blank lines or spaces only, 4 by an empty cell segment less. - A heading alone in an odt list item reads as a heading. LibreOffice
writes a numbered heading as a heading in a list item; the odt reader
kept a list item holding the heading (
1. # Title), while the docx reader reads a numbered heading as a heading. The list now gives such headings up at their place, split around them, without a loss (7 wild odt change). - A docx list item that does not open with a paragraph keeps its
marker. The docx writer wrote nothing for a list item with no block
and only the nested list of an item opening with one, which the return
reading folded into the previous item; every docx write,
fromMdincluded, now writes an empty numbered paragraph first for such an item. - An image without bytes survives the docx and odt writers. Both
writers dropped an image they had no bytes for (
image/dropped): a docx chart, shape, group or SmartArt (an image reference without bytes on read), or a Markdown image with no asset. The odt writer now keeps its place as a frame with no content child, in the default 2 in × 1.5 in box, with its name and alt text; the docx writer, as a placeholder picture named after it (a drawing in a box of the same size, with no media part). Each records the new lossimage/placeholder, and the reader reads the placeholder back as the image reference (image/bytes-unavailable), somd → odt → md,docx → odt → mdandmd → docx → mdkeep it. Any other odt frame without an image (a text box, an object, a plugin) is unchanged. - An image's name survives an odt write. The odt writer now writes
the IR image name as the frame's
draw:name, unique per document (a later frame of a name already used takes<name> (2),(3)…; an empty name writes none), so docx / md → odt → md keeps the asset name instead of renaming it after its picture path (image1.gif). - Task markers survive md → docx / odt → md. The docx and odt
writers draw a GFM task item as a leading
☐/☒run; the docx and odt readers now read a list item whose first run leads with that marker asescapes.md.task('unchecked'/'checked'), the marker stripped, so- [x] donecomes back as itself instead of- ☒ done. The glyph with no space, after other text, outside a list, or☑stays text. - A list or a table inside a table cell is written. The Markdown writer
dropped it (
block/droppedtable cell list/table cell table): a GFM cell holds no block. Its text is now written inline, its pieces joined by;(recordedinline/flattened); other blocks a cell cannot hold are still dropped. - A CFF caller face no longer makes the pdf writer throw. A face given
in
opts.pdf.fontsordefaultFacesthat has no TrueType outlines (a CFF / CFF2 OpenType face, whichsubsetForPdfcannot subset) used to makefromMd/convertto pdf throwfonts/subset-bad-font; its style class now falls back to Standard 14 and recordslayout/font-fallbackwithreason: 'no TrueType outlines'. The measurer lists such classes inunembeddable. - An ODT heading shows its outline number. A heading numbered by the
document's outline style (
1.3 Normative References) was written without its number, while a cross-reference to it (kept, see below) shows it. The odt read now writes the number an office suite shows (formats1,a,A,i,I, prefix, suffix, displayed levels, restarts, list headers) before the heading text, so the heading's text and anchor change (1-3-normative-references). On the ODF 1.4 specification ODTs the words missing against their HTML text fall from 492 / 23,003 / 6,772 (parts 2 / 3 / 4) to 357 / 16,214 / 5,212. - An ODT cross-reference or field keeps its text. Outside a span, an
inline element of a paragraph, heading or link (
text:reference-ref,text:user-field-get,text:sequence…) was dropped with its text (inline/dropped): a cross-reference lost the section number it shows. The odt read now asks@awacloud/odffor these elements in place (elementsInRuns), and one holding text keeps that text (inline/flattened), as inside a span. On the ODF 1.4 specification ODTs the words missing against their HTML text fall from 810 / 63,512 / 11,393 (parts 2 / 3 / 4) to 492 / 23,003 / 6,772. - An ODT section's content is read. The odt reader mapped a
text:sectionto nothing (block/droppedtext:section); its blocks are now read in place, nested sections too (its name and style are not carried: the IR has no section node). - A soft hyphen ending a PDF line joins the word. A soft hyphen
(U+00AD) marks where a word was hyphenated; at a line end the reader
kept it, invisible, followed by a space. It is now dropped and the
word joined (
infor+mation→information), on both paths. - Tagged PDFs read in structure order, with their lists and tables.
The tagged path walks the structure tree in
/Korder (the newtreeofoconvPdfStruct.readStructure, its tags mapped through the/RoleMap): an inlineSpan,LinkorNotestays in place in its paragraph (it used to come out as a paragraph of its own after it, a word split across two ids cut by a space), a list's lead-in stays before it, anLbecomes a list (marker labels dropped, a numeric one ordering it) and aTablewithTRrows a table with its header rows, where both used to be flattened into paragraphs withstruct/dropped. ATablewithout aTRrow keeps that flattening. Measured on the 336 tagged veraPDF-corpus files: 49 tables, 56 lists,struct/dropped106 → 0, no file failing, no text lost but the dropped list numbers and one id referenced twice, no longer repeated. - A tagged PDF's lines no longer glue their words. The tagged path
concatenated the pieces of one marked-content sequence, so the last word
of a line and the first of the next stuck together (
programmesthat) at every line wrap inside a paragraph. The pieces are now joined like the untagged path's: a line wrap is one space, a same-line gap over 0.15 em too. The text of tagged documents changes; untagged documents are unchanged.
[1.1.0] - 2026-10-21
Added
- GFM task-list checkboxes reach docx, odt and markdown. The md
reader carries a task item's
[ ]/[x]inlistItem.escapes.md({ task: 'unchecked' }/{ task: 'checked' }) instead of dropping it.fromMdto docx or odt writes it as a leading☐/☒run of the item's first paragraph; the markdown writer writes[ ]/[x]back. The pdf writer draws the glyph when the regular face covers it: the pdf measurer gainscovers(text, style), which says whether a style's face draws every character of a string. - PNG images in pdf.
fromMd/convertto pdf place PNG images, where they were refused: a colour type 0 or 2 PNG embeds itsIDATstream as/FlateDecodebehind a PNG predictor; a palette, alpha or colour-key PNG is decoded (the inflate bounded by the size its header declares, 64 MiB at most) into its colour samples and an/SMask. An interlaced or malformed PNG is still refused (layout/image-dropped,format: 'png').oconvIrToPdfgains fwzlibas an optional dependency (standard14Lookup, below, comes after it); a hand-wired factory call without it refuses the decoded PNG kinds as before. Release note: a PNG that used to be refused withlayout/image-droppedis now drawn, so that record leaves the ledger and the pdf bytes of such a document change. - Code blocks, quotes and rules in odt.
fromMd/convertto odt write a code block asPreformatted Textparagraphs, one per line, its indentation kept astext:sspaces; a quote's paragraphs asQuotationsparagraphs; a thematic break as an emptyHorizontal Lineparagraph — LibreOffice's own style names, added to the fixed styles part. Theblock/degraded(codeBlock,blockquote) andblock/dropped(hr) losses are no longer recorded on this target; what odt cannot nest recordsblock/degradedblockquote:nestedorblockquote-child:<kind>.toMd/convertfrom odt read consecutivePreformatted Textparagraphs as one fenced code block, consecutiveQuotationsparagraphs as one blockquote and an emptyHorizontal Lineparagraph as a thematic break (also through an automatic style's parent), where they read as plain paragraphs. Release note: a ledger consumer that matched the retired records no longer sees them, and the.odtbytes of a document with a code block, a quote or a rule change. - Images keep their own size and their alt text in docx and odt.
fromMd/convertto docx and odt place an image at the size its header gives — PNG (pHYsresolution), JPEG (JFIF density) or GIF, 96 dpi when the file states none, scaled down to fit 6 in × 8 in — and write its alt text as the docx picture description or the odt frame title, both read back as the alt.image/size-defaultedis now recorded only for a header that gives no size (the default box is kept for it). Release note: every placed image used to sit in the default box and recordimage/size-defaulted; the record now marks the exception, and the size of every image in a.docxor.odtwritten byfromMdorconvertchanges. - Code blocks, quotes and rules in docx.
fromMd/convertto docx write a code block as oneSourceCodeparagraph (Courier New, a line break between source lines), a quote's paragraphs asBlockTextparagraphs and a thematic break as an emptyHorizontalRuleparagraph with a bottom border; the three styles join the fixed styles part. Theblock/degraded(codeBlock,blockquote) andblock/dropped(hr) losses are no longer recorded on this target; what docx cannot nest recordsblock/degradedblockquote:nestedorblockquote-child:<kind>. A code block's info string is not written. Release note: a ledger consumer that matched the retired records no longer sees them, and the.docxbytes of a document with a code block, a quote or a rule change. - docx code blocks, quotes and rules are read.
toMd/convertfrom docx read a paragraph styledSource Codeas a fenced code block (line breaks and tabs kept), consecutive paragraphs styledBlock Text,QuoteorIntense Quoteas one blockquote, and an emptyHorizontal Ruleparagraph as a thematic break — by the style's built-in name, else by its ID, so pandoc's docx output resolves too. Such paragraphs used to read as plain paragraphs. - odt images reach the IR. An image frame of an
.odtsource (read with@awacloud/odf'sframesInRuns, asoconvdoes) becomes an IRimageat its place:name= the frame'sdraw:name, else the picture path's basename;alt= its title, else its description; the picture part's bytes travel in the newescapes.odt({ bytes, contentType }). Every writer reads them afterescapes.docx, sotoMdlists the image as an asset andconvertfrom odt places it in docx, odt and pdf, where it used to recordimage/unresolved. A missing or external picture part recordsimage/bytes-unavailable(the reference is kept); an image inside a link recordsinline/dropped(detaillink-target). Text-box and object frames still recordimage/unresolved.
Changed
- Standard 14 font dictionaries carry their metrics. PDF 2.0
requires
FirstChar,LastChar,WidthsandFontDescriptorin every simple font dictionary; the pdf target's Standard 14 route now registers its faces with@awacloud/pdf's opt-instandard14metrics (oconvIrToPdfgainsstandard14Lookupas its last, optional dependency; a hand-wired call without it writes the bare dictionaries). Every Standard 14.pdfoutput gains these keys and one font descriptor per face. Release note: the bytes of every.pdfthat uses a Standard 14 face change; a stored hash of such an output is re-baselined. .pdfoutput carries an/ID. PDF 2.0 requires the trailer/ID, which the pdf target never wrote;@awacloud/pdf's writer now derives it from the written bytes, so everyfromMdandconvert.pdfoutput gains it and stays byte-reproducible. Release note: the bytes of every.pdfoutput change..odtoutput is byte-reproducible. Every zip entry of an.odtwritten byfromMdor byconvert(docx → odt) now carries the fixed date 1980-01-01 00:00 that@awacloud/odfstamps, where it carried the time of the write; two identical calls give identical bytes, as the.docxand.pdftargets already did. Release note: the bytes of every.odtoutput change (the entry dates); a stored hash of an.odtoutput is re-baselined once.list/task-marker-droppedis recorded by the writers, not the md reader.fromMdto docx and odt no longer records it. On pdf the Standard 14 faces and the Liberation pack have no ☐ / ☒ glyph, so the list renderer records it once per task item (with the block'sindexandkind, after the reader's losses); every writer records it for a task item whose first block is not a paragraph. Release note: a ledger consumer that matchedlist/task-marker-droppedon a docx or odt output no longer sees it; on pdf it still does, after the reader's losses.
Fixed
- pdf → Markdown reads fonts whose
/Encodingis indirect. A simple font whose/Encoding(or the/Differences//BaseEncodinginside it) is an indirect reference — what pdfLaTeX writes on every Type 1 font, so most arXiv papers — failed to build a decoder: every string shown in it was counted undecodable and the font recorded astext/font-unresolved, sotoMdreturned almost no text for such documents. The reader now resolves these references before reading the encoding; such documents gain their text. - Image assets keyed by the destination as written.
fromMdlookedassetsup by the destination as the Markdown reader normalises it, so a destination in angle brackets or with a non-ASCII character (,) missed the key the documentation names (my diagram.png,café.png) and the image was dropped — in particular every docx picture whose name holds a space, written back bytoMdas<Grafik 1>. After an exact miss the docx, odt and pdf writers now look the percent-decoded name up; a key that matched before still wins. - No spurious line overflow in pdf. The md → pdf typesetter compared a
line's width to its column strictly, so a token measured equal to its
column within floating-point noise (a table header cell such as
"Center": 34.837 against 34.83699999999999) recorded a
layout/line-overflowand could wrap a fitting word. A line now fits within 1e-6 pt of its column; a real overflow is recorded as before. - Table header cells keep each run's face in pdf. A header cell was
drawn in one class, so a cell mixing italic and roman runs lost its
italics and inline code its monospace face. Each run is now bold, bold
italic, or monospace as it should be.
oconvPdfLinebreak.tokenize/breakInlinesaccept a function asstyleOverride(one class per run) besides the string form. - An empty fenced code block is accounted. Its renderer returns an
explicit
height: 0, which declares the block empty, sooconvPdfStack.unaccountedno longer reports a document made of one empty fence; a renderer that returns nothing without stating a height is still reported. - A refused image names its format.
layout/image-droppednow carriesformatfor a GIF, WebP, BMP, TIFF or a refused (CMYK) JPEG, from the signature, and failing that from the content type a reader carried with the bytes (image/gif→gif); it was missing for every refusal but a PNG of colour type 0 or 2. - odt frames inside links are recorded.
oconvnow reads.odtwith@awacloud/odf'sframesInRunsoption, andodtToIrmaps aframerun like the raw frame it replaces (image/unresolved, a span frame's text kept; an image frame is read into the IR, above). A frame inside a link — silently dropped before — is now recorded: an image frame asinline/dropped(detaillink-target), any other frame asimage/unresolved; frame losses follow document order. A result read without the option maps as before. - A link's fields and references keep their text.
odtToIrignored a link run's own untyped children (a field, a reference or a bookmark inside a<text:a>), so their text vanished with no loss recorded. They now follow the span field-text rule — the text kept as a run carrying the link (inline/flattened), an empty element recordedinline/dropped. - Hard line breaks reach markdown.
toMdwrote a line break of the source (an odttext:line-break, a\nin an IR run) as a bare newline, a CommonMark soft break that renders as a space, with no loss recorded. A paragraph now writes a hard break (a backslash at the end of the line); a heading or a table cell, which cannot hold one, writes a space and recordsinline/linebreak-degraded. - Markdown block quotes end cleanly.
toMdno longer ends a block quote with a bare>line (an@awacloud/mdrenderMarkdownfix); the next block follows after a blank line. Same document once parsed.
[1.0.0] - 2026-10-07
Added
- Versioned pivot IR (
oconv-ir/v1) and its helpers — the readers produce, and the writers consume, this single intermediate representation.oconvIr.node/oconvIr.docbuild nodes with their frozen defaults, andoconvIr.validatenever throws: it returns{ ok, errors }, each error carrying a stable code (unknown-kind,not-an-object,bad-prop,bad-children,unexpected-children,bad-child,bad-escapes). toMd— convert a.docx,.odt,.xlsx,.ods,.pptx,.odpor.pdfdocument to the structured-markdown profile, returning rendered CommonMark/GFM, a section anchor index, a deduplicated asset manifest and a machine-readable loss ledger ({ code, detail }records, reader losses then writer losses, document order). Format detection falls back to the file name extension when not given explicitly, andpptx/odpsources accept an opt-inincludeNotesflag rendering speaker notes as a trailing blockquote per slide.formOpBudgetoption —oconvPdfTextExtract.extractPageandoconvPdfToIr.pdfToIrtake an optionalopts.formOpBudget, andoconv.toMda top-levelformOpBudgetinput field (pdfsource only), making the per-page Form XObject operator budget configurable. Default1000000; a supplied value must satisfyNumber.isSafeInteger(v) && v >= 1, elseoconv: bad form op budget; supplying it for a non-pdftoMdsource throwsoconv: form op budget needs format pdf. The default and thexobject/form-budgetloss semantics are unchanged.fromMd— convert a structured-markdown or plain CommonMark/GFM document to.docx,.odtor.pdf, target resolved explicitly or from the output file name extension. The.pdftarget accepts a bounded typesetter option block (opts.pdf: page size, margins, base type size, leading, heading scale, code size, page numbers, per-face font programs) and JPEG image placement from a caller-suppliedassetsmap keyed by the markdown image destination. A leading front-matter fence is stripped and recorded as afrontmatter/strippedloss rather than parsed or carried into the target.- md→docx emits
word/styles.xmland bordered tables. Every.docxwritten byfromMd(and byconvert's→ docxtarget) carries a fixed built-in styles part —Normal,Heading1–Heading6(bold, sized) andTableGrid— so every referenced paragraph style is defined, and every table carries theTableGridstyle reference plus direct single borders. The set is fixed and caller-invisible: no option, no loss code,hrstaysblock/dropped, and tier 3 (caller styling) is not promised. - md→odt emits
styles.xml, named headings and bordered tables. Every.odtwritten byfromMd(and byconvert's→ odttarget) carries a fixed built-in styles part —Standard,Text body,HeadingandHeading 1–Heading 6(bold, sized 16/14/13/12/11/11 pt, the same sizes as the docx target) — every heading names itsHeading_20_<level>style, every table is written withgrid: true(bordered cells and a margins-aligned table synthesised by@awacloud/odf), and list levels carry the label-alignment geometry. The set is fixed and caller-invisible: no option, no loss code, and tier 3 (caller styling) is not promised. convert— direct cross-format conversion for the allowlisted pairsdocx→odt,odt→docx,docx→pdfandodt→pdf, composing the same reader and writer pipeline astoMd/fromMdback to back without an intermediate markdown round-trip.- Optional default-face tier for the
.pdfwriter — registering an fw module namedoconvDefaultFacesat a version above the package's built-in0.0.0stand-in (for example the@awacloud/oconv-fontspack) supplies default fonts for the typesetter with no dependency on any face package; when no such module is registered, the typesetter falls back to its Standard 14 metrics. - Worker entry (
./src/worker.js) running the same conversions inside a dedicatedWorkerthread, one conversion per message: atoMdmessage ({ id, name, bytes, at }), afromMdmessage ({ id, name, markdown, target, opts, assets, defaultFaces }) and aconvertmessage ({ id, name, bytes, format, target, includeNotes, opts, defaultFaces }) are distinguished automatically from the payload shape. Errors come back as data (errora string, not thrown across the worker boundary). - Worker entry sub-path export — the Worker entry is importable as
@awacloud/oconv/src/worker.js, resolving to the same file under anexports-aware resolver and under a browser import map whose@awacloud/oconv/prefix points at the package root. - fw module manifest (
fw_require,pkg_require,modules, plus the emptyextrasandbundle) composing the readers, writers and facade with@awacloud/ooxml,@awacloud/odf,@awacloud/md,@awacloud/pdfand@awacloud/fonts, so a consumer registers this package's whole dependency graph in its own fwModuleRuntimeby registeringfw_requireandmodules. - Two
.pdfwriter loss codes —inline/strike-droppedandinline/code-emphasis-dropped. The typesetter draws no strikethrough rule and keeps one style class per run, so a struck run, or a bold or italic code run, was drawn plain with no record. The line breaker now records each, one record per text block withdetail{ runs, text }; the drawn page bytes are unchanged (recorded, not rendered). heading/subtitle-degraded— a newdocx → mdloss code: a paragraph styledSubtitleis kept as a plain paragraph, and the record'sdetailis its style ID.- Worker replies carry
losses. ThetoMd,fromMdandconvertreplies gain alosseskey, the facade's{ code, detail }ledger verbatim ([]on error);warningsstays its length. Additive: the request envelopes and every existing reply key are unchanged. - Apache POI licence files beside the fixtures. The Apache POI
NOTICEand the Apache-2.0 licence text now sit undertests/_fixtures/corpus/, next to the vendored.docx,.xlsxand.pptxtest documents they cover. inline/flattened— a newodt → mdloss code: an element inside a text span (a field or a cross-reference, for example) whose text is kept but whose meaning is not;detailnames the element.
Changed
-
md → odt and docx → odt place images. The
.odtwriter now writes every image whose bytes are reachable (the caller'sassetsmap, else the bytes the docx reader carried) as aPictures/part in a 2 in × 1.5 in (5.08 cm × 3.81 cm) inline frame and recordsimage/size-defaulted, as the.docxwriter does; it used to drop them. An image with no reachable bytes is still dropped and recorded asimage/dropped. Read back throughtoMd, the written frame comes back asimage/unresolved(detaildraw:frame). -
The
.docxoutput is byte-reproducible, and tests pin it. Thedocxtarget offromMdand theodt → docxpair ofconvertgive byte-identical output for the same input:@awacloud/ooxmlstamps every zip entry with the fixed 1980-01-01 00:00 timestamp. Theodttarget anddocx → odtare still not byte-reproducible (the ODF package writer stamps the current time). -
Loss matrix re-measured. It documents the
docxtarget andodt → docxas byte-reproducible (theodttarget stays not), the image placement of md → odt and docx → odt (default 2 in × 1.5 in frame,image/size-defaulted), the re-measuredpdf → mdresidual on three third-party PDFs (truncated content streams, no inflate failure left), and the Latin-only line breaking of md → pdf; internal labels are replaced by plain wording. -
Documentation pass. The README follows the published-package layout (Installation, Quick Start, package-specific sections, Exposed sub-paths, Maturity, Licence, Project) and its browser import map now lists every package the converter loads; a getting-started guide (
docs/guide/getting-started.md) is added; internal tracking references are removed from the README, this changelog and the API pages; the API pages' writer examples build their IR withoconvIr.node/oconvIr.docand were re-executed against the live package. -
Plain-terms documentation. Source documentation and reference pages state each rule in plain terms (internal design and decision labels removed).
Fixed
- The npm package ships
NOTICE. modulesis dependency-closed.@awacloud/md'smodulescarriesmdHtmlDocument, which depends on four of md's opt-inextras(mdToc,mdFrontmatter,mdFootnotes,mdAdmonitions), so resolving it through oconv's manifest threwModule not found: mdToc.modulesnow spreads md'sextrasright after md'smodules; the separatemdFrontmatterentry moved into that spread, and no descriptor name is listed twice.- md→docx table cells are padded. Cell text touched the grid lines in
Word: the fixed
TableGridstyle carried borders but no cell margins. The style and every table's directtblPrcarry Word's built-inTable Gridpadding, 108 twips (0.19 cm) left and right, through the typedtblPr.cellMarginsof@awacloud/ooxml(never_extras). No option, no loss code. - md→docx bullet glyph. The generated
word/numbering.xmlno longer pins theSymbolfont on bullet levels: every level writes the plain Unicode bullet U+2022 with norPr, so the bullet no longer renders as a missing-glyph box in viewers lacking the symbol font. Numbered lists are unchanged. toMdparagraphs that start a line with a block marker. Through@awacloud/md's Markdown renderer, a paragraph line starting with1.,1),-,+,*,#..######or>is escaped (1\. Step One,\# Ligne FACT), so the Markdown re-parses as the same paragraph instead of a list, heading or quote.pdf → mdword spacing — text pieces drawn separately on one line (one word perTj, table cells, list markers) no longer come back glued together. The reader places the end of every text piece from the font's glyph widths (/Widths, a composite font's/W+/DW, or the Standard 14 AFM metrics), following the text state (Tc,Tw,Tz,TJadjustments,'and"), and inserts one space where the gap to the next piece on the line exceeds 0.15 em. An existing space is never doubled, including across aTJkern gap. Positioned text items gain an additivexEndfield; a font whose widths cannot be read records the loss codetext/width-approximated.pdf → mdword spaces inside oneTJarray. ATJposition adjustment reads as a word space when it moves the text right by more than 0.15 em — the same threshold the line pass uses between two pieces — instead of only at 0.2 em or more. Justified lines whose inter-word kerns shrink to about 0.166 em no longer come back glued. An existing space is still never doubled.pdf → mdoverlapping or duplicate text pieces. A text piece that exactly repeats the previous piece of its line (same text, within 0.5 pt horizontally and vertically — a shadowed diagram label, a dot drawn twice) is kept once instead of being glued to its copy (Contrôler les autorisationsContrôler les autorisations). Any other piece that starts left of the previous piece's end by more than 0.15 em is separated from it by one space instead of glued; a smaller overlap (a kerned apostrophe) still joins.pdf → mdtext inside Form XObjects — text drawn inside a Form XObject (diagram labels, chart axes, reused page furniture) is extracted instead of dropped. The reader executes the form in place, under its/Matrixand its own/Resources(the page's when it has none), nested forms included; images inside a form still recordimage/dropped.xobject/form-droppedis recorded only for a form whose stream cannot be used, with the reason in its detail. Three loss codes keep the walk finite, and none of them throws:xobject/form-cycle(a form drawn from inside itself),xobject/form-depth(nesting deeper than 12 forms) andxobject/form-budget(more than 1,000,000 operators run inside forms on one page, configurable throughformOpBudget).- Documentation links resolve from the npm tarball. Links that pointed outside the package point at the public repository at this release's tag, so they resolve from the tarball.
- README maturity statement — it said
L1; the package isL3. - Accents on the Standard 14 route round-trip. The default
.pdfroute wrote CP1252 bytes but its font dictionaries named no encoding, so a reader decoded every byte from 0x80 up (accented letters, the em dash, the bullet markers) against the font's built-in encoding and lost or garbled it (Caféread backCafØ). Every Standard 14 font dictionary now names/Encoding /WinAnsiEncoding, and the characters written are the characters read back. - One numbering instance per list in the
.docxwriter. Every top-level list now gets its ownnumId, so two adjacent lists of the same kind stay two lists on re-read instead of merging into one (this also holds forodt → docx). A nested list shares its parent's instance. - No empty paragraphs from the
.odtwriter. A code block no longer writes a trailing empty paragraph, and a paragraph holding only an image the writer drops (no bytes reachable) no longer leaves an empty one. An empty paragraph collapses on the next Markdown parse, somd → odt → mdis now a stable normal form on every golden fixture, not onlymd-structural.md. toMdasset bytes. The asset manifest'sbytesfield was never populated from a real document, because the writer read a key no reader fills. It now reads the docx reader's image bytes, carried by reference (never written into the front matter).content/undecodablenames its cause. The record'sdetailwasstream <objNum>and is nowstream <objNum>: <cause>, the thrown error's message on one line, at most 160 characters.- Built-in heading names. The docx reader resolved headings only from
the style IDs
Heading1–Heading6. It now also reads each style's built-in name fromstyles.xml, so a localized ID such asTitre1gives its level, and aTitleparagraph becomes a level-1 heading. A document with no styles part keeps the ID rule alone. - The
.pdftypesetter stage pages run as pasted. Every example underdocs/api/write/pdf/is a self-contained session that builds its IR withoconvIr.node/oconvIr.doc(every example IR validates) and prints the values its comments state; internal design labels are replaced by plain wording. - README and guides on reproducibility, odt images and
docx.write. They no longer deny that the.docxoutput is byte-reproducible (thedocxtarget offromMdandodt → docxare; theodttarget anddocx → odtare not). The README and the profile page say theodttarget places images instead of dropping every one, and theoconvIrToDocxAPI page names the two explicit failures ofdocx.write(docx/hyperlink-missing-rid,docx/numbering-missing) instead of calling them silent drops. odt → mdkeeps the markup inside a text span. Spacing, tabs, line breaks, nested emphasis and links inside atext:spaneach come through; they used to be flattened into the span's plain text (B, three spaces,C, a tab,D, a line break and a boldnbcame back asBCDE nb F). The text of a field inside a span is kept and recorded asinline/flattened; a text-box frame inside a span keeps its text and recordsimage/unresolved.