Thread View: gnu.ghostscript.bug
1 messages
1 total messages
Started by Eric Marshall
Mon, 09 Nov 1992 02:37
Problems using ghostscript through a pipe
Author: Eric Marshall
Date: Mon, 09 Nov 1992 02:37
Date: Mon, 09 Nov 1992 02:37
45 lines
1933 bytes
1933 bytes
I am writing a graphics application which I would like to
use ghostscript to do the actual imaging. I thought the easiest
way for me to do this was to open a pipe to gs and just write PostScript
to it, but I am having a little trouble with this. The following is the
program I am using to test my idea.
#include <stdio.h>
main()
{
extern char *gets();
FILE *gs = popen( "./gs -", "w" );
char input_line[ 100 ];
while ( gets( input_line ) != NULL ) {
fputs( input_line, gs );
putc( '\n', gs );
fflush( gs );
}
}
There are two problems that I have. One is that the input
data doesn't seem to be getting to gs in a timely fashion. If I
run my test program using the tty as the standard input, none of my
PostScript graphics appear in the ghostscript window as I enter them.
I have to enter EOF and then only some of the graphics appear. For
example, *half* of a line appears. If I redirect input from a file,
all is fine.
I am running on a color Sun SPARCstation 1 running
SunOS 4.1.1 with with ghostscript 2.5.2.
Thanks in advance.
Eric Marshall
Software Productivity Consortium
SPC Building
2214 Rock Hill Road
Herndon, VA 22070
(703) 742-7153
marshall@software.org
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads