Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!ames!pasteur!ucbvax!khnphwzhn.njin.net!rapatel From: rapatel@khnphwzhn.njin.net (Rocky - Rakesh Patel) Newsgroups: comp.soft-sys.andrew Subject: Printing bugs with insets. Message-ID: Date: 26 Feb 90 22:49:58 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 178 There are some serious bugs with printing and insets... When embedded rasters are incuded in a document, ezprint ends up sticking `\` at the end of each postscript command. That is a serious problem. psdit from Transcript, recognizes all code between a '%' and a '.' on a line by itself to be embedded postscript. However, since ezprint generates a '\' at the end of each line of the postscript code, it ends with a `.\'. This causes psdit to assume the following ditroff output code to be postscript. That really is a bug with ezprint - not psdit. Those '\'s shouldn't be added unless it is part of the valid postscript code. The other problem is seen when embedding other insets into a zip object. For example: [An Andrew ToolKit view (a drawing) was included here, but could not be displayed.] Results in the following code from ezprint (ezprint -t) : .so /usr/local/andrew/lib/tmac/tmac.atk .IZ .nr IN 36p .nr LT 432p .nr PO 54p .br .ad b 'ft R .nr PS 12 .ps \n(PS .nr VS 14p .vs \n(VSu .nr EN 8n .sp 0.5i .nr DP 0 .ds Fn \fR .ds HF R .nr HS \n(.s .ds FF R .nr FS \n(.s .RS .nh .OC 'PB 586 413 'if \n(zT \{\ \! 586 troffadjust 413 neg translate \!%!PS-Adobe-2.0 EPSF-1.2 \!% Begin Zip PostScript Prelude Version 0.0 \!gsave % Save Environment Around Zip Drawing \!1 -1 scale \!1 setlinewidth 2 setlinejoin \! \!/zip_Rectangle { \! gsave newpath \! 0 setgray /LW exch def /shade exch def \! /B exch def /R exch def /T exch def /L exch def \! L T moveto R T lineto R B lineto L B lineto L T lineto \! shade 0 gt {gsave shade setgray fill grestore} if \! closepath LW 0 gt {LW setlinewidth stroke} if grestore \! }def \!/zip_Round_Rectangle { \! gsave newpath \! 0 setgray /LW exch def /shade exch def \! /YR exch def \! /XR exch def \! /B exch def /R exch def /T exch def /L exch def \! L XR add T moveto \! R T R B XR arcto 4 {pop} repeat \! R B L B XR arcto 4 {pop} repeat \! L B L T XR arcto 4 {pop} repeat \! L T R T XR arcto 4 {pop} repeat \! shade 0 gt {gsave shade setgray fill grestore} if \! closepath LW 0 gt {LW setlinewidth stroke}if grestore \! }def \!/zip_Line { \! 0 setgray /LW exch def moveto lineto LW setlinewidth stroke \! }def \!/zip_Poly_Line { \! newpath 0 setgray \! 2 sub /npoints exch def \! moveto currentpoint \! /lastY exch def /lastX exch def \! 0 1 npoints {pop lineto} for \! lastx lasty lineto \! /lastx lastX def /lasty lastY def \! shade 0 gt {gsave shade setgray fill grestore} if \! LW 0 gt {LW setlinewidth stroke} if \! }def \!/zip_Trapezoid { \! setgray \! moveto 3 {lineto} repeat \! fill 0 setgray \! }def \!/zip_Ellipse { \! moveto /R exch def \! gsave scale \! currentpoint newpath \! R 0 360 arc closepath stroke grestore \! }def \!/zip_Fill_Ellipse { \! moveto /R exch def \! gsave scale \! currentpoint newpath \! R 0 360 arc closepath setgray fill grestore \! }def \!/zip_Center_X { \! stringwidth pop 2 div sx exch sub /sx exch def \! }def \!/zip_Right_X { \! stringwidth pop sx exch sub /sx exch def \! }def \!/zip_Middle_Y { \! 2 div sy exch sub /sy exch def \! }def \!/zip_Bottom_Y { \! sy exch sub /sy exch def \! }def \!% End Zip PostScript Prelude \! \!% Begin Zip Drawing \! 0 -396 translate % Portrait Mode \! /width 586 def /height 413 def % Set Clip Rectangle \! newpath 0 0 moveto \! 0 height lineto width height lineto \! width 0 lineto 0 0 lineto clip newpath \! /lastx 278.24 def /lasty 192.12 def /shade 0.00 def /LW 1 def \! 278.24 192.12 \! 1 zip_Poly_Line \! /Times-BoldItalic findfont 40 scalefont setfont \! gsave 1 -1 scale \! /sx 285.43 def /sy 23.67 neg def \! (Some people don't like fire breathing dragons....) zip_Center_X \! 40 zip_Middle_Y \! sx sy moveto (Some people don't like fire breathing dragons....) show grestore \! gsave % Save Zip Environment Surrounding Imbedded Object \! 0 530 translate 1 -1 scale % Set Zip Imbedded Object Environment /width -1 def /height -1 def /xScale 0.4800 def /yScale 0.4800 def width xScale mul height yScale mul scale /picstr width 7 add 8 idiv string def width height 1 [width 0 0 height neg 0 height] {currentfile picstr readhexstring pop} image \! grestore % Restore Zip Environment Surrounding Imbedded Object \! grestore % Restore Environment Around Zip Drawing \! % End Zip Drawing \} 'PE 586 413 .TA Notice that the embedded raster's postscript is not quoted with '\!', and that the raster's data for the image operator is non-existent. When feeding this code through ditroff, we end up with the non- quoted postsrcipt being translated as ditroff code of course.... This is a serious mess. I'm surprised no one has bothered to even mention these problems or attempted to fix them. Note that I have been happy with the new release since the folks at CMU (and friends) have put considerable effort in to de-CMUize the release. I just wish we could print the stuff now. :-( I have to set up my format command to strip the extraneous '\'s added after each postscript line, so that normal rasters can print. This problem with insets is a serious mess. I haven't decided yet whether to dive in there and see if I can fix the problem. Has anyone fixed these problems, or taken a good look at them? Rakesh Patel.