How the ODT to PDF Converter Works
AnyTool ODT to PDF reads an OpenDocument Text file entirely in the browser with JSZip and builds the PDF with pdf-lib, both bundled into the app and served from the same origin — never loaded from a CDN — so the tool stays fully offline-capable and uploads nothing. An ODT file is a ZIP of XML parts, so the engine reads content.xml and parses it with DOMParser, walking office:document-content → office:body → office:text in document order. It maps text:h to headings (using the text:outline-level attribute for the level), text:p to paragraphs, text:list and its text:list-item children to bulleted or numbered list items (with nesting depth), table:table → table:table-row → table:table-cell to table grids, and draw:frame/draw:image (resolving the xlink:href into the Pictures/ folder) to embedded images. Inline structure is honoured: text:span carries character styles, and text:line-break, text:tab and text:s (with its text:c repeat count) are expanded. Bold and italic are resolved from the document’s styles — both content.xml’s office:automatic-styles and styles.xml’s named styles are scanned for fo:font-weight and fo:font-style on style:text-properties, following the style:parent-style-name chain. pdf-lib then embeds the standard fonts (Helvetica regular/bold/oblique/bold-oblique) and lays the blocks onto pages: text is word-wrapped to the content width using font.widthOfTextAtSize, advanced by a line height, and paginated when the cursor passes the bottom margin, with headings sized by level, lists given a hanging indent, tables drawn as bordered grids and images scaled to fit.
- ODT unzipped with JSZip; PDF built with pdf-lib — both bundled, no CDN
- content.xml parsed: office:text → text:h, text:p, text:list, table:table, draw:image
- Bold/italic resolved from automatic-styles + styles.xml via the parent-style chain
- Word-wrap via font.widthOfTextAtSize with line-height pagination
- JPEG/PNG images from Pictures/ embedded (embedJpg/embedPng) and scaled to fit
