sugarcube

Every PDF, faithfully converted.

Jexter reads a PDF into one clean model and writes it back out as PDF, EPUB, HTML, SVG, Markdown or DocTags. The result looks exactly like the original, and its structure comes with it.

A PDF page separated into three layers: rendering at the bottom, selectable text above it, and the recovered structure (numbered blocks in reading order) on top. Rendering the page as painted Text real, selectable fonts 12345 Structure reading order, headings

One model, every format

Jexter normalizes any PDF into the Open Canonical Document (OCD): one model where each page is stored in paint order. Every output is a projection of that model, so they all agree.

Jexter conversions: PDF or OCD-EPUB in, through the OCD model, to PDF, EPUB 3 fixed layout, SVG, EPUB reflowable, HTML, Markdown, DocTags, OCD-EPUB.

In

  • PDF
  • OCD-EPUB

OCD

Open Canonical Document

  • Faithful replicas

    look exactly like the source

    • PDF
    • EPUB 3 fixed layout
    • SVG
  • Reflowed for reading

    adapt to any screen

    • EPUB reflowable
    • HTML
  • Text for AI

    clean and in reading order, for LLM and RAG

    • Markdown
    • DocTags
  • The model itself

    lossless, a valid EPUB that reopens as OCD

    • OCD-EPUB

Rendering first, structure second. The look of the page may never regress; reading order, headings and paragraphs are recovered on top of it, by reference, without moving a single pixel.

Faithful to the last glyph

Fonts, kerning, rotation, vectors, dashes, gradients, blend modes, clipping and images, JBIG2 and JPEG 2000 included. EPUB output is validated with epubcheck.

Text you can select

Glyph outlines are rebuilt into embeddable fonts with a reverse character map, so every output stays searchable. Corrupt embedded fonts are repaired instead of falling back to Arial.

Structure and accessibility

Reading order by recursive XY-cut, headings and paragraphs by geometry; lists, tables, figures and captions from tagged PDF (PDF/UA). Alt text and language carry through to EPUB Accessibility 1.1.

Ready for language models

Markdown and DocTags outputs feed LLM and RAG pipelines with clean, ordered text. An optional LLM pass refines the structure where geometry alone is not enough.

Redaction you can prove

Is this PDF really redacted? Jexter finds the text still hiding under black boxes. Then it removes what lies under a zone (glyphs, vectors, image pixels) and exports only once the audit is clean.

Clean PDFs, in bulk

The normalizer turns crude PDFs into clean ones with selectable text: one file, a whole folder, or a hot folder that converts whatever lands in it.

Prism, in the browser

Prism, the Jexter web reader and workbench, opens in your browser from a local server: read, search and read aloud, reorganize and crop pages, redact, inspect the recovered structure, and export to every format. Your files stay on your machine.

Or one command

java -cp "lib/*:target/classes" \
    sugarcube.jexter.write.Conversion \
    report.pdf report.epub

Same entry point for every target: the format follows the output’s extension.

The same engine, as an API

sugarcloud.ch puts Jexter behind an HTTP API. Send a document, collect the result: every format the engine writes is available the day it ships. It succeeds 2up.ch, our PDF to EPUB conversion service since 2015.

  • Jobs are queued and survive a restart of the service.
  • Results can go straight to your own storage, through S3 or pre-signed URLs.
  • Every option of the engine is documented, and the documentation is checked against the running service.

Photos of pages, cleaned in your browser

ZigZag separates ink from paper under uneven light, shadows and yellowed paper. It won the best paper award at ACM DocEng 2024 and ranked first in the conference’s binarization competition.

No machine learning: two passes of local means over integral images, fast enough for a phone. Python, Java and JavaScript versions agree bit for bit. ZigZag is our third binarization algorithm, after FedLexBW (2016) and YinYang (2022).

A printed page photographed in poor light: warm cast, dark shadow over the lower right corner.

This page was photographed in poor light. Drag the line to compare. To try your own, take a photo of a document (a page, a letter, a receipt) and drop it on the picture, or choose it below: it is cleaned on your device and never uploaded.

Document engineering since 2011

Sugarcube Information Technology is a small software company in Fribourg. We build engines that read documents, and the tools around them: conversion, structure recovery, image processing.

We also build to order: document pipelines, analysis tools and web applications, from the research paper to the software that runs every day. Past work includes vote results pulled out of thousands of printed tables, legal notices detected in newspaper pages, and ImaproFX, a framework for teaching image processing. We write Java, JavaScript and Python.

Open source, with a commercial option

Jexter and ZigZag are free software under the GNU Affero General Public License v3. Use, modify and deploy them, including as an online service, as long as what you build on them is released under the same licence, with its source code.

For Jexter, a commercial licence lifts that obligation, so you can build it into a closed-source product or a proprietary service.

Ask for a commercial licence

  1. 2011 Sugarcube Information Technology is founded in Fribourg.
  2. 2012 XCDF, our first document format, predecessor of OCD.
  3. 2015 2up.ch, our online PDF to EPUB conversion service, opens.
  4. 2016 FedLex project: the scanned federal archives are cleaned by FedLexBW, our first binarization algorithm, and converted to OCD, read with XED.
  5. 2020 Dexter moves the platform to JavaFX.
  6. 2022 YinYang, our second binarization algorithm, succeeds FedLexBW.
  7. 2024 ZigZag wins the best paper award at ACM DocEng 2024.
  8. 2025 A new OCD and its OCD-EPUB container; everything rewritten from scratch in modern Java.
  9. 2026 Jexter and Prism, its web reader, released as open source; sugarcloud.ch, successor of 2up.ch, opens its conversion API.

Documents that resist?

Tell us what you need to convert, clean up or understand.

contact@sugarcube.ch