ptouch-label CLIを追加して差込印刷を拡張
コマンド名を機能に合わせて整理し、SVGテンプレート+JSON/YAMLの差込印刷とメディア情報取得を使いやすくする。 Made-with: Cursor
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
# samples
|
||||
|
||||
試験・デモ用のサンプル画像(PNG など)を置くディレクトリです。リポジトリに含める場合はライセンス・著作権に注意してください。
|
||||
試験・デモ用のサンプル画像(PNG/SVG)や差込印刷データ(JSON/YAML)を置くディレクトリです。リポジトリに含める場合はライセンス・著作権に注意してください。
|
||||
|
||||
例(ドライラン):
|
||||
|
||||
```bash
|
||||
./build/ptouch-print -n -f samples/your.png
|
||||
```
|
||||
|
||||
差込印刷の例(Ruby CLI):
|
||||
|
||||
```bash
|
||||
ruby -I ruby/lib ruby/exe/ptouch-label -n --template samples/merge_template.svg --data samples/merge_data.yml
|
||||
ruby -I ruby/lib ruby/exe/ptouch-label -n --template samples/merge_template.svg --data samples/merge_data.json
|
||||
```
|
||||
|
||||
5
samples/merge_data.json
Normal file
5
samples/merge_data.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"title": "出荷ラベル",
|
||||
"left": "品番 ABC-123",
|
||||
"right": "数量 24"
|
||||
}
|
||||
3
samples/merge_data.yml
Normal file
3
samples/merge_data.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
title: "出荷ラベル"
|
||||
left: "品番 ABC-123"
|
||||
right: "数量 24"
|
||||
9
samples/merge_template.svg
Normal file
9
samples/merge_template.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="220" viewBox="0 0 720 220">
|
||||
<rect width="720" height="220" fill="#FFFFFF" />
|
||||
<text x="24" y="86" data-field="title" font-size="56" fill="#000000">TITLE</text>
|
||||
<text x="24" y="160" font-size="36" fill="#000000">
|
||||
<tspan data-field="left">LEFT</tspan>
|
||||
<tspan dx="20">/</tspan>
|
||||
<tspan dx="20" data-field="right">RIGHT</tspan>
|
||||
</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 417 B |
Reference in New Issue
Block a user