[tex-k] patch for dvips(k) 5.95a

t s keinbiervorvier at gmail.com
Thu Nov 30 05:11:14 CET 2006


Hi,

I suggest the following patch to dvipsk 5.95a as distributed with tetex-3.0

# diff -bBwc output.c-orig output.c
*** output.c-orig       2006-11-27 23:49:32.000000000 -0700
--- output.c    2006-11-28 15:02:14.000000000 -0700
***************
*** 514,519 ****
--- 514,520 ----
                                   "! premature end of file in binary
section") ;
                          }
                         c = getc(f) ;
+                        removingBytes = 0;
                          dosepsend-- ;
                       }
                    } else if (scanForEnd && strncmp(possibleDSCLine,
scanForEnd,


This addresses the follwoing problem:

when the -K1 flag is used, the line immediately following a %%EndData
or %%EndBinary line is omitted from the output. This is independent of
proper byte count and can be easily reproduced with any made up file.

For example a simple latex file doing

\begin{figure}
\includegraphics{bar.eps}
\end{figure}

where

> cat bar.eps
%!PS-Adobe-2.0
%%BoundingBox: 0 20 30 40
%%BeginData: 10
101010101
%%EndData
 (foo) show


with dvips -K1 sample.dvi  will result in postscript missing the line
(foo) show

20 @lly 30 @urx 40 @ury 300 @rwi @setspecial
%%BeginDocument: bar.eps
%%BeginData: 10
101010101
%%EndData

%%EndDocument
 @endspecial 1926 5255 a Fa(1)p eop end

while dvips -K0 sample.dvi correctly results in

0 @llx 20 @lly 30 @urx 40 @ury 300 @rwi @setspecial
%%BeginDocument: bar.eps
%!PS-Adobe-2.0
%%BoundingBox: 0 20 30 40
%%BeginData: 10
101010101
%%EndData
 (ff) show

%%EndDocument
 @endspecial 1926 5255 a Fa(1)p eop end end


My patch fixes this. I did not see any adverse side effects, but maybe
someone on the list will.

Regards
T.


More information about the tex-k mailing list