MPDF — Media PDF

An open document format like PDF, but with animated GIFs.

Open Editor GitHub Specification

How it works

1

Create

Build your document with the MPDF tools or write it by hand.

2

Send

Share the .mpdf file via email, chat, or any file transfer.

3

Open

The recipient opens it in any browser. No install needed.

What it looks like

file:///documents/paper.mpdf

MPDF: Media PDF
Documents with Animated GIFs

Abstract

This document demonstrates the MPDF file format — an open standard for creating portable documents that support embedded animated GIF images.

1. Introduction

The Portable Document Format has been the standard for document exchange for over three decades. MPDF extends this paradigm with animated GIF support.

Animated GIF demo
Figure 1: An animated gradient bar demonstrating embedded GIF support.

Format at a glance

<!DOCTYPE mpdf>Own doctype — identifies the format
data-mpdf-versionVersioned format (currently 1.0)
mpdf: meta tagsStandardized metadata (title, author, date)
mpdf-* CSS classesDefined document structure
Standard stylesheetDeterministic rendering everywhere
No <script>Static document format — safe to open
Base64 data URIsAll media embedded inline — one file, no dependencies

Get started

Install via pip

pip install mpdf

Create a document

mpdf create -t "My Paper" -o doc.mpdf \
h1 "Title" text "Hello" gif fig.gif

Validate

mpdf validate doc.mpdf