• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp5907
r3wp58701
total:64608

results window for this page: [start: 16501 end: 16600]

world-name: r3wp

Group: Postscript ... Emitting Postscript from REBOL [web-public]
Geomol:
6-Nov-2006
xavier: ghostscript maybe!? Depends on your OS. If you have a PS-net-printer, 
it's also possible to send it to a port on the printer.
xavier:
6-Nov-2006
it worked ... i was searching a dialect for formatting outputs that 
have to be printed ... and just find it
Gregg:
6-Nov-2006
Very cool John! Now, if we can get a DisplayPostscript engine in 
R3....
Graham:
7-Nov-2006
Cyphre .. how feasible would a PS renderer be in R3?
Pekr:
7-Nov-2006
Graham - isn't PS rendering "just" a question of particular dialect, 
translating into View faces rendering? (sorry, I am not fluent with 
PS, so dunno what would be needed, just asking)
Graham:
7-Nov-2006
I did a demo somewhere which showed the problem.
Graham:
7-Nov-2006
the other thing that PS has is a way to save the graphic state .. 
do stuff... and then restore the state
Pekr:
7-Nov-2006
imo draw, as introduced to View, is a hack .... it lives in effect 
pipeline, is that correct?
Pekr:
7-Nov-2006
maybe face, as a gob, should be more general, with some pluggable 
mechanisms ....
Cyphre:
7-Nov-2006
r: rot: 0 view layout [origin 0 box 400x400 white effect [draw [pen 
black translate 200x200 rotate

 rot translate -200x-200 box 100x150 300x250]] rate 0 feel [engage: 
 func [f a e][if a = 'time [r: r +
 1 rot: 360 // 360 - r show f]]]]
Geomol:
7-Nov-2006
I like the look of DRAW! :-) (Of course it's due to AGG.) I still 
miss a version of REBOL for Mac with full DRAW, as the Windows version 
has it.
Geomol:
7-Nov-2006
Pekr, yes I still have Canvas RPaint on hold until I can release 
a final version 1.0 for Windows, OS X and Linux at the same time. 
Some DRAW things are missing, which Windows version has.
Pekr:
7-Nov-2006
do you need cross-platform compatibility for intitial release? Hmm, 
maybe so, as a marketing advantage ...
Geomol:
7-Nov-2006
When I was just about to release it, I desided to wait for better 
support of DRAW on the other platforms (and in some way for rebcode 
too). Looking back, I should maybe have release it almost a year 
ago. It's just, that Windows always get the good stuff. I use OS 
X now, and REBOL is cross-platform, so a thing like RPaint should 
be the same on all platforms. I'm also concerned about marketing, 
as you say. Releasing for three platforms at the same time is preferable 
for me.
Geomol:
7-Nov-2006
We don't know for sure. That Carl is using OS X daily now might be 
a good thing for my situation. We can hope, wait and see.
Geomol:
7-Nov-2006
Do this in a REBOL prompt to run the test:

do http://home.tiscali.dk/john.niclasen/postscript/postscript.r

write %test.ps postscript load http://home.tiscali.dk/john.niclasen/postscript/test.txt

Now the file %test.ps holds the postscript output.
Pekr:
8-Nov-2006
are those dialects a bit compatible, or completly different syntaxes?
Pekr:
8-Nov-2006
reading your Synapse link reference - actually that is the quesiton 
of POV, for me the first paragraph has completly reverse meaning 
"The advantage of using PostScript is that Synapse EMR can display 
them nativey, and does not use PDF for printing.". I think that most 
ppl and platforms do have PDF Reader of some form, which means - 
I've got a preview mechanism, avoiding user to easily modify the 
output.
Geomol:
8-Nov-2006
Shortly you can say, PS is a language (used by professionals describing 
output in a very precise way) and PDF is a document format.
Henrik:
8-Nov-2006
pekr, the advantage of using the PS dialect is that it can be fed 
directly to a postscript printer. This enables printing in all versions 
of REBOL. PDF needs to go through an external PS conversion program 
to do the same.
Rebolek:
8-Nov-2006
Pekr: from the geomol's link: "A PDF file is actually a PostScript 
file which has already been interpreted by a RIP and made into clearly 
defined objects. These objects are viewable on screen not in code, 
but in visual objects that everyone can see."
Henrik:
8-Nov-2006
TeX is a markup system, kind of like HTML. you can produce PS documents 
from TeX files.
Geomol:
8-Nov-2006
Yes, it might be a bit difficult for end-users to preview PS (unless 
you use Mac OS X or the like), where PDF might be easier to preview, 
because "everybody" now-a-days has Acrobat Reader.
Pekr:
8-Nov-2006
Henrik - 95% of everythin I want to print, goes via preview first. 
The need to install GSview or something like that is total problem 
(because of already current penetration of Adobe Readers, I regard 
it being a solved case :-)
Henrik:
8-Nov-2006
something with clearly defined graphics, maybe with a few varying 
text fields.
Henrik:
8-Nov-2006
I tried and failed, but I might have used a wrong approach. Graham 
has done some PS previewing in a demo.
Henrik:
8-Nov-2006
PDF is basically a compiled PS document. Requires less "brainpower" 
to display.
Henrik:
8-Nov-2006
geomol, I think that it should be kept at a low level. This way I 
or someone else can build a library of standard things on top of 
it to generate formatted pages, tables, formatted paragraphs and 
such.
Geomol:
8-Nov-2006
Henrik, yes, the postscript dialect should be low-lever as it is 
now. It's a fine base for further development. You can use it directly 
as you do, or someone could build new dialects producing postscript 
dialect output, which then can be made into final PostScript. (If 
you know, what I mean. Difficult to explain.) :-)
Henrik:
8-Nov-2006
yes, it can become very powerful. one could actually build a system 
like LAYOUT this way to build PS documents.
Henrik:
8-Nov-2006
in fact, I think it would be a good idea to coordinate this, in case 
someone wants to start building such stuff to avoid duplicate or 
overlapping efforts.
Geomol:
8-Nov-2006
ps2pdf is also a command (I think included with Ghostscript): http://www.cs.wisc.edu/~ghost/doc/AFPL/6.50/Ps2pdf.htm
Geomol:
8-Nov-2006
Pekr, what about making a small REBOL program, which can load postscript 
dialect txt-file, convert it to a .ps file, then call ps2pdf and 
finally call a PDF-viewer (Acrobat Reader) to see the result. You 
could also include a button to send the .ps file to a printer. Then 
you'll have PostScript with preview and all (also under Windows).
Geomol:
8-Nov-2006
(Also I'm on OS X, so I don't have the preview problem, because the 
OS auto convert to PDF, if I'll like to see a .ps file.)
Maxim:
8-Nov-2006
Rebolex, that's such a nice target for liquid... is the code anywhere?
Geomol:
9-Nov-2006
Perhaps we need a little print-spooler in a multi-user environment? 
May be a good job to solve using REBOL. It should be able to receive 
printjobs from plenty of users at the same time (using multi-threading 
much like the way Apache serve multiple users with web-pages) and 
then send the jobs to the printer one at a time. Maybe someone already 
did it in REBOL? Or if there is a server at hand, just send the jobs 
to the spooler in the server. I'm not too familar with spoolers. 
Will they leave the PostScript printjob as it is, and just send it 
to the printer? I could figure, that Windows spoolers would like 
to change the PS into something else using a print-driver.
Henrik:
9-Nov-2006
I wrote a very small one, about 2 kb in size with a GUI. I can't 
remember, but I think it uses Rugby.
Henrik:
9-Nov-2006
I made it for a very specific purpose (as one would do in REBOL), 
so it may have to be rewritten.
xavier:
31-Jan-2007
is there someone who have an idea for printing in rebol on a dot 
matrix printer ? i have to pilot it for printing a pre formated bill 
for dental care.  If anybody see what i mean..  I was wondering about 
how to do it in rebol, by passing by a markup langage but i dont 
know how it work.  if anybody got an idea...
xavier:
31-Jan-2007
i probably have to do it with a tally manesman if it can help
xavier:
31-Jan-2007
and a dot matrix printer is not supposed to be connected by something 
else then the lpt port
Henrik:
31-Jan-2007
if you have access, try this on the machine in a dos prompt:

echo test > lpt1:
Sunanda:
31-Jan-2007
You may wnat to investifate Epson escape codes, eg:
http://www.cyberroach.com/analog/an10/epson.htm

There is a chance the printer will respond to them, and it may give 
you extra flexibility -- eg sending tabs rather than loads of spaces; 
or bolding, underline etc.
Sunanda:
31-Jan-2007
A bit like curses:
http://www.rebolforces.com/articles/tui-dialect/
Henrik:
31-Jan-2007
neat. could sometimes be nice if you are using SSH terminals a lot.
xavier:
31-Jan-2007
it must be possible to describe a document for a dot matrix printer 
with that
BrianH:
2-Feb-2007
That would be cool. I'd like to see if there would be a way to make 
it more powerful, something along the lines of Functional PostScript.
BrianH:
2-Feb-2007
I always thought Scheme was a little clumsy for that. REBOL should 
be better.
Geomol:
2-Feb-2007
The latest version got rid of many of the blocks:
http://home.tiscali.dk/john.niclasen/postscript/postscript.html

A test source: http://home.tiscali.dk/john.niclasen/postscript/test.txt
BrianH:
2-Feb-2007
Sweet. I'll take a look next week.
Henrik:
10-Apr-2007
right, but does the printer center the drawing or put it in a corner 
or scale it up or how?
Henrik:
10-Apr-2007
I'm just not sure that is a good way to handle page sizes
Graham:
10-Apr-2007
most of the time I think most eps printing is done inside a dtp program 
and you can then shift the image around to where you want it.
Graham:
10-Apr-2007
you would need a postscript interpreter to find out where the image 
is going to go.
Henrik:
10-Apr-2007
it seems Preview insists on using Letter as page size for postscript.r 
output. I have to assume that a real printer does the same. I need 
A4 and A5 both in portrait and landscape.
Graham:
10-Apr-2007
because eps is just a special postscript file that does not permanently 
alter the environment
Graham:
10-Apr-2007
you need a bounding box in your ps file
Henrik:
10-Apr-2007
oh, hang on. there was a combination of things I didn't try here...
Henrik:
10-Apr-2007
it behaves like a printer with letter paper in it. and just scales 
anything to fit in it.
Henrik:
10-Apr-2007
if I ask for a print preview and specifically ask for A5 paper, it 
clips the drawing like a printer would
Henrik:
10-Apr-2007
created a postscript knowlegde base checklist
Geomol:
10-Apr-2007
A couple of useful PS links:

How to generate portable Postscript: http://alumni.media.mit.edu/~szummer/postscript/

What is the physical size of the page?: http://www.postscript.org/FAQs/language/node64.html

How to use Adobe PostScript language files properly.: http://www-cdf.fnal.gov/offline/PostScript/AdobePS.html

(Look under "Paper bin, tray, size, feed mode, etc. selection", where 
you also find a link to:)
PostScript Sins: http://www.byte.com/art/9508/sec13/art3.htm
Gripes: http://www.cs.wisc.edu/~ghost/doc/gripes.htm
Henrik:
10-Apr-2007
Geomol, I made a checklist for links
Henrik:
10-Apr-2007
Geomol, I've added EPS output, bounding box and page orientation 
to postscript.r. This is done with a 'preamble which is followed 
by a block.
Geomol:
10-Apr-2007
Regarding landscape, then I think, it's just a comment in PS (%%PageOrientation) 
used for previewing.
Geomol:
10-Apr-2007
It may be more clear, if we look at PS as a low level language to 
control some type of printer or typesetter. It goes like: move to 
this position, print this text using this font, move to this other 
position, print text, ...

Landscape is done with 90 degree rotation before doing the print 
command.
Henrik:
10-Apr-2007
which is also why it would be tough to do in VID, since it does not 
have a method for easy 90 degree rotation of text
Henrik:
10-Apr-2007
well, DRAW can't use proper centering and right alignment... somehow 
this reminds me of a toolbox with a broken hammer and bent nails...
Graham:
10-Apr-2007
Must be a change of heart occuring .. Carl said he never imagined 
anyone doing type setting with Rebol!
Henrik:
10-Apr-2007
but a basic thing like placing text according to the baseline is 
also missing. this is also not brought up to REBOL level.
Geomol:
10-Apr-2007
Yeah, it's a bit tricky. There's a link in the DRAW docs to: http://www.w3.org/TR/SVG/coords.html#EstablishingANewUserSpace
where you might get some explanation.
Geomol:
10-Apr-2007
It's just a general way of combining different effects.
Henrik:
23-Feb-2008
I messed around with it a bit to get it to print on A5 sheets, but 
ended up just drawing on the A5 area.
Geomol:
23-Feb-2008
Yes, if it's a good idea to put pagesize in there. I did a test and 
missed some lines in the top of my document, when producing ps output.
Henrik:
23-Feb-2008
I was afraid of messing with it, since only a single error, such 
as leaving a standard postscript command out or putting another one 
in, caused some printers to stop working with it.
Henrik:
23-Feb-2008
There is a bug with printing multiple pages on certain HP printers. 
After the first page, some char is missing, that causes it to wait 
until you press the Online button or page feed button. I really would 
like that to be fixed. The work-around is to print to a file and 
have it printed using Printfile under Windows.
Henrik:
23-Feb-2008
it was a panic situation .:-)
Geomol:
23-Feb-2008
Added PageSize and images to the PostScript dialect. There seem to 
be a problem with jpg!?
Henrik, try this:

do http://home.tiscali.dk/john.niclasen/postscript/postscript.r

write %imagetest.ps postscript [page [translate 100 600 scale 72 
72 image logo.gif translate 100 500 scale 144 144 image logo.gif 
translate 100 300 scale 288 288 image logo.gif]]

Then view or print the file imagetest.ps
Geomol:
23-Feb-2008
This gives a result, that I can't view on my Mac for some reason:


write %imagetest.ps postscript [page [translate 100 400 scale 72 
72 image http://www.rebol.com/view/palms.jpg]]

Any suggestions?
Geomol:
23-Feb-2008
I have problem viewing the test with jpg here. It can't convert it 
to a viewing format (prob. PDF). Can you test the ghostscript viewer?
Geomol:
23-Feb-2008
Yes, images are handled as REBOL image! types. If the dialect is 
given a file! or url!, it'll load the image. It can also take a word!, 
which is the image. It then convert the image/rgb to base-16 and 
put it in the ps-file.
Geomol:
23-Feb-2008
So images in postscript files take up a lot of space! Most people 
knows this already. I tried to put a 100k png image in a postscript 
file, and it then was > 11MB.
Graham:
23-Feb-2008
But if the image is big, it remains big ... not that it's a problem 
because it's being dumped to a printer.
Henrik:
23-Feb-2008
it's a problem for speed, but perhaps there really is no way around 
it
Graham:
23-Feb-2008
Here's an article on coverting a jpeg to image using postscript functions 
http://www.tinaja.com/glib/jpg2pdf.pdf
Geomol:
23-Feb-2008
This with large printfiles, it's the same, that happens, if you print 
text using a font, that the printer doesn't know. Everything is converted 
to image data, and one page can be several MB.
Geomol:
23-Feb-2008
The image problem seems to be related to size. I tried to make a 
little image entirely in REBOL, and I can see that. Making a larger 
image, and Preview under OSX can't convert it to PDF. I would like 
to know, if my example above with palms.jpg can be printed on paper.
Graham:
23-Feb-2008
Since postscript is a printer language, it can print the stacks if 
it encounters an error.
Graham:
23-Feb-2008
sure if you're using ghostscript .. I meant if you were testing on 
a postscript printer.
Graham:
23-Feb-2008
You have to write a postscript function that prints the stacks.
Graham:
23-Feb-2008
No.  Just a debugging function that you add to your postscript file 
that you are trying to print.
Henrik:
23-Feb-2008
perhaps that would be a good thing to include in the dialect.
Henrik:
24-Feb-2008
wow, that took a long time to generate.
Geomol:
24-Feb-2008
Maybe because it had to load image from web also!? Try with a local 
version of the image.
Geomol:
24-Feb-2008
Maybe your system had a hickup? Try again!
Henrik:
24-Feb-2008
will test with a local file soon
Geomol:
24-Feb-2008
Try take a local copy of postscript.r and change the load-image to 
not do a /update.
Henrik:
24-Feb-2008
perhaps 12 seconds with a local palms.jpg file
Geomol:
24-Feb-2008
Images are implemented in postscript.r using ASCIIHexDecode filter, 
which double the size of image data. It would be better to implement 
ASCII85, which does a 4:5 increase only.


Also images are handled in something called dictionaries in PostScript. 
This require PostScript v. 2.0.
Geomol:
24-Feb-2008
If you look in postscript.r, I encode the image data in line 211-220. 
It's just normal hex written as ASCII, so you get '0'-'9' + 'A'-'F'.
16501 / 6460812345...164165[166] 167168...643644645646647