[Gs-devel] gs-6.50 and weird printing problem

Alex Cherepanov alex@artifex.com
Wed, 24 Jan 2001 11:29:41 -0500


Dear Mr. Beebe,

A and T files use "standard" security model, X uses "none".
For A and T files Acrobat Reader generates the following code:

currentfile eexec
297cf25e88dd30ad0d765f74ea031713dd819da0977424e8dc1394394c20
3357dbf038e41b397af0906ddfc7b441ac04d35b3c5bf8b072a6fdc7285d
eb12fc6fa5645278f23b97f6fa3437451e375019c2291d0363be33411e8f
6b8d6a20a5234de67e2061763b5ddcbf22f063da2a8302c832aa41

i.e.

/currentdistillerparams where { /pdfmark where
{ errordict /invalidaccess get exec}if }if
currentfile closefile

and

currentfile eexec
087329a1c14f91c06b1beed88c3a017a57dc55b72c277c307a6dad3699d3
7e17892296d7d6c6922fa0c5f42f128b79df36afc85b6fdb03e144d6ef74
3ecd328b687f222274a77d79e6c485ff08bdbc5e61ca58e5c125176d5974
d0f16615e05ffaca44ab3a1e4ffb6c21823f8babbdadc183c8217b8b402d
20f939f69910daf2801ce82493f35f170d31fcd898c4fe7cf03596daac2d
55e0f71e44cd5c1f3dc3132f073c6a34973eab3171fb86168707f4e5c16b
e2ad87cdaf9ae7089ff83e958e17d6e20ee05dee82af02015d8cedea1ebb
86284aa7

i.e.

/currentdistillerparams where { pop /pdfmark where
{ pop (The owner of this file does not permit its conversion\
 to PDF.)print quit}if }if
end PDFVars begin PDF begin PDFVars/InitAll get
currentfile closefile

This code makes the file fail if it is executed on Distiller.
Although it should not interfere with printing, it requires
very precise handling of filtered streams. Ghostscript can do
it but other interpreters may not.

This code also prevents GS from converting the PS file back to EPS.
Fortunately, one can convert PDF to PDF directly.

ps2pdf Ths6345f.pdf free_Ths6345f.pdf

The error in the file, produced by pdf2ps is unrelated to the
copy-protection scheme. The files use non-standard page size
[792 1008]. pdf2ps requests this page size from the printer but
the printer cannot satisfy it. You can set "Fit to media" policy
on the printer by prepending
  <</Policies<</PageSize 3>> >>setpagedevice
to the generated PS file.
Some printers don't support policy 3. GS need to implements
"Fit to media" function on its own.

I don't know why gv fails. The DSC comments in the files are
wrong. gv may also interfere with filter switching.

GS 6.60 has some unique problems triggered by these files. The bug
was introduced recently in the attempt to speed-up boolean
operators. It will be fixed shortly.

In short, I fully agree with the Chinese government that bans all
sourceless software in government offices. You never know what's
inside. Please contact me if you have any other questions about GS
bugs or use of GS to solve problems caused by 3rd parties.

Regards,
Alex Cherepanov
Technical Support
Artifex Software, Inc.

----- Original Message -----
From: Nelson H. F. Beebe <beebe@math.utah.edu>
To: <gs-devel@ghostscript.com>
Cc: <beebe@math.utah.edu>
Sent: Tuesday, 23 January, 2001 20:02
Subject: [Gs-devel] gs-6.50 and weird printing problem


