- Apr 22, 2014How do I manage to produce a pdf file.
http://cairographics.org/cairo-ocaml/ tells me pdf is supported, and
there's a simple example of using png. But I can't figure out what I
have to do to get a pdf file.
The example as is, does produce a nice triangle.png file, which I can
view in a browser. I've got that much working. But it's a pdf file I
Cairo_pdf.surface_write_to_file surface "triangle.png";
Error: Unbound value Cairo_pdf.surface_write_to_file
Nor does it work if I replace
let surface = Cairo.image_surface_create Cairo.FORMAT_ARGB32 ~width
let pout = (open_out_bin "triangle.pdf") in
let surface = Cairo_pdf.surface_create_for_channel pout (float_of_int
width) (float_of_int height) in
with at the end
I use the following command line for this:
ocamlopt -I +cairo -I +glMLite cairo.cmxa wander.ml -o wander
It compiles and runs, but creates an empty triangle.pdf file.
What is it I *do* have to do? It's probably a trivial variation on the
above, but I can't figure it out.
- Next post in topic >>