aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vilcans <martin@librador.com>2014-10-09 09:42:03 +0200
committerMartin Vilcans <martin@librador.com>2014-10-09 09:42:03 +0200
commit601e5119e79fd4f00fe0f2bc5ae4438e7574a9f6 (patch)
treeffa5173adf7921663f68b34a72a9752380cd5ae3
parent8f9e7ded799c173e3bddd971f337e2895304c944 (diff)
downloadscreenplain-601e5119e79fd4f00fe0f2bc5ae4438e7574a9f6.tar.gz
Add page break support in PDF output
-rw-r--r--screenplain/export/pdf.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/screenplain/export/pdf.py b/screenplain/export/pdf.py
index b43d801..62653d5 100644
--- a/screenplain/export/pdf.py
+++ b/screenplain/export/pdf.py
@@ -3,13 +3,20 @@
# http://www.opensource.org/licenses/mit-license.php
from reportlab.lib import pagesizes
-from reportlab.platypus import BaseDocTemplate, Paragraph, Frame, PageTemplate
+from reportlab.platypus import (
+ BaseDocTemplate,
+ Paragraph,
+ Frame,
+ PageTemplate,
+)
+from reportlab import platypus
from reportlab.lib.units import inch
from reportlab.lib.styles import ParagraphStyle
from screenplain.types import (
Action, Dialog, DualDialog, Transition, Slug
)
+from screenplain import types
lines_per_page = 55
characters_per_line = 61
@@ -130,8 +137,8 @@ def to_pdf(screenplay, output_filename, template_constructor=DocTemplate):
add_paragraph(story, para, slug_style)
elif isinstance(para, Transition):
add_paragraph(story, para, transition_style)
- #elif isinstance(para, PageBreak):
- # TODO: page break
+ elif isinstance(para, types.PageBreak):
+ story.append(platypus.PageBreak())
else:
# Ignore unknown types
pass