# Migrating Sozi Presentations to PDF

# Convert Sozi Presentations to PDF

Convert exported `.sozi.html` presentations into PDF files using the official Sozi exporter or a lightweight Node.js-based migration script.

## Overview

[Sozi](https://sozi.baierouge.fr/) is an SVG-based presentation tool that creates zooming and animated presentations. Presentations are typically exported as a single `.sozi.html` file.

If you need a printable, archivable, or shareable version, you can convert the presentation into a PDF.

## TL:DR

```bash
# Install exporter
npm install -g sozi-export

# Install pdfjam (macOS)
brew install texlive

# Convert presentation
sozi-to-pdf presentation.sozi.html presentation.pdf
```

Or use the lightweight alternative:

```bash
node sozi-pdf-migrations.js
```

## Option 1: Official Sozi Export

The recommended approach uses **sozi-export**, which understands Sozi's frame definitions and exports each frame exactly as designed.

### Prerequisites

Install:

- Node.js
- sozi-export
- pdfjam (included in TeX Live)

### Install Sozi Export

```bash
npm install -g sozi-export
```

### Install pdfjam

**macOS**

```bash
brew install texlive
```

**Ubuntu / Debian**

```bash
sudo apt install texlive-extra-utils
```

**Windows**

Install TeX Live:

https://www.tug.org/texlive/

### Convert a Presentation

```bash
sozi-to-pdf presentation.sozi.html presentation.pdf
```

Each Sozi frame becomes a separate PDF page.

### Batch Conversion

**macOS / Linux**

```bash
for f in *.sozi.html; do
  sozi-to-pdf "f""{f%.sozi.html}.pdf"
done
```

**Windows PowerShell**

```powershell
Get-ChildItem *.sozi.html | ForEach-Object {
  sozi-to-pdf .Name(_.Name -replace '\.sozi\.html$', '.pdf')
}
```

---

## Option 2 — Node.js Migration Script

If you already have **Node.js/npm** available and do not want to install **TeX Live** or **pdfjam**, you can use the custom migration script provided by LNC Docs Resources.

This provides a lightweight alternative for converting Sozi presentations to PDF using only npm-based tooling.

### Download

- [sozi-pdf-migrations.js](https://github.com/lucanoahcaprez/LNC-Docs-Resources/blob/main/tips-tricks/sozi-pdf-migrations.js)

### Usage

```bash
node sozi-pdf-migrations.js
```

> Use this approach when you want to avoid installing TeX Live and only require a Node.js-based solution.

---

## Troubleshooting

### pdfjam executable not found

Verify that `pdfjam` is installed:

```bash
which pdfjam
```

If required, add TeX binaries to your PATH:

```bash
export PATH="/Library/TeX/texbin:$PATH"
```

### Missing Frames

Ensure you convert the exported `.sozi.html` file and not the original `.svg` file.

**Correct**

```text
presentation.sozi.html
```

**Wrong**

```text
presentation.svg
```

### DeckTape Errors or Timeouts

Generic presentation exporters such as DeckTape do not provide native Sozi support and may produce detached-frame errors or timeout during export.

Use either:

```bash
sozi-to-pdf
```

or the provided

```bash
sozi-pdf-migrations.js
```

script instead.

---