.pptx(@awacloud/ooxml'spptx.read()result) →oconv-ir/v1, tier 1 — one heading + N paragraphs per slide.
Module oconvPptxToIr (oconvPptxToIr) | Source packages/front/office/oconv/src/read/pptx-to-ir.js | Deps oconvIr, pptx | Worker-safe yes
Pure transformation over an already-parsed pptx.read(bytes) structure. There is no "section" node in the frozen IR vocabulary, so each slide contributes a flat run of top-level blocks in slide order.
Resolve
import { ModuleRuntime } from '@awacloud/fw/core/runtime.js';
import { fw_require, modules } from '@awacloud/oconv';
const runtime = new ModuleRuntime();
runtime.registerAll(fw_require);
runtime.registerAll(modules);
const pptx = runtime.resolve('pptx');
const { pptxToIr } = runtime.resolve('oconvPptxToIr');
API
| Member | Signature | Returns | Throws |
|---|---|---|---|
pptxToIr |
(readResult: object, opts?: {includeNotes?: boolean}) => {ir, losses} |
ir — an oconv-ir/v1 document; losses — {code, detail}[] |
— |
Examples
Convert a .pptx read result to IR
const { ir, losses } = pptxToIr(pptx.read(bytes), { includeNotes: false });
ir.kind; // 'document'
Notes
- Title — the first shape whose
placeholder.typeis'title'or'ctrTitle'; a title shape present but carrying no non-empty text counts as "no title" (lossslides/untitled). - Body — every other shape carrying a
txBody, in shape order, one IRparagraphper non-empty text paragraph. includeNotesis a documented no-op for pptx:pptx.read()'s public return shape never surfaces speaker notes (nonotesfield on a slide, no relationship resolution tonotesSlide<n>.xml), so this reader never emits a notes blockquote and never recordsslides/notes-omittedfor pptx — the option is accepted only for frozen shape parity withoconvOdpToIr, whose underlying format does expose notes.- Loss codes this module emits:
slides/untitled,slides/media-dropped(apicture/table/chart/graphicFrameshape, detail = itstype),slides/notes-omitted(never actually reachable for pptx — see above). - Layout and animations (
layoutRef, transitions) are permanently out of scope and never reach a per-node loss —pptx.read()'s public result does not even model them.
See also
- docs/api/README.md — full module index +
exportsboundary note oconvIr— the pivot this reader producesoconvOdpToIr— the ODF sister reader (notes ARE reachable there)- loss matrix