From: Guido van Rossum Date: Wed, 24 Dec 1997 18:31:53 +0000 (+0000) Subject: Script to edit one line in the PS to allow A4 printing. X-Git-Tag: v1.5~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9973d9060d6c7968118046e8658a54c264ea76b;p=python Script to edit one line in the PS to allow A4 printing. --- diff --git a/Doc/ref/fixps.py b/Doc/ref/fixps.py new file mode 100755 index 0000000000..4b3218484c --- /dev/null +++ b/Doc/ref/fixps.py @@ -0,0 +1,26 @@ +#! /usr/bin/env python + +"""Dumb script to edit a particular line in the PostScript. + +This makes it possible to print on A4 paper. +""" + +f = open("ref.ps", "r") + +lines = f.readlines() +f.close() +didit = 0 + +for i in range(100): + if lines[i] == '/FMAllowPaperSizeMismatch false def\n': + lines[i] = '/FMAllowPaperSizeMismatch true def\n' + didit = 1 + break + +if not didit: + print "ref.ps not changed" +else: + print "rewriting edited ref.ps" + f = open("ref.ps", "w") + f.writelines(lines) + f.close()