Script to edit one line in the PS to allow A4 printing.

This commit is contained in:
Guido van Rossum 1997-12-24 18:31:53 +00:00
parent 44a8931caf
commit b9973d9060
1 changed files with 26 additions and 0 deletions

26
Doc/ref/fixps.py Executable file
View File

@ -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()