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 engine, three ways in

Convert a document in your browser, call the engine from your own software, or run it yourself.

sugarcloud.ch

For your software

The engine behind an HTTP API, server to server. It succeeds 2up.ch, our PDF to EPUB service since 2015, and jexter.ch runs on it.

  • One request: the document is the body, the target and the options are the query.
  • Jobs are queued, survive a restart, and are seen by your key alone.
  • Every format the engine writes, the day it ships.

Read the API documentation Ask for an API key

Open source

For engineers

Jexter itself, under the AGPL: a Java library and command line, and Prism, its workbench in your browser. Your files stay on your machine.

  • One entry point for every format, in Java 21.
  • The OCD model and its container, specified.
  • A commercial licence for closed-source products.

Jexter on GitHub The OCD format

One PDF, read three ways

Real output, not a mock-up: a two-page report with a chart and a table, as it came out of jexter.ch.

The first page of the sample PDF: the title Lakeside Library — Annual Note 2026, two paragraphs, a bar chart and a table.
The PDF.
The same page in the jexter.ch reader, identical to the PDF, with a table of contents listing its four sections.
Replica EPUB: every page as printed, its text real, its contents found.
The same document on a phone, its text reflowed in large type, one column.
Reflowable EPUB: the same text, set for a phone.

Make this e-book yourself No file, no account: about five seconds.

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 Photo or scan or OCD-EPUB in, through the OCD model, to PDF, EPUB 3 fixed layout, SVG, EPUB reflowable, HTML, Markdown, DocTags, OCD-EPUB.

In

  • PDF
  • Photo or scan
  • 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.Conversion \
    report.pdf report.epub

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

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; jexter.ch opens its online tools.

Documents that resist?

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

contact@sugarcube.ch