Skip to main content

A converter utility for handling Newline whiteboard IWB files and converting them

Project description

Newline IWB Converter

GitHub License

A converter utility for extracting SVG pages from Newline whiteboard IWB files, with optional PDF conversion.

Features

  • Extract SVG pages from Newline IWB (.iwb) files
  • Convert IWB to PDF - create multi-page PDFs with independent or uniform page sizing
  • Flexible image handling:
    • Embed images as base64 data URIs (default)
    • Copy images directory alongside SVGs
    • Keep external image references
  • Optional fill removal from shape elements
  • Zero external dependencies for iwb2svg - uses only Python standard library for SVG extraction

Getting Started

Prerequisites

  • Python 3.10 or later
  • Ubuntu: Install Cairo with sudo apt install -y libcairo2-dev pkg-config python3-dev

Installation

pip install newline-iwb-converter

Usage

iwb2svg - Extract SVG Pages

Basic Usage

iwb2svg input.iwb -o output_directory

This will extract all SVG pages from the IWB file and embed images as base64 data URIs (default behavior).

Command Line Options

usage: iwb2svg [-h] [-o OUTPUT] [--fix-fills | --no-fix-fills] [--fix-size | --no-fix-size] [--images {nothing,copy_directory,data_uri}] [--delete-background] iwb_file

Extract SVG pages from an IWB file, with optional fill→stroke repair.

positional arguments:
  iwb_file              Path to input .iwb file

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output directory (default: svg_output)
  --fix-fills           Remove fill from shapes (default)
  --no-fix-fills        Do NOT modify fill behavior
  --fix-size            Fix SVG size if content extends beyond dimensions (default)
  --no-fix-size         Do NOT fix SVG size
  --images {nothing,copy_directory,data_uri}
                        How to handle images (default: data_uri)
  --delete-background   Remove background image elements

Examples

Embed images as data URIs (default):

iwb2svg input.iwb -o output_dir

Keep external image references:

iwb2svg input.iwb -o output_dir --images nothing

Copy images directory alongside SVGs:

iwb2svg input.iwb -o output_dir --images copy_directory

Don't remove fills from shapes:

iwb2svg input.iwb -o output_dir --no-fix-fills

Remove background images:

iwb2svg input.iwb -o output_dir --delete-background

Using uv run (without virtual environment activation):

uv run iwb2svg input.iwb -o output_dir

iwb2pdf - Convert to PDF

Basic Usage

iwb2pdf input.iwb -o output.pdf

This will extract all SVG pages and convert them to a multi-page PDF with independent page sizing.

Command Line Options

usage: iwb2pdf [-h] [-o OUTPUT] [--fix-fills | --no-fix-fills] [--fix-size | --no-fix-size] [--delete-background] [--uniform-size | --independent-size] iwb_file

Convert IWB files to PDF format.

positional arguments:
  iwb_file              Path to input .iwb file

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output PDF file (default: output.pdf)
  --fix-fills           Remove fill from shapes (default)
  --no-fix-fills        Do NOT modify fill behavior
  --fix-size            Fix SVG size if content extends beyond dimensions (default)
  --no-fix-size         Do NOT fix SVG size
  --delete-background   Remove background image elements
  --uniform-size        Make all pages the same size (size of the largest page)
  --independent-size    Each page size is independent based on its content (default)

Examples

Create PDF with independent page sizing (default):

iwb2pdf input.iwb -o output.pdf

Make all pages the same size:

iwb2pdf input.iwb -o output.pdf --uniform-size

Remove background images:

iwb2pdf input.iwb -o output.pdf --delete-background

Using uv run:

uv run iwb2pdf input.iwb -o output.pdf

Development

Getting Started

First, clone the repository and set up your development environment:

# Install UV package manager (https://github.com/astral-sh/uv)
# Then sync dependencies:
uv sync

Add Dependencies

uv add <package-name>

Install Dev Dependencies

uv sync --group dev

Package with PyInstaller

To create standalone executables:

# Install dev dependencies (if not already installed)
uv sync --group dev

# Build all executables (iwb2svg and iwb2pdf)
uv run python scripts/build_exec.py

# Or build a specific tool
uv run python scripts/build_exec.py iwb2svg
uv run python scripts/build_exec.py iwb2pdf

The executables will be created in the dist/ folder:

  • iwb2svg.exe / iwb2svg (Linux/macOS)
  • iwb2pdf.exe / iwb2pdf (Linux/macOS)

Project Structure

newline_iwb_converter/
├── src/
│   └── newline_iwb_converter/
│       ├── __init__.py
│       ├── iwb2svg.py          # SVG extraction utility
│       └── iwb2pdf.py          # PDF conversion utility
├── scripts/
│   └── build_exec.py                # PyInstaller build script
├── pyproject.toml               # Project configuration
├── README.md                    # This file
└── .python-version              # Python version lock

How It Works

iwb2svg

  1. Extract IWB: Opens the .iwb file (which is a ZIP archive)
  2. Parse content.xml: Extracts and parses the embedded XML containing SVG pages
  3. Process Images: Handles image references according to the selected mode
  4. Fix Fills (optional): Removes fill attributes from shape elements
  5. Fix Size (optional): Adjusts SVG dimensions if content extends beyond them
  6. Export SVG: Writes each page as a separate SVG file

iwb2pdf

  1. Extract SVGs: Uses iwb2svg to extract all SVG pages from the IWB file
  2. Convert SVGs: Converts each SVG to a ReportLab drawing
  3. Create PDF: Combines all drawings into a multi-page PDF
  4. Page Sizing: Each page is sized independently (or uniformly) based on content

Requirements

  • Python 3.10+
  • iwb2svg: No external dependencies (uses only Python standard library)
  • iwb2pdf: Requires reportlab and svglib (installed via uv sync)

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

You are free to use, modify, and distribute this software under the terms of the GPL v3.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newline_iwb_converter-0.2.1.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

newline_iwb_converter-0.2.1-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file newline_iwb_converter-0.2.1.tar.gz.

File metadata

File hashes

Hashes for newline_iwb_converter-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2fccc3e3cb726777754e71e790e7dc2480fd57f5eb34805478428a21c37b5bcc
MD5 5fa1137491eb83c55b2424be8d1a5bc5
BLAKE2b-256 c8eccf902311311ed0f32d0d55fe4c8abc345d846426136b41f5b319aaaf87ec

See more details on using hashes here.

File details

Details for the file newline_iwb_converter-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for newline_iwb_converter-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed9bcdd74a440079ec8360da65a5e57d7b28c4a9a4efa1dcf0cf8b18cebe4693
MD5 d7354bc31333ae152952757de151042b
BLAKE2b-256 4814d0c3d014f97145bbf8b97163e555459c18cda67b29b8008c5be76a3e25b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page