reports-web
Reports.Web for Rust — 帳票定義(.prepdj)に値を入れて印刷データ(PREPEJ)を作り、Reports.Web エンジン(C++ WebAssembly)で PDF にします。請求書・見積書・納品書・宛名ラベル・名刺など、日本の業務帳票向けです。
Build print data (PREPEJ) from a report definition (.prepdj) and render it to PDF with the Reports.Web engine (C++ WebAssembly). Designed for Japanese business forms: invoices, estimates, delivery slips, address labels, business cards.
- 製品サイト / Product: https://www.pao.ac/reports.web/
- サンプル / Samples: https://github.com/ReportsWeb/wasm-rust
- オンラインデモ / Live demo: https://www.pao.ac/demo/reports.web/samples/rust/
しくみ / How it works
your Rust app ──(PREPEJ JSON)──▶ Reports.Web engine (Docker: ghcr.io/reportsweb/engine) ──▶ PDF
▲
report definition (.prepdj) designed in the browser designer
帳票のデザインはブラウザのデザイナーで作ります。アプリは値を入れて印刷データを作り、エンジンに送るだけです。
インストール / Install
[]
= "1"
= { = "1", = ["macros", "rt-multi-thread"] }
= "1"
使い方 / Quick start
use ;
async
API
PrintData
| メソッド / Method | 内容 / Description |
|---|---|
set_definition(&definition) |
帳票定義(.prepdj の内容)を設定 / Set the report definition |
page_start() / page_start_with(Some(&def)) / page_end() |
ページの開始と終了 / Begin and end a page |
set_value(name, value) / set_value_at(name, value, index, drawing) |
文字などの値 / Set a value |
set_repeated_value(name, value, x, y, drawing) |
繰り返し(明細行など)の値 / Repeated object value |
set_image(name, source) / set_barcode(name, code) |
画像・バーコード / Image and barcode |
change_attributes(name, values, index) |
色・位置などの属性 / Change attributes |
to_value() / to_json(pretty) / save(path) |
印刷データ(PREPEJ)を取り出す・保存 / Get or save the PREPEJ |
ReportsWebEngine(非同期 / async, reqwest + rustls)
| メソッド / Method | 内容 / Description |
|---|---|
ReportsWebEngine::new(url) / from_env() / with_timeout(url, d) |
from_env は REPORTS_ENGINE_URL、なければ http://127.0.0.1:3107 |
render_pdf(&print_data) / render_pdf_json(bytes) |
PDF のバイト列 / PDF bytes |
health() |
エンジンの状態 / Engine status |
エラーは EngineError(status に HTTP ステータス)で返ります。
Errors are returned as EngineError with the HTTP status.
体験版と製品版 / Trial and product
このクレートとエンジンのイメージは体験版です。出力には赤い「SAMPLE」の印が付きます。ご購入後に納品するライセンスファイルをエンジンに設定すると、印が消えます。
The crate and the engine image are trial builds: output carries a red "SAMPLE" mark. Mount the license file delivered on purchase:
開発用パソコン 1 台につき 1 ライセンス、運用環境はランタイムライセンスフリーです。詳しくは LICENSE.md と 使用許諾 をご覧ください。
他の言語 / Other languages
Reports.Web は同じ帳票定義と印刷データを、PHP・Java・.NET・Go・Ruby・Rust・Node.js から使えます。Pure Java・WPF 版もあります。 https://github.com/ReportsWeb
Pao@Office — https://www.pao.ac/ — info@pao.ac