caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* lablgtk and pdf
@ 2009-12-01  2:09 Ewen Maclean
  2009-12-01 15:48 ` [Caml-list] " Eric Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Ewen Maclean @ 2009-12-01  2:09 UTC (permalink / raw)
  To: caml-list

Hello,

I wondered if someone could help me. I am generating pdf images from
latex source, and I would like to show them on screen in part of a
pane in lablgtk2. Is it possible to do this using a GImage widget or
something similar? If not what can I convert it to to show this image,
and which object should I use. Sorry for not being able to find this
first on the gtk documentation.

Ewen


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] lablgtk and pdf
  2009-12-01  2:09 lablgtk and pdf Ewen Maclean
@ 2009-12-01 15:48 ` Eric Cooper
  2009-12-01 16:02   ` Marc de Falco
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Cooper @ 2009-12-01 15:48 UTC (permalink / raw)
  To: caml-list

On Tue, Dec 01, 2009 at 02:09:27AM +0000, Ewen Maclean wrote:
> I am generating pdf images from latex source, and I would like to
> show them on screen in part of a pane in lablgtk2. Is it possible to
> do this using a GImage widget or something similar?

I think you will have to render the PDF first into a simple image
format like PPM, and then use GTK to display that.  I don't know of
any OCaml bindings for libpoppler, but you can use the standalone
program "pdftoppm" from the poppler-utils package.  Then you can
display the .ppm file as follows:

    let file = Sys.argv.(1) in
    GMain.init ();
    let window = GWindow.window ~title: "Show Image" () in
    let image = GMisc.image ~file ~packing: window#add () in
    window#connect#destroy ~callback: GMain.quit;
    window#show ();
    GMain.main ()


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] lablgtk and pdf
  2009-12-01 15:48 ` [Caml-list] " Eric Cooper
@ 2009-12-01 16:02   ` Marc de Falco
  0 siblings, 0 replies; 3+ messages in thread
From: Marc de Falco @ 2009-12-01 16:02 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1353 bytes --]

It might be better to produce a svg and then display the svg trough cairo.
I don't know if there are bindings available in OCaml to do that (mainly for
librsvg).

2009/12/1 Eric Cooper <ecc@cmu.edu>

> On Tue, Dec 01, 2009 at 02:09:27AM +0000, Ewen Maclean wrote:
> > I am generating pdf images from latex source, and I would like to
> > show them on screen in part of a pane in lablgtk2. Is it possible to
> > do this using a GImage widget or something similar?
>
> I think you will have to render the PDF first into a simple image
> format like PPM, and then use GTK to display that.  I don't know of
> any OCaml bindings for libpoppler, but you can use the standalone
> program "pdftoppm" from the poppler-utils package.  Then you can
> display the .ppm file as follows:
>
>    let file = Sys.argv.(1) in
>    GMain.init ();
>    let window = GWindow.window ~title: "Show Image" () in
>    let image = GMisc.image ~file ~packing: window#add () in
>    window#connect#destroy ~callback: GMain.quit;
>    window#show ();
>    GMain.main ()
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 2076 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-01 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-01  2:09 lablgtk and pdf Ewen Maclean
2009-12-01 15:48 ` [Caml-list] " Eric Cooper
2009-12-01 16:02   ` Marc de Falco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).