Need std input script for Gsview

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Need std input script for Gsview

#1 Post by BarryK »

Can anybody think how to do this?...

The original Ghostscript, which is a Postscript/PDF viewer, accepts standard input on the commandline, as well as a filename.
Some applications, for example, Ical, invoke Ghostscript like this:

ghostscript -

Unfortunately, the developer of Gsview, the Postscript viewer used in Puppy, neglected to support standard input on the commandline.

Currently Puppy has ghostview as a symbolic link to gsview, but I propose that ghostview become a small script or C application that will accept std input on the commandline, write it to a file, for example /tmp/printing.ps, then run gsview.
Anyone know how to write code that will do that?
...it's probably real simple, but I haven't had my morning cup of coffee yet, so my brain is only partially functioning.

menno

#2 Post by menno »

It means that a program write somthing to stdout which is used as a pipe to stdin . And the call to gostscript does not understand how to read stdin ?

Or is the problem already solved ?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#3 Post by BarryK »

menno wrote:It means that a program write somthing to stdout which is used as a pipe to stdin . And the call to gostscript does not understand how to read stdin ?
That's right. This does not work:

Code: Select all

 cat afile.ps | gsview -
It does work with the original ghostview.

And no, no solution yet.

menno

viewing printing

#4 Post by menno »

Barry the problem is in dg_print.tcl .
first change at line 46 'ghostview -' -> 'ghostview ' , better is to change it into 'gsview ' .
replace 214 and on into :

Code: Select all

    pr_file $pr_save $output
    switch -exact -- $pr_type {
	save	{  }
	print	{ exec $pr_print $pr_save }
	preview	{ exec $pr_preview $pr_save }
	default { error "Unknown printing mode $pr_type" }
       }
What I done is save standard to the file 'cal.ps' and if preview or printing call
exec <command> cal.ps

It seems to work . Greating Menno

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#5 Post by BarryK »

great, I'll check it out in Ical.

Post Reply