# test_pdfwriter.py from PDFWriter import PDFWriter with PDFWriter("test_pdfwriter.pdf") as pw: pw.setFont("Courier", 12) pw.setHeader("Input: test_pdfwriter.py Output: test_pdfwriter.pdf") pw.setFooter("Generated by xtopdf: http://bit.ly/xtopdf") with open("test_pdfwriter.py") as in_fil: for lin in in_fil: pw.writeLine(lin)