graphic rendering question

S

Scott

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
 
T

Thomas Weidenfeller

Scott said:
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
 
R

Roedy Green

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.
 
S

Scott

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
 
T

Thomas Weidenfeller

Scott said:
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
 
S

Scott

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
 
L

Liz

Scott said:
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.
 
A

ak

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
 
L

Liz

ak said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top