From: Basile Starynkevitch <basile.starynkevitch@inria.fr>
To: PL <Pierre.Laffitte@wanadoo.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] how can I print graphics on my local printer under Linux?
Date: Mon, 22 Sep 2003 10:38:05 +0200 [thread overview]
Message-ID: <3F6EB4ED.9090107@inria.fr> (raw)
In-Reply-To: <002701c380e1$0a429b00$56d83251@rosim>
PL wrote:
>
> I am doing graphics with Caml. These graphs are drawn in a new window on my
> screen,
> opened by Caml. I would like to have these graphs printed on my local
> printer.
May I suggest using the camlimages library (also used in advi)? See
http://pauillac.inria.fr/camlimages/ for more. Another option would be
(on unix or linux systems) to open a pipe to some software like gnuplot,
latex, lout, troff, etc etc.... The Graphics library is portable, but
(IMHO) not very rich (because of the portability issue).
> I have troubles understanding the #install_printer intruction of Caml.
This question is (I suppose) unrelated to the previous one. The
#install_printer directive (only available with the interactive toplevel
-and perhaps in the debugger) tell the toplevel how to print your
datatypes (usually abstract ones). Here is a simplistic example (where
@. is a pretty printing indication, see the Format module documentation
of the stdlib
# type color_t = Blue | Red;;
type color_t = Blue | Red
# let color_printer ff col = match col with
Blue -> Format.fprintf ff "Blue_Color@."
| Red -> Format.fprintf ff "Red_Color@."
;;
val color_printer : Format.formatter -> color_t -> unit = <fun>
# #install_printer color_printer;;
# Blue;;
- : color_t = Blue_Color
Hope above will help you
--
Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr
Project cristal.inria.fr - phone +33 1 3963 5197 - mobile 6 8501 2359
home email: basile at starynkevitch dot net
all opinions are only mine
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2003-09-22 8:38 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-18 16:11 [Caml-list] possible typechecker bug Fernando Alegre
2003-09-19 2:00 ` malc
2003-09-19 2:06 ` Fernando Alegre
2003-09-19 6:57 ` Julien Signoles
2003-09-19 8:01 ` [Caml-list] Commercial application written in O'Caml: ExcelEverywhere Mattias Waldau
2003-09-19 9:26 ` Benjamin Geer
2003-09-20 8:12 ` Damien Doligez
2003-09-19 11:10 ` skaller
2003-09-19 14:49 ` Richard Jones
2003-09-19 15:02 ` Remi Vanicat
2003-09-19 17:20 ` Karl Zilles
2003-09-20 19:25 ` skaller
2003-09-20 20:28 ` Benjamin Geer
2003-09-21 11:55 ` skaller
2003-09-21 15:01 ` [Caml-list] how can I print graphics on my local printer under Linux? PL
[not found] ` <20030921161556.GA451@swordfish>
2003-09-22 8:10 ` PL
2003-09-22 8:38 ` Basile Starynkevitch [this message]
2003-09-23 20:24 ` Christophe TROESTLER
2003-09-23 21:48 ` Pierre Weis
2003-09-22 9:21 ` Olivier Andrieu
2003-09-19 22:29 ` [Caml-list] Commercial application written in O'Caml: ExcelEverywhere Oleg Trott
2003-09-20 9:09 ` Mattias Waldau
2003-09-20 9:25 ` Jean-Marc Eber
2003-09-21 9:38 ` Xavier Leroy
2003-09-20 20:01 ` skaller
2003-09-20 19:58 ` skaller
2003-09-19 11:48 ` Ville-Pertti Keinonen
2003-09-20 18:53 ` skaller
2003-09-20 19:31 ` Alain.Frisch
2003-09-19 14:47 ` Richard Jones
2003-09-20 19:32 ` skaller
2003-09-19 16:23 ` kknowles
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=3F6EB4ED.9090107@inria.fr \
--to=basile.starynkevitch@inria.fr \
--cc=Pierre.Laffitte@wanadoo.fr \
--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