caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Eric Cooper <ecc@cmu.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] lablgtk and pdf
Date: Tue, 1 Dec 2009 10:48:07 -0500	[thread overview]
Message-ID: <20091201154807.GD12568@localhost> (raw)
In-Reply-To: <d0fbb16b0911301809i3a897e4erf63248ae467c67db@mail.gmail.com>

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 ()


  reply	other threads:[~2009-12-01 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01  2:09 Ewen Maclean
2009-12-01 15:48 ` Eric Cooper [this message]
2009-12-01 16:02   ` [Caml-list] " Marc de Falco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091201154807.GD12568@localhost \
    --to=ecc@cmu.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).