r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Postscript] Emitting Postscript from REBOL

Graham
6-Apr-2006
[82]
One of the main reasons I suggested it is the high likelihood of 
success as you pointed out.
Gregg
6-Apr-2006
[83x2]
(as a world master here) First, Pekr, I can see how Graham interpreted 
some of your comments as negative ("Graham - either give me native 
rebol post script viewer, or forget it. I will not install ghost 
script..."), and I don't think he's being arrogant. I understand 
your point about wanting people to spend effort on things that are 
valuable to REBOL, but what's valueable to each of us is *completely* 
different in many cases. 


I hope you two can stay on good terms, because you're both valuable 
to the community.
(as a regular REBOLer) I've thought about doing the PS thing, because 
I hoped it would help printing support (and OSX uses DisplayPS, right? 
NeXT did too.). I also thought it would be a cool example, because 
of REBOL's Forth heritage that is very PS like (though I think someone 
once said that PS was *not* based on Forth..whatever). 


It shouldn't be too tough--I even have a couple PS book on my shelf 
if people need something looked up--but, like Pekr, I doubt the general 
practical usefulness for the average REBOL app user without a "full 
stack" of PS tools. That doesn't matter if you want it for yourself 
though, or we can bundle things into a distro for those who want 
it.
JaimeVargas
6-Apr-2006
[85]
Gregg, OSX moved from PS renderer of NeXT to a PDF one. This was 
to save money from licensing the PS engine from Adobe. Currently 
PS is converted to PDF by third party tools. PDF on the other hand 
is direct.
Gregg
6-Apr-2006
[86]
Ahh, thanks for the info.
james_nak
6-Apr-2006
[87]
I thought about this subject yesterday night and yeah, it would be 
nice to be able to do "anything and everything" in Rebol and PS does 
offer that. Besides the kind of charts that Graham showed, things 
like wrapping/flowing text around graphic images would be useful. 
Of course at some point I would most likely convert it to pdf through 
Distiller. 

I totally agree that good clean output is essential. My last programming 
foray in PS was some 16 years ago. At that time it was the only way 
to go for me. I suppose that alone shows the staying power of PS.
Graham
6-Apr-2006
[88x2]
Gregg, it's like cgi... unless you've got a web server, cgi is a 
waste of time for you.  If I have a web service that uses a postscript 
dialect to create a postscript image, and then uses ghostscript to 
convert to pdf .. well, that is useful to those running web services, 
but a waste of time for those who don't.
That's why we call them domain specific languages .. they're not 
for everyone, right!
Gregg
6-Apr-2006
[90]
Yup.
Henrik
6-Apr-2006
[91]
pekr, reading your comments seem to focus on a PS viewer. This is 
completely uninteresting to me. I want tools that are native to REBOL 
to allow me to print graphics directly to a printer with the fewest 
amount of 3rd party tools. How many shrinkwrapped apps out there 
need third party tools for something as basic as printing?
Graham
6-Apr-2006
[92]
I've got a colour laser printer on my network which I think supports 
postscript.  I presume to print a postscript file, I just send it 
to the ip address of the printer?
Maxim
6-Apr-2006
[93]
hum  good question.  I'd like to know this as well... anyone?
Graham
6-Apr-2006
[94x4]
I have a jetdirect usb print server at 192.168.1.253

>> port: open/direct tcp://192.168.1.253:9100
>> insert port read %boys-0-36-length-weight.ps
>> close port
and I printed out my postscript file with no problems.
jetdirect print servers use 9100 for data, and 80 for the embedded 
webserver.
That was pretty easy ... create the postscript  file, and send it 
directly to the printer, or print server.
Henrik
6-Apr-2006
[98]
precisely
Graham
6-Apr-2006
[99x3]
I wonder if we should use an existing dialect and modify it to product 
ps .. or create one from scratch.
Should we use pair! or not ?
moveto 72x72, or moveto 72 72 
postscript is RPN, so that looks like 72 72 moveto
Henrik
6-Apr-2006
[102]
what about starting from the DRAW dialect?
Graham
6-Apr-2006
[103]
I guess if the main aim is to take drawings to postscript, then that 
makes sense.
Henrik
6-Apr-2006
[104]
the fastest route definitely. a PS -> DRAW thing would be a nice 
thing to have but DRAW -> PS is the most important right now
Graham
6-Apr-2006
[105x2]
So, for example, if we used to plot dialect to draw a graph, we can 
then emit postscript and send directly to the printer.
used the Plot dialect ..
Henrik
6-Apr-2006
[107]
yes, I think it should work like the DRAW function, but instead of 
producing an image it produces a string! value to be used however 
you want it
Graham
6-Apr-2006
[108x3]
String! is good.
Or, perhap a block! for further processing?
Say you wanted to insert an eps file into your output.
Henrik
6-Apr-2006
[111]
not sure about the mechanism yet, but maybe yes
Graham
6-Apr-2006
[112]
An eps file is just a postscript file which is written in a special 
way ...
Henrik
6-Apr-2006
[113]
there is no paper information AFAIK
Graham
6-Apr-2006
[114x2]
In the name of science, I repeated the above test and it printed 
out again.
I also tried it with a pdf, as the printer supports direct pdf printing, 
but nothing happened.
Henrik
6-Apr-2006
[116]
interesting. tried different pdfs?
Graham
6-Apr-2006
[117]
Not yet.
Geomol
7-Apr-2006
[118x4]
DRAW -> PS is one possibility. Should we on a longer term also have 
a dialect or set of functions, than can produce PS?
that
DRAW is also a function used like:
img: make image! 100x100
DRAW img <some draw commands>

With PostScript, I'm thinking something like:
ps-output: ""
POSTSCRIPT ps-output <some PS commands>


ps-output could then also be a file! or port! and send the output 
directly to the destination.
<some PS commands> in the above is a block of commands with arguments.
Graham
7-Apr-2006
[122]
Is the aim to take a draw block and process it so that postscript 
is produced.
Geomol
7-Apr-2006
[123x2]
That's what I understood from Henrik's posts.
It's one way of doing it, and maybe not so bad. I don't know enough 
about PS to see, if DRAW is too limited. Maybe PS has a lot other 
stuff, you wanna do, that is difficult to do in DRAW.
Graham
7-Apr-2006
[125x2]
as far as I recall, it has quite a limited command set.
of course, you can define new functions within ps.
Geomol
7-Apr-2006
[127x2]
The DRAW approach is, that if you can produce your output in a DRAW 
block, then you can also print it using PS. My approach is to make 
a PS dialect, and keep DRAW out of is. With my approach, you can 
print from REBOL/Core too. I guess, we can have both approaches without 
problem.
And both will be usefull for different situations.
Graham
7-Apr-2006
[129]
but using a draw dialect is possible in core .. u just can't render 
it.
Geomol
7-Apr-2006
[130]
Oh, you're right. :-)
Graham
7-Apr-2006
[131]
but let's start with a postscript dialect and then see if we can 
retrofit draw to it.