()
| 32 | error_exit("Error while generating PDF file: {}".format(e.message)) |
| 33 | |
| 34 | def 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 | |
| 48 | def main(): |
| 49 | testJSONtoPDF() |