graphic rendering question  
Author Message
Scott





PostPosted: 2004-7-11 13:58:00 Top

java-programmer, graphic rendering question Hi All,

I am investigating writing a Java application to render postscript into a
Graphics2D object (or other suitable alternative). Has anyone had any
experience with this sort of thing? I have come across a number of
libraries that work in the other direction (i.e. Graphics2D to postscript
or PDF), but none for what I have in mind. Could anyone suggest some
possibilities? Thanks very much.

Best regards,
Scott
 
Thomas Weidenfeller





PostPosted: 2004-7-12 15:24:00 Top

java-programmer >> graphic rendering question Scott wrote:
> I am investigating writing a Java application to render postscript into a
> Graphics2D object (or other suitable alternative). Has anyone had any
> experience with this sort of thing? I have come across a number of
> libraries that work in the other direction (i.e. Graphics2D to postscript
> or PDF), but none for what I have in mind. Could anyone suggest some
> possibilities?

You know that PostScript is a non-trivial language? There is some
serious programming ahead of you. E.g. a PostScript RIP like ghostscript
consists of 50 MB (yes, MegaBytes) of source code - compressed ... These
50 MB includes many drivers, so the RIP might only be 10 MB or 20 MB
source code - still compressed.

If you want to do it, get a good book about FORTH, since PostScript
borrowed a lot from that language. And of course get Adobe's PostScript
Language reference book (approx. 900 pages). The book is also known as
"The Red Book" or just "The PostScript Bible".

You could also have a look at Sun's attempt at it (the demo can just
render three or four common PostScript demo images and barfs at
everything real PostScript):

http://java.sun.com/products/java-media/2D/samples/postscript/PostscriptDemo.zip

Good Luck. You need it.

/Thomas
 
Roedy Green





PostPosted: 2004-7-13 3:24:00 Top

java-programmer >> graphic rendering question On Sun, 11 Jul 2004 05:58:13 GMT, Scott <email***@***.com> wrote or
quoted :

>I am investigating writing a Java application to render postscript into a
>Graphics2D object (or other suitable alternative). Has anyone had any
>experience with this sort of thing? I have come across a number of
>libraries that work in the other direction (i.e. Graphics2D to postscript
>or PDF), but none for what I have in mind. Could anyone suggest some
>possibilities? Thanks very much.

Writing an PS rendering engine is a big job. You could have a look at
GhostScript http://mindprod.com/jgloss/ghostscript.html
I think it is open source. At least they let you look at the source.

PS is a full blown language in its own right, something like Forth,
RPN Stack based. You are attempting something on the same order of
difficultly as implementing a JVM and a set of native classes.


--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
 
Scott





PostPosted: 2004-7-13 5:34:00 Top

java-programmer >> graphic rendering question On Mon, 12 Jul 2004 09:24:28 +0200, Thomas Weidenfeller wrote:

> You could also have a look at Sun's attempt at it (the demo can just
> render three or four common PostScript demo images and barfs at
> everything real PostScript):
>
> http://java.sun.com/products/java-media/2D/samples/postscript/PostscriptDemo.zip
>
>

Thanks for the link. I should perhaps have been a bit more specific with
my request to prevent the "are you crazy!?" responses! I have quite a bit
of PostScript programming experience, and I have already written a
graphics application that saves its output as postscript (in C++). It
actually uses a very minimal subset of PostScript (mainly just simple
math, some moveto, lineto and curveto stuff plus text). So the java app
would not even begin to approach a full featured postscript interpreter
like ghostscript, but instead be just enough to render the output of my
graphics program. I was hoping that a library might already exist that I
could use, but it looks like I will have to do it from scratch.

Best,
Scott
 
 
Thomas Weidenfeller





PostPosted: 2004-7-13 16:26:00 Top

java-programmer >> graphic rendering question Scott wrote:
> my request to prevent the "are you crazy!?" responses!

These are the moments when I regret that I answered a question. Don't
worry, won't happen again.

BTW: if you can't live with the answer(s), don't ask in public.

/Thomas
 
 
Scott





PostPosted: 2004-7-16 0:44:00 Top

java-programmer >> graphic rendering question On Tue, 13 Jul 2004 10:25:36 +0200, Thomas Weidenfeller wrote:

> Scott wrote:
>> my request to prevent the "are you crazy!?" responses!
>
> These are the moments when I regret that I answered a question. Don't
> worry, won't happen again.
>
> BTW: if you can't live with the answer(s), don't ask in public.

I think you completely misunderstood my response. Perhaps I should have
included a smiley face :-)? You offered a valuable link, and I thanked
you for it. All I was trying to convey was that both responses to my
question were along the lines of 'that's going to be a big job and I hope
you know what you are in for'. I then just wanted to confirm that I
wasn't really as crazy as I may have seemed, and to clarify my question a
bit. Sorry you took offence.

Best,
Scott

 
 
Liz





PostPosted: 2004-7-16 8:06:00 Top

java-programmer >> graphic rendering question
"Scott" <email***@***.com> wrote in message
news:email***@***.com...
> On Tue, 13 Jul 2004 10:25:36 +0200, Thomas Weidenfeller wrote:
>
> > Scott wrote:
> >> my request to prevent the "are you crazy!?" responses!
> >
> > These are the moments when I regret that I answered a question. Don't
> > worry, won't happen again.
> >
> > BTW: if you can't live with the answer(s), don't ask in public.
>
> I think you completely misunderstood my response. Perhaps I should have
> included a smiley face :-)?

Smiley faces are reserved now for student grades instead of A..F
That way everyone gets into college.

> You offered a valuable link, and I thanked
> you for it. All I was trying to convey was that both responses to my
> question were along the lines of 'that's going to be a big job and I hope
> you know what you are in for'. I then just wanted to confirm that I
> wasn't really as crazy as I may have seemed, and to clarify my question a
> bit. Sorry you took offence.
>
> Best,
> Scott
>


 
 
ak





PostPosted: 2004-8-5 11:56:00 Top

java-programmer >> graphic rendering question > actually uses a very minimal subset of PostScript (mainly just simple
> math, some moveto, lineto and curveto stuff plus text). So the java app
> would not even begin to approach a full featured postscript interpreter
> like ghostscript, but instead be just enough to render the output of my
> graphics program. I was hoping that a library might already exist that I
> could use, but it looks like I will have to do it from scratch.

scott, this library really exists:
see here http://www.acme.com/java/software/Acme.Psg.html

--
Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader


 
 
Liz





PostPosted: 2004-8-5 12:37:00 Top

java-programmer >> graphic rendering question
"ak" <email***@***.com> wrote in message news:cesb4h$gjs$email***@***.com...
> > actually uses a very minimal subset of PostScript (mainly just simple
> > math, some moveto, lineto and curveto stuff plus text). So the java app
> > would not even begin to approach a full featured postscript interpreter
> > like ghostscript, but instead be just enough to render the output of my
> > graphics program. I was hoping that a library might already exist that
I
> > could use, but it looks like I will have to do it from scratch.
>
> scott, this library really exists:
> see here http://www.acme.com/java/software/Acme.Psg.html

I just checked this site. I wanted to make some simple postscript
graphics pages (great for forms and such) and so I started to write
my own postscript methods. Well after a little while I ended up
with little kludges here and there, cuz I didn't really do any
design, just hacking. This package might be just what I need
to do it right.

>
> --
> Andrei Kouznetsov
> http://uio.dev.java.net Unified I/O for Java
> http://reader.imagero.com Java image reader
>
>