トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

event

概要

印刷の各種タイミングで次の動作を設定します。
1.サーバに通知します。
2.ブラウザを操作します。

ライセンス

自動印刷アドバンスライセンスが必要です。

基本構造

 <pxd>
    <event>

属性

属性 説明
type 選択値 『open | printstart | printcancel | printend | close』のいづれかを指定する。open:pxdocアプリ起動時、printstart:印刷開始時、printcancel:ダイアログでキャンセルを押した時、printend:印刷完了時、close:pxdocアプリ終了時
report url 通知先URLを指定する。サーバに情報を送る場合はGET形式(?id=value&amp;id2=value2...)で指定する。注意:XMLなので、&は&amp;として、記述するルールになっています。
to urlもしくは選択値 typeの値が『printcancel | printend』の時に有効。印刷キャンセル時、または印刷完了時にブラウザが移動するURLを指定。移動した後でもブラウザの戻るボタンでpxdocの画面には戻らないので注意が必要。選択値としては『_BACK | _CLOSE | _STAY 』のいづれかを指定できる。_BACK:前の画面に移動する。_CLOSE:ブラウザを閉じる。_STAY:そのままの画面でとどまる。何も指定しない場合は_STAYとなる。
frame htmlのフレーム名 属性toを指定している時に有効。移動するhtmlのフレーム名を指定できる。例:_top

【type=printstart 指定時】
reportで指定したURLでは「ok」の出力が必要です。違う文字列を出力した場合はそのメッセージが画面に表示されて印刷がキャンセルされます。文字列はUTF-8エンコードの文字である必要があります。

属性値(例えばURL)に&を入れる時は注意

「&」 → 「&amp;」 と記述してください。これはXMLの仕様になります。

サンプル1:全体像

<event type="printcancel" report="../event/printcancel.php" to="_BACK" frame="_top"/>
<event type="printstart" report="../event/printstart.php?paperID=45782958"/>
<event type="printend" report="../event/printend.php" to="fin.php" frame="_top"/>
<event type="open" report="../event/open.php"/>
<event type="close" report="../event/close.php"/> 

サンプル2:画面上に「キャンセル」メニューを追加する

下記の例は「キャンセル」メニューをクリックするとトップ画面に移動します

<?xml version="1.0" encoding="shift-jis" ?>
  <pxd paper-type="A4">
   <event type="printcancel" to="/" frame="_top"/>
   <page>

サンプル3:印刷後の移動先

印刷後、ブラウザのページがgoogleに移動します。

<event type="printend" report="event/printend.php" to="http://www.google.co.jp/" frame="_top" />