[Gsview] ghost question
Russell Lang
gsview at ghostgum.com.au
Sun Mar 7 19:13:30 PST 2004
Kevin,
> I would like to ask a few question about GhostScript and
> ghostview. First of all, I would like to develop an ActiveX
> that is able to display a PDF in a web page. I have a
> functional prototype based on gswin32.exe. However, since
> gswin32.exe is a command line application, there is stdin and
> stdout interaction with the user and ghostscript seemed to be
> drived by thoses commands.
>
> My prototype simply block on the stdin callback, wait for the
> user click on a button labeled "next page". Once this button
> clicked, the message is sent to the main thread and a new
> line is copied in the stdin buffer.
>
> I know there is better way to handle this situation, but the
> documentation is really not complete for Win32 applications.
> Additionnaly, I still don't how to display previous pages (go
> back).
>
> I tried to traced gs view code to see how it's implemented,
> but it's very BIG and hard to trace. So that's why I ask on
> this list for a few HINTS to ghostscripts experts.
>
> What are the best way to drive ghostscript from Windows
> application ( user click buttons, menus etc) ? What about
> gs_run_string ? Are those thousands of postscripts files
> necessary(what would be a minimal script) ?
GSview is pretty messy to trace, because it is running two
threads - one for the user interface and one for running
ghostscript. The current GSview uses too many global
variables to be used as a control.
I have almost no experience with ActiveX controls, but I did
manage to get a test control running using the MS libraries and
some code from my rewrite of GSview. The major problem was that
at this stage ghostscript does not support multiple instances
per process, so if you try to put two PS viewer ActiveX controls
on the same page, things fall in a heap. There has been work on
making ghostscript support multiple instances per process and
when that happens my code might start to be useful.
If you know about how to write ActiveX controls properly, and
want to have a look at the code I wrote, please contact me
directly.
Russell Lang gsview at ghostgum.com.au
Ghostgum Software Pty Ltd http://www.ghostgum.com.au/
More information about the Gsview
mailing list