Postscript


#1

Hi,

I was just wondering what needs to be done to display a postscript like output (like PDF or AI) in a Juce’s Component.
I mean, basically, all is already here (vector graphic, antialiased-text, etc…).

So far, I think that the most difficult part will be the parser and mapping to Graphics’s primitives.

I would like to have advice from Jules about this…

Oh, by the way, I’m asking this because I would like to present a “formatted” text output (understand with layout and pictures), and I think PS is cheaper than HTML parsing in all case.


#2

i know is terrible to traverse a complex recursive xml document and check for attribute and childs… maybe u can use a subset of svg… and the XmlDocument class maybe can help in parsing it…


#3

Agh… I’m no expert on PS, but I bet it’s a bugger to parse! Doesn’t it have stuff like procedures in there, so it’s almost like running a program?

I’m sure Juce has all the primitives you’d need to draw the result, but I don’t fancy writing a parser for it! Maybe there’s a free parser you could use, like ghostscript, perhaps?


#4

Yeah exactly. I guess I’ll have to fallback to either PDF (which is a very very limited subscript of PS) or implement a HTML parser.

In that case, is it possible to embed gecko in a Component ?
Or best, is it possible to embed an ActiveX (so I can embed Acrobat reader) in a component ?

I really hope it is…


#5

You can embed a HWND, because that’s what I do for openGL, QT, VSTs, etc., so I guess you can put an ActiveX in there.


#6

Why not SVG? It’s simple XML, though Adobes programs tend to make it look horrible.
As for ActiveX, I don’t know jack about this stuff but MS web browser component (IE rendering thingamabob) is a part of the platform and should be able to load activeX thingies.

I did something like that in VB 6 with like 10 lines of code back in the day, as a quick and dirty solusion to displaying and printing database reports.


#7

If I had to create a SVG parser, I would use Antigrain Geometry library (as the work is already done, and I’m lazy).

I want to display a document in a Component with a given layout. The layout is sadly not static.

I can do it in many way which includes :
[list]
[] Implementing a PDF parser and using Juce’s primitive to display it[/]
[] Implementing a HTML parser and using Juce’s primitive to display it[/]
[] Implementing RTF (but it seems too limited to me)[/]
[] Implementing a SVG parser (ok, XML document does half the job), but SVG is not exactly want I want[/]
[] Embedding a HTML engine like gecko or webcore but I’ll loose all the antialiased graphics and so on[/]
[] Embedding an ActiveX component so I could use Acrobat Reader’s ActiveX, or Firefox ActiveX or IE ActiveX (it would be pluggable) but I’ll loose all the antialiased graphics and so on[/][/list]

In fact, I’ll try to use the activeX approach first.


#8