Package: psptools
Version: 1.2.2-6
Severity: normal
This diff supercedes my previous #129287 and #128669.
1. My custom output of allfeatures after the EndComments is removed.
I found the outstanding problem with some lines being dropped or duplicated
in the final postscript output and want those to be fixed first.
2. There are some changes added that my solve that show stopper.
This works on some postscript. The input file is a big variable so a variety
of tests would be needed. Files from dvips could be a problem because
the psplpr tries to replace the dvips %%Feature: . The program maybe should
be used as a filter first and the output examined before printing and
before any regular use.
3. My perl is too poor to really figure this out.
4. If this is good enough then the following diff can be added to the
existing debian package building diff for pstools.
Don
[EMAIL PROTECTED]
--- psptools-1.2.2.orig/src/psplpr.pl.inWed Jul 3 04:49:28 1996
+++ psptools-1.2.2/src/psplpr.pl.in Tue Jan 15 15:34:56 2002
@@ -33,6 +33,8 @@
require 'ppd.pl';
require 'printer.pl';
+$used_prog_lpr = $prog_lpr; # default value (overridden by --output)
+
#
# tell_user(what)
#
@@ -157,7 +159,7 @@
++$dictsz if $pagesetup;
}
-return unless $dictsz;
+return unless ($dictsz > 1);
if (!$nodsc) {
print "%%BeginResource: procset psplpr\n";
@@ -290,8 +292,8 @@
print "$who\n";
print "%%BoundingBox: 0 0 0 0\n%%Pages: 0\n";
print "%%EndComments\n";
-} else {
-print "%!\n";
+#} else {
+#print "%!\n";
}
if (!$doc) {
@@ -346,7 +348,7 @@
}
if (!$doc) {
- print "psplprdict begin psplprsetup end\n";
+ print "psplprdict begin psplprsetup end\n" if
countfeatures('PageSetup');
}
if ($doc && $dsc) {
@@ -507,22 +509,32 @@
ignoredeps('ExitServer');
ignoredeps('JCLSetup');
+local ($allout) = 0;
+
$_ = readpsline($conformant);
if (!$_) {
- %all_options = outputallfeatures($nodsc, !$dirty, $safer,
- $nonstd, $special);
+print "%!\n%%Creator: psplpr " . localtime() . "\n";
+print "%%EndComments\n";
+print "%\n% " . $myname . ": outputing all features... \n";
+ %all_options = outputallfeatures($nodsc, 666, $safer,
+ $nonstd, $special) unless $allout;
+$allout = 1;
} else {
$_ =~ s/^\004//;
local($bad);
- if ($dirty || ($bad = !/^%!PS/)) {
+ if ($dirty || ($bad = !/^%!PS-Adobe-3/)) {
+print;
+print "% " . $myname .": Looking for PS-Adobe-3.0 DSC conforming
document...\n";
+print "% " . $myname .": with %%BeginProlog, %%BeginSetup,
%%EndComments, etc. ... or\n";
+print "% " . $myname .": prepending! (not DSC compliant) at " .
localtime() . "\n%\n";
local($first) = $_;
-
+
%all_options = outputallfeatures($nodsc, 0, $safer, $nonstd,
- $special);
-
+ $special) unless $allout;
+$allout = 1;
if ($bad && !$dontglob) {
$glob = 1;
}
@@ -538,12 +550,23 @@
++$lineno;
+
if (/^%%Begin/) {
$in_comment = 1;
} elsif (/^%%End/) {
$in_comment = 0;
}
+# begin 15jan02 change
+#if (/^%%EndComments/) {
+#print "%%Modified: by psplpr ".localtime()."\n" if $nodsc >=
0;
+#print if $nodsc >= 0;
+# $printed = 1;
+#outputallfeatures ($nodsc, 0 ,$safer, $nonstd, $special)
unless $allout;
+#$allout = 1;
+# end 15jan02 change
+# } els
+
if (/^%%BeginProlog/) {
print if $nodsc >= 0;
($_, $ps) = readfeatures($glob, $conformant, !$inc, !$chg,
@@ -579,12 +602,16 @@
print "%%BeginSetup\n" unless $nodsc;
}
- if (!/^%%Page/) {
+ if (!/^%%Page/) {
+# next two lines added 15jan02
+# print if $nodsc >= 0;
+# $printed = 1;
+
($_, $ps) = readfeatures($glob, $conformant,
!$inc, !$chg, $del, $nodsc, $conforms);
$dontread = 1;
}
-
+
outputfeatures('DocumentSetup', $nodsc, $safer,
$nonstd, !$conformant, $special);
outputfeatures('AnySetup', $nodsc, $safer, $nonstd,
@@ -598,7 +625,7 @@
}
if (/^%%Page:/) {
- local($addsc) = 0;
+ local($adddsc) = 0;
if (!$prolog_output) {
outputfeatures('Prolog', $nodsc, $safer, $nonstd,
@@ -617,6 +644,9 @@
}
print if $nodsc >= 0;
+#added 15jan02
+ $printed =1;
+
if ($_ = readpsl