I know I am little educated in these matters, but, various sources
emphasize that pdf files require random access to be processed, and that
it is not possible to obtain random access by piping pdf files through
std input.

Joel

On Tue, Jul 09, 2002 at 05:30:02PM -0700, Patrick Powell wrote:

> I tried to post this via the SourceForge bug reporting,  but it did not
> work, so I am posting this to Raph Levien and the LPRng mailing list
> in hopes that somebody can solve this one.
> 
> Version:AFPL Ghostscript 7.04
> System: FreeBSD 4.5/RedHat Linux 
> 
> Problem:  when using pdf2ps and with input from STDIN and output to STDOUT
> it gives and error.  I have include a trace of the problem below. The
> problem seems to be that when you specify input as 'stdin' or '-' then
> the setfileposition operator fails.  For example, the ifhp uses GhostScript
> (actually the guts from the pdf2ps program that in turn uses ghostscript)
> to do PDF to Postscript conversion.  Here is a trace of the operations:
> 
> >  tempfile 'ifhpXXXXXX'
> >  new tempfile 'ifhpuMZZBP', fd 3
> >  pgm '/usr/local/bin/gs -dSAFER -dPARANOIDSAFER -dBATCH -dNOPAUSE -q 
>'-sOutputFile=/dev/fd/3' 3>&1 1>&2 -sDEVICE=pswrite  -c save pop -f -', title 
>'CONVERTER', stdin 0, stdout 3
> >  started CONVERTER- 'gs'
> >  'CONVERTER' error msg 'Error: /ioerror in --setfileposition--'
> >  'CONVERTER' error msg 'Operand stack:'
> >  'CONVERTER' error msg '   --nostringval--   --nostringval--   0'
> >  'CONVERTER' error msg 'Execution stack:'
> >  'CONVERTER' error msg '   %interp_exit   .runexec2   --nostringval--   
>--nostringval--
> > --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   
>--nostringval--   false   1   %stopped_push   1   3
> > %oparray_pop   --nostringval--   --nostringval--   --nostringval--   
>--nostringval--   --nostringval--'
> >  'CONVERTER' error msg 'Dictionary stack:'
> >  'CONVERTER' error msg '   --dict:1007/1123(ro)(G)--   --dict:0/20(G)--   
>--dict:71/200(L)--   --dict:71/200(L)--   --dict:97/127(ro)(G)--   
>--dict:220/230(ro)(G)--   --dict:7/15(L)--'
> >  'CONVERTER' error msg 'Current allocation mode is local'
> >  'CONVERTER' error msg 'AFPL Ghostscript 7.04: Unrecoverable error, exit code 1'
> >  converter pid 19750, exit 'exit status 1'
> 
> I also tried the following script (/tmp/d):
> 
> #/bin/sh
> /bin/sh -c '(/usr/local/bin/gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite 
>-sOutputFile=/dev/fd/3 3>&1 1>&2 -c save pop -f -)' </tmp/one.pdf
> 
> h110: {199} % sh /tmp/b >/tmp/d
> Error: /ioerror in --setfileposition--
> Operand stack:
>    --nostringval--   --nostringval--   0
> Execution stack:
>    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   
>2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   
>%stopped_push   1   3   %oparray_pop   --nostringval--   --nostringval--   
>--nostringval--   --nostringval--   --nostringval--
> Dictionary stack:
>    --dict:1007/1123(ro)(G)--   --dict:0/20(G)--   --dict:71/200(L)--   
>--dict:71/200(L)--   --dict:97/127(ro)(G)--   --dict:220/230(ro)(G)--   
>--dict:7/15(L)--
> Current allocation mode is local
> Last OS error: 13
> AFPL Ghostscript 7.04: Unrecoverable error, exit code 1
> 
> If I use:
> /bin/sh -c '(/usr/local/bin/gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite 
>-sOutputFile=/dev/fd/3 3>&1 1>&2 -c save pop -f /dev/fd/0)' </tmp/one.pdf
> 
> Then there are no errors and things are fine.
> 
> Do you have any suggestions on this?
> 
> Patrick Powell                 Astart Technologies
> [EMAIL PROTECTED]            6741 Convoy Court
> Network and System             San Diego, CA 92111
>   Consulting                   858-874-6543 FAX 858-279-8424 
> LPRng - Print Spooler (http://www.lprng.com)
> 
> -----------------------------------------------------------------------------
> YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> The address you post from MUST be your subscription address
> 
> If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
> to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
> with:                           | example:
> subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
> unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]
> 
> If you have major problems,  send email to [EMAIL PROTECTED] with the word
> LPRNGLIST in the SUBJECT line.
> -----------------------------------------------------------------------------

-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to