/usr/bin/prn2ps is in sdf 2.001+1-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | #!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
# $Id$
$VERSION{'PUBLIC'} = '2.000';
$VERSION{''.__FILE__} = '$Revision$';
#
# >>Title:: PostScript Conversion Utility
#
# >>Copyright::
# Copyright (c) 1992-1997, Ian Clatworthy (ianc@mincom.com).
# You may distribute under the terms specified in the LICENSE file.
#
# >>History::
# -----------------------------------------------------------------------
# Date Who Change
# 18-Jul-97 ianc SDF 2.000
# -----------------------------------------------------------------------
#
# >>Purpose::
# {{CMD:prn2ps}} converts Windows PostScript to Unix PostScript.
# The input to this program is typically generated by printing
# to a PostScript printer connected to the FILE: logical device.
# The output can be converted to Encapsulated PostScript using
# GhostScript's {{CMD:p2epsi}} program.
#
# >>Description::
# !SDF_OPT_STD
#
# For each input file, the output is generated by:
#
# * deleting the {{PageSize}} information
# * deleting the control-D at the end of the file.
#
# >>Limitations::
# If {{CMD:ps2epsi}} doesn't like the output, you may need to
# use another printer driver to generate the input.
# On Windows NT 4.0, the {{Canon PS-IPU Color Laser Copier v52.3}}
# driver works most of the time.
#
# >>Examples::
# To generate an Encapsulated PostScript file from Windows PostScript:
#
# > prn2ps -ops myfig.prn
# > ps2epsi myfig.ps
#
# >>Implementation::
#
require "sdf/app.pl";
########## Initialisation ##########
# define configuration
%app_config = (
'libdir', 'sdf/home',
);
# define options
#push(@app_option, (
# #'Name|Spec|Help',
#));
# handle options
&AppInit('prn_file ...', "convert Windows PostScript to Unix PostScript",
'SDF') || &AppExit();
########## Processing ##########
sub argProcess {
my($ARGV) = @_;
# my();
local($_);
# Open the input
unless (open(FILE, $ARGV)) {
&AppMsg("abort", "failed to open '$ARGV'");
return;
}
# Generate the output
my $end = '';
while (<FILE>) {
if ($end) {
$end = '' if /^\Q$end/;
next;
}
elsif (index($_, '%%BeginFeature: *PageSize') == 0) {
$end = '%%EndFeature';
next;
}
next if /^\004/; # Ignore the terminating ^D
print;
}
close(FILE);
}
&AppProcess('argProcess');
&AppExit();
|