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 (Inkscape-style)
  • 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.1.2.tar.gz (23.9 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.1.2-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for newline_iwb_converter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c59868c2398c22de06fb59b89b8dd842528f0acb655093c2157f4fa018b7d766
MD5 8208a8f0eff01d7f9282b8d1608b3b1d
BLAKE2b-256 81f766f69f43b89148d1ebb096d8a4dd3ba4a96be343c0d6e2ea57b19682a2fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for newline_iwb_converter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 358ec8c4d05e0b9aef3152609aecb6edb1b262f5c391733223be894048e0ec50
MD5 cbe06d9ab2a88a6a1dd2d3b6f608c549
BLAKE2b-256 28a8355488634553d84b19fe5a71adfb80b6a92cb7a10853cd53da9eb4b1f272

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