You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node.js implementation of the Open Board Format (OBF) validator and converter. This tool allows you to validate OBF/OBZ files and convert them between various formats including PDF, PNG, SFY, and SGRID.
Installation
npm install obf-node
CLI Usage
Validate a file
obf-node validate path/to/board.obf
Convert between formats
You can convert from OBF, OBZ, SFY (Sensory Grid Player), or SGRID (Sensory Grid) to PDF, PNG, OBF, or OBZ.
Note: The SFY and SGRID converters are ported from the original Ruby codebase and serve as demonstration of how native/proprietary AAC formats can be converted to the Open Board Format.
# Convert OBF to PDF
obf-node convert path/to/board.obf output.pdf
# Convert OBZ to PNG
obf-node convert path/to/board.obz output.png
# Convert SFY to OBZ (packages the board with its assets)
obf-node convert path/to/board.sfy output.obz
# Convert SGRID to OBF
obf-node convert path/to/board.sgrid output.obf
Library Usage
const{ Validator, PdfBuilder, Utils, External }=require('obf-node');// Validateconstresult=awaitValidator.validate_file('path/to/board.obf');console.log(result.valid ? 'Valid!' : 'Invalid');// Load and Convertconstboard=awaitUtils.load_obf('path/to/board.obf');awaitPdfBuilder.build(board,'output.pdf');// Package OBF into OBZawaitExternal.to_obz(board,'output.obz');
Requirements for PNG Conversion
PNG conversion currently requires ImageMagick (convert command) to be installed on your system.