> We have just pulled down 3 .pdf files built with Adobe Pagemaker:
>
> http://www5.pc.ibm.com/us/me.nsf/335a6c936e79bb9f8525676400687b2f/cba6c4e5db7d3bd38525699e00773789/$FILE/Ths6345f.pdf
> http://www5.pc.ibm.com/us/me.nsf/335a6c936e79bb9f8525676400687b2f/f03920be113c8a848525699e007737d4/$FILE/Ths6346f.pdf
> http://www5.pc.ibm.com/us/me.nsf/335a6c936e79bb9f8525676400687b2f/ad603c6be5b025318525699200778717/$FILE/Ths6386f.pdf
>
> These are linked to from
>
> http://www5.pc.ibm.com/us/me.nsf/Spec+Sheets%5cThinkPad
>
> at the items
>
> IBM ThinkPad A Series Notebooks 21 Nov 2000
> IBM ThinkPad T Series Notebooks 21 Nov 2000
> IBM ThinkPad X Series Notebooks 11 Sep 2000
>
> If we run Acrobat Reader 4.05 (on Sun Solaris 2.7, SGI IRIX 6.5, or
> Compaq/DEC Alpha OSF/1 4.0) interactively and select File ->
> Print-to-File, or in do it in batch like this:
>
> acroread -toPostScript -level2 filename.pdf
>
> then the A and T series .ps files fail to print, producing errors like
> this (from a Lexmark Optra S 2560):
>
> ERROR: undefined
> OFFENDING COMMAND: ntpacking
>
> while the X series file prints fine.
>
> All three files view correctly with gs-6.50 and Sun pageview, but
> SGI's xpsview displays only a partial page, then hangs.
>
> However, with gv (which calls gs-6.50), all three .pdf files view
> correctly, but the A- and T- series .ps files get this failure:
>
> Error: /undefined in ecAFPL Ghostscript 6.50: Unrecoverable error, exit code 1
>
> Operand stack:
>    --nostringval--
> Execution stack:
>    %interp_exit .runexec2 --nostringval-- --nostringval--
>    --nostringval-- 2 %stopped_push --nostringval--
>    --nostringval-- --nostringval-- false 1 %stopped_push 1 3
>    %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval--
>    --nostringval-- --nostringval-- 2 %stopped_push
>    --nostringval-- --nostringval-- --nostringval--
> Dictionary stack:
>    --dict:981/1476(ro)(G)--   --dict:0/20(G)--   --dict:69/200(L)--   --
> Error: PostScript interpreter failed in main window.
>
> I've run a system call trace (Sun's truss) command on gs and gv, and
> both open the same sets of files (apart from X Window library files),
> down to this point:
>
> gs:
> 8141: open("/usr/local/share/ghostscript/fonts/n019003l.pfb", O_RDONLY) = 6
> ...proceeds with correct display...
>
> gv:
> 8137: open("/usr/local/share/ghostscript/fonts/n019003l.pfb", O_RDONLY) = 3
> 8137: fstat(3, 0xFFBED430) = 0
> 8137: llseek(3, 0, SEEK_CUR) = 0
> 8137: lseek(3, 0, SEEK_SET) = 0
> 8137: fstat64(3, 0xFFBED250) = 0
> 8137: ioctl(3, TCGETA, 0xFFBED1DC) Err#25 ENOTTY
> 8137: read(3, "8001 ]06\0\0 % ! P S - A".., 8192) = 8192
> 8137: read(3, "CCF3C501C3D599\0 f s QD9".., 8192) = 8192
> 8137: read(3, "8DA2 O 1D5CE10B10E >CE y".., 8192) = 8192
> 8137: read(3, "88F70E 3BDDEF0D2\0  \b11".., 8192) = 8192
> 8137: read(3, "9FA1 c =B8B588F5 MCB9FA5".., 8192) = 3258
> 8137: read(3, 0x003DA484, 8192) = 0
> 8137: brk(0x00513390) = 0
> 8137: brk(0x0051F390) = 0
> 8137: ioctl(1, TCGETA, 0xFFBED174) Err#22 EINVAL
> 8137: fstat64(1, 0xFFBED1E8) = 0
> 8136: poll(0xFFBEDEB8, 4, -1) = 1
> 8137: write(1, " E r r o r :   / u n d e".., 17) = 17
> 8136: read(8, " E r r o r :   / u n d e".., 512) = 17
> 8137: write(1, "   i n   e c", 6) = 6
>
> The gv process starts reading the .ps file (see the line with "% ! P S ..."),
> but almost immediately gets an error and quits.
>
> If I use pdf2ps (calling gs-6.50) to convert the .pdf files to .ps,
> all three .ps files fail on the printer with:
>
> ERROR: configurationerror
> OFFENDING COMMAND: setpagedevice
> ERRORINFO: Key = --nostringval-- Value = --nostringval--
> STACK:
> dicttype
>
> All three .ps files from pdf2ps can be displayed successfully with
> gs-6.50; the only unusual thing that happens with each is the the
> initial window resizes to a larger window before any bits get painted.
>
> We were finally able to use xpdf-0.92 to convert the .pdf files to .ps
> files that could be viewed and printed.
>
> This behavior is bizarre, and I don't think is related to a local
> configuration issue.  It was first found on a privately-owned Sun
> Solaris box on which the owner has done all system installations, and
> then reproduced on three different UNIX architectures under my
> management.  The two test printers are a three-year old Lexmark Optra
> S 2560 (PostScript Level II), and a brand new Lexmark (model unknown)
> with PostScript Level III.
>
> The chain PageMaker -> Acrobat Reader -> PostScript file -> Adobe
> /usr/bin/X11/xpsview on the SGI leaves ghostscript completely out of
> the loop, and demonstrates the failure entirely with Adobe's own
> products.  However, gs and gv also disagree, and gs produces .ps files
> that cannot be printed.  Thus, I feel justified in posting this report
> to the gs-devel list.
>
> (1) Can anyone on this list reproduce these 2-out-of-3 failures for
>     the display and/or printing of the .ps files?
>
> (2) If so, does anyone have any clue as to what is happening?
>
> -------------------------------------------------------------------------------
> - Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
> - Center for Scientific Computing       FAX: +1 801 585 1640, +1 801 581 4148 -
> - University of Utah                    Internet e-mail: beebe@math.utah.edu  -
> - Department of Mathematics, 322 INSCC      beebe@acm.org  beebe@computer.org -
> - 155 S 1400 E RM 233                       beebe@ieee.org                    -
> - Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
> -------------------------------------------------------------------------------
> _______________________________________________
> Gs-devel mailing list
> Gs-devel@ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-devel
>