MCPcopy Create free account
hub / github.com/ActiveState/code / testJSONtoPDF

Function testJSONtoPDF

recipes/Python/578979_Convert_JSPDF/recipe-578979.py:34–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 error_exit("Error while generating PDF file: {}".format(e.message))
33
34def testJSONtoPDF():
35 fil = open('the-man-in-the-arena.txt')
36 lis = fil.readlines()
37 data = { \
38 'pdf_filename': 'the-man-in-the-arena.pdf', \
39 'font_name': 'Courier', \
40 'font_size': 12, \
41 'header': 'The Man in the Arena', \
42 'footer': 'Generated by xtopdf - http://google.com/search?q=xtopdf', \
43 'lines': lis \
44 }
45 json_data = json.dumps(data)
46 JSONtoPDF(json_data)
47
48def main():
49 testJSONtoPDF()

Callers 1

mainFunction · 0.85

Calls 4

JSONtoPDFFunction · 0.85
openFunction · 0.50
readlinesMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected