出力バッファを変換する


1 <?php
2 require_once ('../code/cssj_driver.php');
3 header("Content-Type: application/pdf");
4
5 //ドライバの作成
6 $driver = cssj_create_driver_for('localhost', 8099);
7
8 //セッションの開始
9 $session = cssj_create_session($driver, 'user', 'secret') or die('サーバーに接続できません');
10
11 //リソースの送信
12 cssj_ob_start_resource($session, 'file:test.css');
13 readfile('test.css');
14 cssj_ob_end_flush_resource();
15
16 //出力結果の変換の開始
17 cssj_ob_start_main($session, 'file:ob.html');
18 ?>
19
20 <html>
21 <head>
22 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
23 <link rel="StyleSheet" type="text/css" href="test.css">
24 <title>Hello CSSJ</title>
25 </head>
26 <body>
27 <h2>ただいまの時刻</h2>
28 <p><?php echo date("l dS of F Y h:i:s A") ?></p>
29 </body>
30 </html>
31
32 <?php
33 //出力結果の変換の終了
34 cssj_ob_end_flush_main();
35
36 //セッションの終了
37 cssj_close($session);
38
39 ?>

Documentation generated on Mon, 7 Nov 2005 19:21:26 +0900 by phpDocumentor 1.2.3