8

Background

Fountain files are markdown files for screenplays. Many websites have appeared, and many GUI applications exist, that convert .fountain files to various other formats (e.g., .fdx, .html, .pdf).

Problem

Launching a GUI to generate a PDF from .fountain files is a manual process that should be possible to side-step from the command-line. A command-line tool opens up a plethora of possibilities that graphical interfaces lack (such as automated generation of PDF files).

Question

How would you convert .fountain files to .pdf files on Unix systems (such as Linux) from the command-line using free, open-source software?

Going through an intermediary format (such as .fdx or .html) is acceptable, provided:

  • no GUI is required;
  • page numbers are properly formatted; and
  • character speech continuations across page breaks are properly marked.

Additional Details

Trelby's author noted that a command-line interface was not in the works. Textplay has a dependency on non-free software (PrinceXML)--not to mention other issues. AfterWriting's JavaScript code does not work using nodejs or PhantomJS; however, it produces ideal output.

WeasyPrint could be a viable alternative to PrinceXML.

  • 2
    At $3,800 for a single license, Prince XML is expensive! Which makes me wonder why he used it. Do you have any budget for this, or are you looking for a free solution? – Mawg Feb 23 '15 at 8:18
3

The author of AfterWriting has published a command-line interface based on node.js. After downloading, it can be used as follows:

cd afterwriting-labs
npm install
node awc.js --help

For example:

node awc.js --source my_draft.fountain --pdf screenplay.pdf
2

Full disclaimer: I'm the author of Wrap.

I was looking for a tool like that but did not find anything that was easy to use and worked on most major platforms. So I build my own tool called Wrap (GitHub page).

There are some edgecases that need some polishing but it handles 99.9% of scripts just fine.

The main advantages of Wrap are:

  • To the letter implementation of the Fountain spec.
  • No external dependecies, apart from Courier Prime.
  • Speed (sub 200ms for Big Fish).
  • Wrap extensions (support for stage plays, different languages, etc.)
  • Support for Linux, macOS and Windows.

Another option would be After Writing (GitHub page), which requires Node.js but features a lot of analysis tools for you script.

1

Screenplain (the command line version) will convert Fountain files to PDF, Final Draft and HTML.

You need Python and Pip installed ... then just install screenplain and screenplain[pdf].

sudo pip install screenplain

sudo pip install 'screenplain[PDF]'

To use it, just type:

screenplain sample.fountain sample.pdf (or .fdx or .html).

If you wanted formatted text files from PDF files you can use Popplar utilities and type.

pdftotext -layout -nopgbrk sample.pdf sample.txt

("-nopgbrk" gets rid of page break code and -layout maintains the layout from the pdf document)

I've also used 'afterwriting (see above) for this, but I find it's easier to tweak the Python code (if I want bold or double spaced sluglines, for example). You make the changes in the pdf.py file under the subdirectory 'export' (under 'screenplain').

There's a link to the screenplain GitHub page at the bottom of the online screenplain site. (screenplain.com)

EDIT: (Just installed Wrap (and Courier Prime). Very nice.)

EDIT2: (Very nice but I ran into an odd problem. My character's name is Estella. When I use that name at the beginning of a line (capitalized or not) Wrap thinks it's a scene header — also tried this with ESTHER and INTIMA with the same results. Other names, like "Ella" work fine. We (me and couple others on Done Deal Pro's forums) were trying to figure this out and guessed that "ext," "est," and "int" might cause Wrap to think the line following is a slugline. However, there is also strange behavior when using one of these names as a Character name. In this case it does't treat "ESTELLA" and the dialogue line follows as a header, it just leaves both lines flush left? Odd. I'll try to contact the developer on the GitHub page, if I can figure out how to do it.)

EDIT 3: *Bug already fixed as of 0.2.3. That was incredibly fast! I like Wrap a lot.*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.