(empty log message)
@@ -47,7 +47,7 @@ | ||
47 | 47 | -- v2.1.3 |
48 | 48 | 2014/08/11 |
49 | 49 | Session->start_main関数のデフォルトの引数を'.'にしました。 |
50 | -画像を標準出力に出力時すると、Cannot modify header information警告が出る問題に対応。 | |
50 | +画像を標準出力に出力すると、Cannot modify header information警告が出る問題に対応しました。 | |
51 | 51 | |
52 | 52 | -- v2.1.2 |
53 | 53 | 2013/04/24 |
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | |
3 | 3 | <project default="make"> |
4 | - <property name="version" value="2.1.3" /> | |
5 | - <property name="aversion" value="2_1_3" /> | |
4 | + <property name="version" value="2.1.4" /> | |
5 | + <property name="aversion" value="2_1_4" /> | |
6 | 6 | <property name="archive" value="build/cti-php-${aversion}" /> |
7 | 7 | <property name="dirname" value="cti-php-${version}" /> |
8 | 8 | <property name="encoding" value="UTF-8" /> |
@@ -33,20 +33,31 @@ | ||
33 | 33 | * @param $options 接続オプション |
34 | 34 | */ |
35 | 35 | public function __construct(&$fp, $options = null) { |
36 | - $this->results = new SingleResult(new StreamBuilder()); | |
36 | + $this->results = new SingleResult(new StreamBuilder()); | |
37 | 37 | $this->fp = &$fp; |
38 | - if (isset($options['encoding'])) { | |
39 | - $this->encoding = $options['encoding']; | |
38 | + if (isset($options['encoding'])) { | |
39 | + $this->encoding = $options['encoding']; | |
40 | + } | |
41 | + $user = $password = ''; | |
42 | + if (isset($options['user'])) { | |
43 | + $user = $options['user']; | |
44 | + unset($options['user']); | |
45 | + } | |
46 | + if (isset($options['password'])) { | |
47 | + $password = $options['password']; | |
48 | + unset($options['password']); | |
40 | 49 | } |
41 | - $user = $password = ''; | |
42 | - if (isset($options['user'])) { | |
43 | - $user = $options['user']; | |
44 | - } | |
45 | - if (isset($options['password'])) { | |
46 | - $password = $options['password']; | |
47 | - } | |
48 | - cti_ctip_connect($this->fp, $this->encoding); | |
49 | - $data = "PLAIN: $user $password\n"; | |
50 | + cti_ctip_connect($this->fp, $this->encoding); | |
51 | + if (empty($options)) { | |
52 | + $data = "PLAIN: $user $password\n"; | |
53 | + } | |
54 | + else { | |
55 | + $data = "OPTIONS: user=$user&password=$password"; | |
56 | + foreach($options as $k => $v) { | |
57 | + $data .= "&$k=$v"; | |
58 | + } | |
59 | + $data .= "\n"; | |
60 | + } | |
50 | 61 | _cti_write($this->fp, $data); |
51 | 62 | $res = _cti_read($this->fp, 4); |
52 | 63 | if ($res !== "OK \n") { |
@@ -0,0 +1,28 @@ | ||
1 | +<?php | |
2 | +require_once ('../code/CTI/DriverManager.php'); | |
3 | + | |
4 | +//セッションの開始 | |
5 | +$session = cti_get_session('ctip://free.cssj.jp:8499/', | |
6 | + array('user' => 'user', | |
7 | + 'password' => 'kappa', | |
8 | + 'transcoder' => 'li.cti.pdftools.PDFTools')); | |
9 | + | |
10 | +//ファイル出力 | |
11 | +$dir = 'out'; | |
12 | +@mkdir($dir, 0777, true); | |
13 | +$session->set_output_as_file('out/cti.li.pdf'); | |
14 | + | |
15 | +$session->property('output.impose', '4up'); | |
16 | +$session->property('output.paper-width', '297mm'); | |
17 | +$session->property('output.paper-height', '420mm'); | |
18 | +$session->property('output.cutting-margin', '3mm'); | |
19 | +$session->property('output.title', 'test'); | |
20 | + | |
21 | +//文書の送信 | |
22 | +$session->start_main(); | |
23 | +readfile('data/test.pdf'); | |
24 | +$session->end_main(); | |
25 | + | |
26 | +//セッションの終了 | |
27 | +$session->close(); | |
28 | +?> | |
\ No newline at end of file |
@@ -7,7 +7,8 @@ | ||
7 | 7 | 'password' => 'kappa')); |
8 | 8 | |
9 | 9 | //ファイル出力 |
10 | -@mkdir($dir, 0777, 'out'); | |
10 | +$dir = 'out'; | |
11 | +@mkdir($dir, 0777, true); | |
11 | 12 | $session->set_output_as_file('out/server-resource.pdf'); |
12 | 13 | |
13 | 14 | //リソースのアクセス許可 |