Skip to main content
screenjson convert -i <input-file> [-o <output-file>] [options]
Converts FDX, FadeIn, Fountain, PDF, JSON, or YAML input into a ScreenJSON document.

Flags

Core

FlagDefaultDescription
-i · --input <path>Input file. Required.
-o · --output <path>stdoutOutput file (or stdout if omitted / -).
-f · --format <name>autoForce input format: fdx · fadein · fountain · celtx · pdf.
--yamlfalseEmit YAML instead of JSON.
--lang <tag>enPrimary language tag (BCP 47).
--encrypt <key>Encrypt content runs with a shared secret (min 10 chars).
-q · --quietfalseSuppress non-error output.
--verbosefalseVerbose logging to stderr.

PDF import

FlagDefaultDescription
--pdftohtml <path>$SCREENJSON_PDFTOHTML or /opt/homebrew/bin/pdftohtmlPath to Poppler’s pdftohtml.
--pdf-password <pw>Password for encrypted source PDFs.

Database output

FlagDescription
--db <type>elasticsearch · mongodb · cassandra · dynamodb · redis.
--db-host <host>Database host.
--db-port <port>Database port.
--db-user <user>Database username.
--db-pass <pass>Database password.
--db-collection <name>Collection / index name.

Blob output

FlagDescription
--blob <type>s3 · azure · minio.
--blob-bucket <name>Bucket name.
--blob-key <path>Object key / path. Default <document-id>.json.
--blob-region <region>AWS region (for S3).
--blob-endpoint <url>Custom endpoint (for MinIO).

Format auto-detection

The converter auto-detects input format from file extension:
ExtensionFormat
.fdxfdx
.fadeinfadein
.fountain, .spmdfountain
.pdfpdf
.jsonjson
.yaml, .ymlyaml
Files without a recognised extension require -f.

Examples

# FDX → ScreenJSON
screenjson convert -i screenplay.fdx -o screenplay.json

# Fountain → YAML
screenjson convert -i screenplay.fountain --yaml -o screenplay.yaml

# PDF with custom pdftohtml
screenjson convert -i script.pdf --pdftohtml /opt/homebrew/bin/pdftohtml -o script.json

# Password-protected PDF
screenjson convert -i protected.pdf --pdf-password "secret" -o script.json

# Convert and encrypt in one shot
screenjson convert -i script.fdx --encrypt "AtLeast10Chars!" -o cipher.json

# Stdout → jq
screenjson convert -i script.fdx | jq '.title.en'

# Store directly to MongoDB
screenjson convert -i script.fdx \
  --db mongodb \
  --db-host mongodb://localhost:27017 \
  --db-collection screenplays

Notes

  • The converter auto-validates the output and prints a warning to stderr on validation errors. Use validate for strict exit codes.
  • Database and blob output are additive — the converter writes the file, then the DB, then the blob, in order.