# Postscript

**URL:** <https://forum.juce.com/t/postscript/689>\
**Category:** General JUCE discussion\
**Created:** [February 23, 2006, 12:56pm UTC](https://forum.juce.com/t/postscript/689 "2006-02-23T12:56:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![X-Ryl669](https://avatars.discourse-cdn.com/v4/letter/x/a5b964/32.png) [@X-Ryl669](https://forum.juce.com/u/X-Ryl669)\
**Post date:** [February 23, 2006, 12:56pm UTC](https://forum.juce.com/t/postscript/689/1 "2006-02-23T12:56:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [February 23, 2006, 1:09pm UTC](https://forum.juce.com/t/postscript/689/2 "2006-02-23T13:09:07Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 23, 2006, 1:53pm UTC](https://forum.juce.com/t/postscript/689/3 "2006-02-23T13:53:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![X-Ryl669](https://avatars.discourse-cdn.com/v4/letter/x/a5b964/32.png) [@X-Ryl669](https://forum.juce.com/u/X-Ryl669)\
**Post date:** [February 23, 2006, 5:47pm UTC](https://forum.juce.com/t/postscript/689/4 "2006-02-23T17:47:03Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 23, 2006, 5:58pm UTC](https://forum.juce.com/t/postscript/689/5 "2006-02-23T17:58:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rock\_Hardbuns](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Rock\_Hardbuns](https://forum.juce.com/u/Rock_Hardbuns)\
**Post date:** [February 23, 2006, 6:18pm UTC](https://forum.juce.com/t/postscript/689/6 "2006-02-23T18:18:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![X-Ryl669](https://avatars.discourse-cdn.com/v4/letter/x/a5b964/32.png) [@X-Ryl669](https://forum.juce.com/u/X-Ryl669)\
**Post date:** [February 24, 2006, 10:34am UTC](https://forum.juce.com/t/postscript/689/7 "2006-02-24T10:34:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 12, 2017, 10:03am UTC](https://forum.juce.com/t/postscript/689/8 "2017-05-12T10:03:24Z")

</div>

Closed on May 12, 2017, 10:03am UTC


