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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 54821BBAF for ; Tue, 1 Dec 2009 17:02:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIBAD/NFEvRVdiwkGdsb2JhbACCITCNYYQHhnk/AQEBAQkJDAcTA61ohiyIagECAwWELASLIA X-IronPort-AV: E=Sophos;i="4.47,321,1257116400"; d="scan'208";a="39089256" Received: from mail-px0-f176.google.com ([209.85.216.176]) by mail3-smtp-sop.national.inria.fr with ESMTP; 01 Dec 2009 17:02:55 +0100 Received: by pxi6 with SMTP id 6so330969pxi.0 for ; Tue, 01 Dec 2009 08:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=h3WpHsqQCYmzwAct+fMVwWWBFdiCtMkCR7Hmn/24DB8=; b=yBv6T47qB+r+mDoSuF/2bZZKlv+lYVdMHL398FhUz/z/H2uEwOcaZPmfKAFtvMcjsY UdrXPMm/8obWvRtXA/r6BnHai3ry1s0NMD/4X8JApKdh6p/wV4rnzjpf9aLf2Vm+6WmW Uf7n+xv97wTx5/iEOwNlNACRRLLSM6dgxb0Pw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=EvOBz5dMkZApllYT1Un3v7Lds3I5fPpvcWGllY9tBlCqF4j2CXzFyZa8WpqTF7AqCx O8mmUnMBFoQmtZSLqGHGFkoJwMKfD5s0DTjoIuhRN76ZcP+5OeLUtWzN5yc9IzAoToKf tSJpj5iCZKV2FYZT8Q+KvirjwddNTHPx9XQNU= MIME-Version: 1.0 Sender: marc.defalco@gmail.com Received: by 10.140.170.6 with SMTP id s6mr376363rve.159.1259683373671; Tue, 01 Dec 2009 08:02:53 -0800 (PST) In-Reply-To: <20091201154807.GD12568@localhost> References: <20091201154807.GD12568@localhost> Date: Tue, 1 Dec 2009 17:02:53 +0100 X-Google-Sender-Auth: 5eb9456c213b271a Message-ID: Subject: Re: [Caml-list] lablgtk and pdf From: Marc de Falco To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=000e0cd296e60467060479ace412 X-Spam: no; 0.00; lablgtk:01 bindings:01 ocaml:01 lablgtk:01 gtk:01 ocaml:01 bindings:01 argv:01 gmain:01 gwindow:01 gmisc:01 gmain:01 beginner's:01 bug:01 gtk:01 --000e0cd296e60467060479ace412 Content-Type: text/plain; charset=ISO-8859-1 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 > 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 > --000e0cd296e60467060479ace412 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It might be better to produce a svg and then display the svg trough cairo.<= br>I don't know if there are bindings available in OCaml to do that (ma= inly 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. =A0I don't know of any OCaml bindings for libpoppler, but you can use the standalone
program "pdftoppm" from the poppler-utils package. =A0Then you ca= n
display the .ppm file as follows:

=A0 =A0let file =3D Sys.argv.(1) in
=A0 =A0GMain.init ();
=A0 =A0let window =3D GWindow.window ~title: "Show Image" () in<= br> =A0 =A0let image =3D GMisc.image ~file ~packing: window#add () in
=A0 =A0window#connect#destroy ~callback: GMain.quit;
=A0 =A0window#show ();
=A0 =A0GMain.main ()

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.in= ria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--000e0cd296e60467060479ace412--