🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.sys.next
Article #49

[SUMMARY] dvi2ps-1.7j + kdraw + psfix + Preview => successful

#49
From: Youki Kadobayashi
Date: Sat, 11 Apr 1992 05:46
81 lines
2557 bytes
$B:eBg>pJs9)3X2J$NLgNS$G$9!#(B

ASCII-jTeX + epsf.sty + kdraw + dvi2ps-1.7j $B$NAH9g$;$G:n@.$7$?(B ps file
$B$r!"(BNeXT Preview $B$G8+$k$3$H$,$G$-(B$B$^$7$?!#(B

$B#N#T#T%=%U%H8&$NIw4V$5$s$N%"%I%P%$%9$K$7$?$,$C$F!"(B"psfix" (perl
script; attached below) $B$r;H(B$B$C$F(B kdraw (or idraw) $B$N=PNO$r=$@5$9$k$H!"(B
$B%W%l%S%e!<$G$-$k$h$&$K$J$j$^$7$?!#Iw4V$5$s!"$I$&$b$"$j$,$H(B$B$&$4$6$$$^$7$?!#(B

$B$"$H!"(Bpsfix $B%9%/%j%W%H$K:3:Y$J%P%0$,$"$j$^$7$?$N$G!"=$@5$7$F$*$-$^$7$?!#(B
$B$3$l$G!"C1(B$B$K(B "psfix *.eps" $B$r<B9T$7$?8e!":FEY(B dvi2ps-j $B$rDL$;$P!"IaDL(B
$B$N(BTeX $B%I%-%e%a%s%H$O2wE,$K(B Preview $B$G$-$k(B$B$H;W$$$^$9!#(B

----cut here----------------snip snip---------------->8 >8----enough said!
#!/usr/local/bin/perl
# psfix: fix EPS files to attain DSC conformance.
#	Copyright (C) 1990	Kazuhiro Kazama
#	modified 4/11/1992	Youki Kadobayashi	fixed globbing bug
$tmp="psfix$$";

if ($#ARGV < 0) {
	do usage();
}

while ($_ = shift(@ARGV)) {
	push(psfiles, ($_));
}

foreach $file (@psfiles) {
	unless (open(stdin, $file)) {
		print("Can't open $file\n");
		exit;
	}
	unless (open(stdout, "> $tmp")) {
		print("Can't create file\n");
		exit;
	}
	$_ = <>;
	if (/^%!/) {
		print "%!PS-Adobe-2.0 EPSF-1.2\n";
		do print_comment();
		do print_body();
	} else {
		close(stdout);
		unlink $tmp;
		die("This file is not a postscript file.");
	}
	close(stdin);
	close(stdout);
	rename("$file", "$file.bak") || die "$!";
	rename($tmp, $file) || die "$!";
}

sub print_comment {
	while (<>) {
		next if (/^%%BoundingBox: \? \? \? \?/);
		next if (/^%%Page/);
		print;
		last if (/^%%EndComments/);
	}
}

sub print_body {
	while (<>) {
		next if (/^%%Page/);
		next if (/^%%Trailer/);
		next if (/^%%EOF/);
		print;
	}
}

sub usage {
	print STDERR "Usage: psfix f1 ... fn\n";
	exit;
}

--
		$BLgNS(B $BM:4p(B <youki@ics.osaka-u.ac.jp>
		$BBg(B$B:eBg3X4pAC9)3XIt>pJs9)3X2J(B
		$B>pJs%M%C%H%o!<%/3X9V:B(B $B=$;N0lG/(B
Technical Details
Message-ID: <YOUKI.92Apr11144643@nozomi.rd.ecip.osaka-u.ac.jp>
Path: arc1-ca.pugleaf.net!sparky!uunet!ccut!sh.wide!astemgw!icspub!nozomi.rd.ecip.osaka-u.ac.jp!youki

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ccut!sh.wide!astemgw!icspub!nozomi.rd.ecip.osaka-u.ac.jp!youki
From: youki@rd.ecip.osaka-u.ac.jp (Youki Kadobayashi)
Newsgroups: fj.sys.next,fj.lang.postscript
Subject: [SUMMARY] dvi2ps-1.7j + kdraw + psfix + Preview => successful
Message-ID: <YOUKI.92Apr11144643@nozomi.rd.ecip.osaka-u.ac.jp>
Date: 11 Apr 92 05:46:43 GMT
Sender: news@icspub.ics.osaka-u.ac.jp
Followup-To: fj.sys.next
Distribution: fj
Organization: R&D, Edu Center for Info Processing, Japan
Lines: 81