[cairo-commit] cairo-ocaml/test basket.ml,1.2,1.3

Olivier Andrieu commit at pdx.freedesktop.org
Sun Jan 30 08:34:03 PST 2005


Committed by: oandrieu

Update of /cvs/cairo/cairo-ocaml/test
In directory gabe:/tmp/cvs-serv22557/test

Modified Files:
	basket.ml 
Log Message:
test the PDF backend


Index: basket.ml
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/test/basket.ml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- basket.ml	22 Feb 2004 22:41:26 -0000	1.2
+++ basket.ml	30 Jan 2005 16:34:01 -0000	1.3
@@ -50,9 +50,7 @@
 
   prerr_endline "PS" ;
   begin
-    let oc = open_out "basket.ps" in
-    let file = Cairo_channel.of_out_channel oc in
-    close_out oc ;
+    let file = Cairo_channel.open_out "basket.ps" in
     Cairo.set_target_ps c file x_inches y_inches x_ppi y_ppi ;
     draw ~print:true c ;
     Cairo.show_page c ;
@@ -60,6 +58,16 @@
     Cairo_channel.close file
   end ;
 
+  prerr_endline "PDF" ;
+  begin
+    let file = Cairo_channel.open_out "basket.pdf" in
+    Cairo.set_target_pdf c file x_inches y_inches x_ppi y_ppi ;
+    draw c ;
+    Cairo.show_page c ;
+    Cairo.finalise_target c ;
+    Cairo_channel.close file
+  end ;
+
   prerr_endline "Bigarray and PPM" ;
   begin
     let arr = Bigarray.Array2.create Bigarray.int Bigarray.c_layout




More information about the cairo-commit mailing list