> From [EMAIL PROTECTED] Tue Jul 9 18:17:13 2002
> From: Raph Levien <[EMAIL PROTECTED]>
> Date: Tue, 9 Jul 2002 18:16:19 -0700
> To: Patrick Powell <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
> Subject: Re: GhostScript PDF to PS Conversion Problems (reprise)
>
> 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:
>
> Yes, PDF is a random access file format, whereas PostScript streams.
> Thus, redirecting a file via stdin doesn't work in general.
>
> It is possible to do some PostScript-level hackery to store the
> stream into a temporary file, but it's usually a better idea to do
> it at the level above.
>
> Hope this helps,
>
> Raph
>
I have fought with this a bit more.
When you specify:
gs .... -f /dev/fd/0 </tmp/file
it works fine.
When you specify:
gs .... -f - </tmp/file
You get the error.
I am baffled. Is there some magic/limitation with using
the -f - that causes GhostScript to die BEFORE it does the
lseek(2) system call? Is there a problem with using lseek
on files that are NOT opened by GhostScript?
Note: I wrote a small C program to test this, and as far
as I can tell, lseek(0,0,0) worked just fine..
and when I did
int fd = open("/dev/fd/0", O_RDWR );
lseek(fd,0,0) worked just fine as well.
I am REALLY baffled at why this failes, and am not a GhostScript
code guru.
Patrick Powell
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.
-----------------------------------------------------------------------------