I also was not able to install ps using PEAR. Here are the steps I took to getting it installed:
1. you may need to install the perl module XML::Parser (http://search.cpan.org/~msergeant/XML-Parser/Parser.pm) to get pslib to install
2. install pslib (http://pslib.sourceforge.net/)
3. install ps (http://pecl.php.net/package/ps) using the instructions from (http://www.php.net/manual/en/install.pecl.phpize.php)
4. copy the ps.so file created by to the php extensions directory (not automatically done)
5. edit php.ini to include the ps extension (not automatically done)
If you are running FreeBSD, this link may help you with problems installing pslib (http://www.freebsd.org/cgi/query-pr.cgi?pr=84406).
Note that pslib (the library) and ps (the php extension) are not the same.
PostScript ドキュメントの作成
導入
このモジュールは、PostScript ドキュメントを作成するためのものです。 PDF 拡張と多くの共通点を持っています。実際のところ API はほぼ同じで、 多くは関数名の最初の pdf_ を ps_ に変えるだけで使えます。 PostScript ドキュメントには直接関係のない機能(ハイパーリンクの追加など) も含まれていますが、これらは PostScript ドキュメントを PDF に変換した場合に有効となります。
この拡張によって作られたドキュメントは、いくつかの点で pdf 拡張に よって作られたドキュメントより優れています。なぜなら pslib のレンダリング関数はカーニングやハイフネーション、そしてリゲチャに対応しており、 よりよい出力が得られるからです。
要件
少なくとも PHP 4.3.0 以降と pslib >= 0.1.12 が必要です。 ps ライブラリ(pslib)は、 » http://pslib.sourceforge.net/ にあります。
インストール手順
簡単なインストール方法: コンソールで以下のコマンドを入力します。
$ pecl install ps
実行時設定
設定ディレクティブは定義されていません。
リソース型
この拡張モジュールでは PostScript ドキュメントリソースを定義しています。これは ps_new() が返すものです。
定義済み定数
以下の定数が定義されています。 この関数の拡張モジュールが PHP 組み込みでコンパイルされているか、 実行時に動的にロードされている場合のみ使用可能です。
以下の 2 つの表は、ps 拡張で定義されている定数の一覧です。
| 名前 | 意味 |
|---|---|
| ps_LINECAP_BUTT | |
| ps_LINECAP_ROUND | |
| ps_LINECAP_SQUARED |
| 名前 | 意味 |
|---|---|
| ps_LINEJOIN_MITER | |
| ps_LINEJOIN_ROUND | |
| ps_LINEJOIN_BEVEL |
連絡先
もしこの拡張や pslib についての意見・バグフィックス・機能拡張などがあれば、 私 » steinm@php.net にメールをください。お待ちしています。
目次
- ps_add_bookmark — 現在のページにブックマークを追加する
- ps_add_launchlink — ファイルを実行するためのリンクを追加する
- ps_add_locallink — 同一ドキュメント内のページへのリンクを追加する
- ps_add_note — 現在のページに注釈を追加する
- ps_add_pdflink — 別の PDF ドキュメントのページへのリンクを追加する
- ps_add_weblink — Web 上の場所へのリンクを追加する
- ps_arc — 反時計回りに円弧を描く
- ps_arcn — 時計回りに円弧を描く
- ps_begin_page — 新しいページを開始する
- ps_begin_pattern — 新しいパターンを開始する
- ps_begin_template — 新しいテンプレートを開始する
- ps_circle — 円を描く
- ps_clip — 現在のパスを描画範囲として指定する
- ps_close_image — 画像を閉じ、メモリを開放する
- ps_close — PostScript ドキュメントを閉じる
- ps_closepath_stroke — パスを閉じ、描画する
- ps_closepath — パスを閉じる
- ps_continue_text — 次の行にテキストを続ける
- ps_curveto — 曲線を描く
- ps_delete — PostScript ドキュメントの全リソースを削除する
- ps_end_page — ページを終了する
- ps_end_pattern — パターンを終了する
- ps_end_template — テンプレートを終了する
- ps_fill_stroke — 現在のパスを塗りつぶし、線を引く
- ps_fill — 現在のパスを塗りつぶす
- ps_findfont — フォントを読み込む
- ps_get_buffer — 生成された PS データを含むバッファの内容を取得する
- ps_get_parameter — パラメータを取得する
- ps_get_value — 値を取得する
- ps_hyphenate — 単語をハイフネーションする
- ps_include_file — 外部ファイルを生の PostScript コードとして読み込む
- ps_lineto — 直線を描く
- ps_makespotcolor — スポット色を作成する
- ps_moveto — 現在位置を設定する
- ps_new — 新しい PostScript ドキュメントオブジェクトを作成する
- ps_open_file — 出力用のファイルを開く
- ps_open_image_file — ファイルから画像を開く
- ps_open_image — 後で配置するために画像を読み込む
- ps_open_memory_image — GD 画像を受け取り、PS ドキュメントにはめ込む画像を返す
- ps_place_image — 画像をページに配置する
- ps_rect — 矩形を描く
- ps_restore — 以前に保存されたコンテキストを復元する
- ps_rotate — 回転の程度を設定する
- ps_save — 現在のコンテキストを保存する
- ps_scale — 縮尺を設定する
- ps_set_border_color — 注記の枠線の色を設定する
- ps_set_border_dash — 注記の枠線の、破線の状態を設定する
- ps_set_border_style — 注記の枠線の形式を設定する
- ps_set_info — ドキュメントの情報を設定する
- ps_set_parameter — パラメータを設定する
- ps_set_text_pos — テキストの出力位置を設定する
- ps_set_value — 値を設定する
- ps_setcolor — 色を設定する
- ps_setdash — 破線の形状を設定する
- ps_setflat — 平面度を設定する
- ps_setfont — 以降の出力で用いるフォントを設定する
- ps_setgray — グレー値を設定する
- ps_setlinecap — 線端の形状を設定する
- ps_setlinejoin — 線の連結方法を設定する
- ps_setlinewidth — 線幅を設定する
- ps_setmiterlimit — miter limit 値を設定する
- ps_setoverprintmode — overprint モードを設定する
- ps_setpolydash — 破線の形状を設定する
- ps_shading_pattern — シェーディング用のパターンを作成する
- ps_shading — 以降の出力で用いるシェーディングを作成する
- ps_shfill — 範囲をシェーディングで塗りつぶす
- ps_show_boxed — テキストをボックス内に出力する
- ps_show_xy2 — テキストを指定した位置に出力する
- ps_show_xy — 指定された位置にテキストを出力する
- ps_show2 — テキストを現在の位置に出力する
- ps_show — テキストを出力する
- ps_string_geometry — 文字列のジオメトリを取得する
- ps_stringwidth — 文字列の幅を取得する
- ps_stroke — 現在のパスを描画する
- ps_symbol_name — グリフ名を取得する
- ps_symbol_width — グリフの幅を取得する
- ps_symbol — グリフを出力する
- ps_translate — 座標変換を設定する
PS
19-Aug-2006 03:28
31-May-2006 07:19
OK, OK, the previous note helped get me started, but really, it took me most of the day to figure out how to get this "pear install ps" to work. At first, it seemed geared for PHP4. Hopefully, I can save someone the day I just spent. (Don't get me wrong, I learned something new).
If the above statement doesn't work try this because it worked for me using PHP5 and Apache.
1. Forget the "pear install ps", it doesn't work. Whoever wrote that should get punched.
2. Make sure you've got PHP5 and Apache working as you like.
3. Go to http://pecl.php.net/package/ps and download the latest release.
4. Decompress the contents into its own directory somewhere.
5. Read http://www.php.net/manual/en/install.pecl.phpize.php which tells you what to do with what you just decompressed.
6. Move the final result (a shared object file) into the directory specified by your php.ini file's "extension_dir".
7. Create an entry in you php.ini (along with other similar statements that should already be there) that says "extension=ps.so"
8. For giggles, restart apache
Worked for me, hope it works for you...
15-Nov-2005 09:30
For everybody who is frustrated by the not working of 'pear install ps' command under most likely SuSE, at www.hipersonik.com/php_ps_pslib.html is a possible way to get it working. It is also possible to use these instructions under other distributions.
If 'pear install ps' works fine from the start (pslib etc is installed), but ps does not work yet, use dl('ps.so'); This will save you a lot of time.