88from pyth import document
99from pyth .format import PythWriter
1010
11- from reportlab .platypus import SimpleDocTemplate , Paragraph , Spacer
11+ from reportlab .platypus import SimpleDocTemplate , Paragraph
1212from reportlab .lib .styles import getSampleStyleSheet , ParagraphStyle
1313from reportlab .lib .pagesizes import A4
1414from reportlab .lib .units import inch
2828class PDFWriter (PythWriter ):
2929
3030 @classmethod
31- def write (klass , document , target = None , paragraphStyle = None , spacer = None ):
32- writer = PDFWriter (document , paragraphStyle , spacer )
31+ def write (klass , document , target = None , paragraphStyle = None ):
32+ writer = PDFWriter (document , paragraphStyle )
3333 story = writer .go ()
3434
3535 if target is None :
@@ -40,17 +40,14 @@ def write(klass, document, target=None, paragraphStyle=None, spacer=None):
4040 return target
4141
4242
43- def __init__ (self , doc , paragraphStyle = None , spacer = None ):
43+ def __init__ (self , doc , paragraphStyle = None ):
4444 self .document = doc
4545
4646 if paragraphStyle is None :
4747 stylesheet = getSampleStyleSheet ()
4848 paragraphStyle = stylesheet ['Normal' ]
4949 self .paragraphStyle = paragraphStyle
50-
51- if spacer is None :
52- spacer = Spacer (0 , DEFAULT_PARA_SPACE )
53- self .spacer = spacer
50+ self .paragraphStyle .spaceAfter = 0.2 * inch
5451
5552 self .paragraphDispatch = {
5653 document .List : self ._list ,
@@ -61,7 +58,6 @@ def go(self):
6158 self .paragraphs = []
6259 for para in self .document .content :
6360 self ._dispatch (para )
64- self .paragraphs .append (self .spacer )
6561 return self .paragraphs
6662
6763
0 commit comments