[gs-devel] Redirecting Output to a buffer instead of writing it
to disk.
Russell Lang
gsview at ghostgum.com.au
Sat Oct 18 21:50:53 PDT 2003
Phong,
If you build ghostscript as a DLL/shared object, and call it
directly, it is possible to have stdin and stdout handled by
callbacks. This allows you to feed stdin to ghostscript from a
buffer, and write stdout to a buffer. This is how I call use
ghostscript from GSview. It is also how ghostscript itself
works on Windows.
Russell
On 22 Sep 2003 at 14:07, Phong Ky wrote:
> Hi All,
>
> I'm currently trying to find a way to redirect the output information to a
> buffer instead of have Ghostscript write it to disk. Is there a parameter
> that does this? Or, is it something in the code I have to create? I'm
> currently looking at the function: argproc(gs_main_instance * minst, const
> char *arg) in the following code:
>
> if (minst->run_buffer_size) {
> /* Run file with run_string. */
> return run_buffered(minst, filearg);
> } else {
> /* Run file directly in the normal way. */
> return runarg(minst, "", filearg, ".runfile", runInit | runFlush);
> }
>
> It seems that if the run_buffer_size is larger than 0 it will put the output
> into a buffer. Otherwise, it will run the normal way, which it does now.
>
> Thanks.
>
> _______________________________________________
> gs-devel mailing list
> gs-devel at ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-devel
Russell Lang gsview at ghostgum.com.au
Ghostgum Software Pty Ltd http://www.ghostgum.com.au/
More information about the gs-devel
mailing list