[impression/wrapper_canon.ml] correction

* il semble qu'il faille envoyer le formulaire dans l'ordre
 * il faut que le parsage des options mette à jour le formulaire

darcs-hash:20090525124150-bd074-fd805ac65d566a30d1e30e5dc28d4bea91de91b1.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-05-25 14:41:50 +02:00
parent ac3187e40b
commit f2e7a94cc4

View file

@ -4,24 +4,18 @@
* Copyright (C) 2009 Antoine Durand-Gasselin * Copyright (C) 2009 Antoine Durand-Gasselin
* Author: Antoine Durand-Gasselin <adg@crans.org> * Author: Antoine Durand-Gasselin <adg@crans.org>
* *
* This program is free software: you can redistribute it and/or modify * License: GPLv3
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * Dependances: libperl4ocaml-dev (>= 0.9.5-2), libwww-mechanize-perl
* but WITHOUT ANY WARRANTY; without even the implied warranty of * Compilation: ocamlfind ocamlc -linkpkg -package unix,perl wrapper_canon.ml
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
*) *)
(* #use "topfind";; (*
#use "topfind";;
#require "perl";; #require "perl";;
#require "unix";; *) #require "unix";;
*)
let (%) a b = Printf.sprintf a b;; let (%) a b = Printf.sprintf a b;;
let (&) f x = f x let (&) f x = f x
@ -68,7 +62,7 @@ let agrafage = ref true
let piqure = ref false let piqure = ref false
let _Sort() = let _Sort() =
if !piqure then "3" else if !piqure then "3" else
if !agrafage then "134" else "1" if !agrafage then "1" (* "134" *) else "1"
let agrafe = ref "NW" let agrafe = ref "NW"
let _StapleType () = List.assoc !agrafe let _StapleType () = List.assoc !agrafe
@ -79,28 +73,35 @@ let _ColorMode () = if !couleur then "2" else "1"
(** {1: Le formulaire} *) (** {1: Le formulaire} *)
let fields = let fields () =
[ "Url","http://"; "Mode","100"; "ManualNo","0"; "DocPasswd",""; [ "Url","http://"; "Mode","100"; "ManualNo","0"; "DocPasswd","";
"WebUserName",""; "WebPasswd",""; "PunchPos","0"; "Annotation","2"; "WebUserName",""; "WebPasswd","";
"C_Render","0"; "C_RGB_Pro","1"; "C_CMYK_Pro","4";"C_OUT_Pro","1"; "PageMode","0"; "StartPage","1"; "EndPage","1";
"C_GRAY_Pro","1"; "C_Matching","0"; "SPOT_Color","1"; "C_Pure_B","1";
"C_B_OVPrn","1"; "C_Bright", "100"; "C_Gray_Com","1";"C_OVR_EFF","1";
"WidePrn","0"; "HalfToneTxt","1"; "HalfToneGrp","1"; "HalfToneImg","1";
"AstIntensity","2"; "AstText","0"; "AstGrap", "1"; "AstImag","1";
"StoreBox","0"; "BoxNo","00"; "RGBDLName",""; "CMYKDLName","";
"OUTDLName",""; "BOXName",""; "Flag","Exec_Data_Pdf"; "Direct","100";
"BookType","2"; "NupPrint","1"; "NupStart","0"; "Resolution","1";
"PageMode","0"; "StartPage","1"; "EndPage","1"; "ManualFeed", "0";
"Dummy",timestamp;
"Copies", _Copies(); "Copies", _Copies();
"MediaSize", _MediaSize(); "MediaSize", _MediaSize();
"MediaType", _MediaType(); "MediaType", _MediaType();
"ManualFeed", "0";
"FitSize", _FitSize(); "FitSize", _FitSize();
"DuplexType", _DuplexType(); "DuplexType", _DuplexType();
"Sort", _Sort(); "Sort", _Sort();
"PunchPos","0";
"StapleType", _StapleType(); "StapleType", _StapleType();
"BookType","2";
"Annotation","2";
"ColorMode", _ColorMode(); "ColorMode", _ColorMode();
"C_Render","0"; "C_RGB_Pro","1"; "C_CMYK_Pro","4";"C_OUT_Pro","1";
"C_GRAY_Pro","1"; "C_Matching","0"; "SPOT_Color","1"; "C_Pure_B","1";
"C_B_OVPrn","1"; "C_Bright", "100"; "C_Gray_Com","1";"C_OVR_EFF","1";
"WidePrn","0"; "NupPrint","0"; "NupStart","0"; "Resolution","1";
"HalfToneTxt","1"; "HalfToneGrp","1"; "HalfToneImg","1";
"AstIntensity","2"; "AstText","0"; "AstGrap", "1"; "AstImag","1";
"StoreBox","0"; "BoxNo","00"; "RGBDLName",""; "CMYKDLName","";
"OUTDLName",""; "BOXName","";
"Flag","Exec_Data_Pdf";
"Dummy",timestamp;
"Direct","100";
"File", !filename "File", !filename
] ]
@ -117,7 +118,7 @@ let options = Arg.align
"-two-sided", Arg.Set duplex, " Impression recto/verso"; "-two-sided", Arg.Set duplex, " Impression recto/verso";
"-two-sided-short-edge", Arg.Clear binding_long_edge, "-two-sided-short-edge", Arg.Clear binding_long_edge,
" Reliure sur le bord court"; " Reliure sur le bord court";
"-Staple", Arg.Set agrafage, " Agrafage"; "-Staple", Arg.Set agrafage, " Agrafage du travail d'impression";
"-StapleLocation", Arg.Set_string agrafe, "-StapleLocation", Arg.Set_string agrafe,
"AZ Agrafe au NW,NE,SE,SW,N,S,E,W"; "AZ Agrafe au NW,NE,SE,SW,N,S,E,W";
"-CNSaddleStitch", Arg.Set piqure, " Mode livret"; "-CNSaddleStitch", Arg.Set piqure, " Mode livret";
@ -153,6 +154,6 @@ let b =
(* On balance la sauce *) (* On balance la sauce *)
let resp = b#submit_form ~form_name:"PDF_SEND_FORM" ~fields ();; let resp = b#submit_form ~form_name:"PDF_SEND_FORM" ~fields:(fields ()) ();;
print_string resp#as_string;; print_string resp#as_string;;