From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 24EDEBBAF for ; Tue, 1 Dec 2009 16:48:16 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8AAMrJFEuAAtnFmWdsb2JhbACBTpojAQEBAQEICwoHE64JhhuITYQxBA X-IronPort-AV: E=Sophos;i="4.47,321,1257116400"; d="scan'208";a="51320315" Received: from smtp02.srv.cs.cmu.edu ([128.2.217.197]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Dec 2009 16:48:15 +0100 Received: from stratocaster.home (pool-96-236-220-64.pitbpa.fios.verizon.net [96.236.220.64]) (authenticated bits=0) by smtp02.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id nB1Fm9ZX017340 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 1 Dec 2009 10:48:10 -0500 (EST) Received: from ecc by stratocaster.home with local (Exim 4.69) (envelope-from ) id 1NFUxU-0007eR-OR for caml-list@inria.fr; Tue, 01 Dec 2009 10:48:08 -0500 Date: Tue, 1 Dec 2009 10:48:07 -0500 From: Eric Cooper To: caml-list@inria.fr Subject: Re: [Caml-list] lablgtk and pdf Message-ID: <20091201154807.GD12568@localhost> Mail-Followup-To: caml-list@inria.fr References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: mimedefang-cmuscs on 128.2.217.197 X-Spam: no; 0.00; lablgtk:01 lablgtk:01 gtk:01 ocaml:01 bindings:01 argv:01 gmain:01 gwindow:01 gmisc:01 gmain:01 2009:98 pane:98 wrote:01 caml-list:01 callback:02 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 ()