A converter utility for handling Newline whiteboard IWB files and converting them
Project description
Newline IWB Converter
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
- UV package manager
Installation
uv sync
Activate Virtual Environment
.venv\Scripts\Activate.ps1
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
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)
Run Tests
uv run pytest
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
- Extract IWB: Opens the
.iwbfile (which is a ZIP archive) - Parse content.xml: Extracts and parses the embedded XML containing SVG pages
- Process Images: Handles image references according to the selected mode
- Fix Fills (optional): Removes fill attributes from shape elements
- Fix Size (optional): Adjusts SVG dimensions if content extends beyond them
- Export SVG: Writes each page as a separate SVG file
iwb2pdf
- Extract SVGs: Uses
iwb2svgto extract all SVG pages from the IWB file - Convert SVGs: Converts each SVG to a ReportLab drawing
- Create PDF: Combines all drawings into a multi-page PDF
- 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: Requiresreportlabandsvglib(installed viauv 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file newline_iwb_converter-0.1.0.tar.gz.
File metadata
- Download URL: newline_iwb_converter-0.1.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
259d24c3c987a893e854063d1e113147a08e61fe4fb00d53ee31a0055512cb94
|
|
| MD5 |
bf21eca970624e79961e3d6ab410f976
|
|
| BLAKE2b-256 |
f4212caa1b214c1ab19a9a93339759206adfbf006a17f14d0d1803e8ecdc7f76
|
File details
Details for the file newline_iwb_converter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: newline_iwb_converter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f78f5a8e4a6ef46fe09655c4bcccadea0df0803cfb531d2f9368546878d52680
|
|
| MD5 |
c46c2bd5d75ab7e387feead5d38abca7
|
|
| BLAKE2b-256 |
d1e97b9826b21f7a26949ae848d00f497727ce6ccad0b5664f0c4416ed945eef
|