What you need
- A screenplay PDF, ideally one rendered from a writing tool (not a scan).
screenjsonon your PATH, or Docker.- Poppler — specifically the
pdftohtmlbinary.
Install Poppler
# macOS
brew install poppler
# Debian / Ubuntu
sudo apt-get install poppler-utils
Typical pdftohtml paths:
- macOS Intel:
/usr/local/bin/pdftohtml - macOS Apple Silicon:
/opt/homebrew/bin/pdftohtml - Linux:
/usr/bin/pdftohtml
If you use the Docker image, Poppler is already baked in — skip this step.
Convert
screenjson convert -i screenplay.pdf --pdftohtml /opt/homebrew/bin/pdftohtml -o screenplay.json
Or set it globally once:
export SCREENJSON_PDFTOHTML=/opt/homebrew/bin/pdftohtml
screenjson convert -i screenplay.pdf -o screenplay.json
Password-protected PDFs
screenjson convert -i protected.pdf --pdf-password "secret" -o screenplay.json
In Docker
docker run --rm -v "$PWD:/data" screenjson/cli \
convert -i /data/screenplay.pdf -o /data/screenplay.json
Things to know
- PDF conversion is a best-effort operation. PDFs rendered from Final Draft, Fade In, or Highland usually produce excellent results. Scanned PDFs produce poor results — OCR first with a dedicated tool.
- Sluglines are reconstructed from margin and capitalisation heuristics. Always validate output and spot-check a few scenes.