diff options
-rw-r--r-- | screenplain/export/pdf.py | 28 | ||||
-rw-r--r-- | screenplain/export/text.py | 17 |
2 files changed, 0 insertions, 45 deletions
diff --git a/screenplain/export/pdf.py b/screenplain/export/pdf.py deleted file mode 100644 index 4e29f6d..0000000 --- a/screenplain/export/pdf.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2011 Martin Vilcans -# Licensed under the MIT license: -# http://www.opensource.org/licenses/mit-license.php - -import fileinput -from reportlab.pdfgen import canvas -from reportlab.lib import pagesizes - -from screenplain.format import get_pages - - -def to_pdf(screenplay, output_file): - # pagesizes.letter, pagesizes.A4 - page_width, page_height = pagesizes.A4 - c = canvas.Canvas(output_file, pagesize=pagesizes.A4) - c.setFont('Courier', 12) - - for page_no, page in enumerate(get_pages(screenplay)): - # page numbers are 0-based - if page_no != 0: - c.showPage() - c.setFont('Courier', 12) - for line_no, line in enumerate(page): - c.drawString(0, page_height - 12 - 12 * line_no, line) - c.save() - -if __name__ == '__main__': - to_pdf(fileinput.input()) diff --git a/screenplain/export/text.py b/screenplain/export/text.py deleted file mode 100644 index fe3bcb3..0000000 --- a/screenplain/export/text.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2011 Martin Vilcans -# Licensed under the MIT license: -# http://www.opensource.org/licenses/mit-license.php - -import sys -import codecs -from screenplain.format import get_pages - - -def to_text(screenplay, out): - for page_no, page in enumerate(get_pages(screenplay)): - # page_no is 0-based - if page_no != 0: - out.write('\f') - for line in page: - out.write(line) - out.write('\n') |