Skip to content

Commit 0c0dde3

Browse files
committed
CPUtil v1.2.0
1 parent b3e13ac commit 0c0dde3

24 files changed

+683
-142
lines changed

CloudPRNTSDKSamples/CloudPRNTSDKSamples.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28010.2003
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.10.35013.160
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cputil", "cputil\cputil.csproj", "{AAE267F1-6DAA-492B-9565-75875115AAA9}"
77
EndProject

CloudPRNTSDKSamples/cputil/Program.cs

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,28 @@ static void Main(string[] args)
6464

6565
string format = args[++i];
6666
string filename = args[++i];
67-
string outputfile = args[++i];
67+
string outputFile = args[++i];
68+
string fieldData = String.Empty;
69+
70+
try
71+
{
72+
if (args.Length >= i + 2 && args[++i] == "-template")
73+
{
74+
fieldData = args[++i];
75+
}
76+
}
77+
catch (IndexOutOfRangeException)
78+
{
79+
PrintHelp();
80+
break;
81+
}
6882

6983
Stream s = null;
7084

71-
if (outputfile == "-" || outputfile == "" || outputfile == "[stdout]")
85+
if (outputFile == "-" || outputFile == "" || outputFile == "[stdout]")
7286
s = Console.OpenStandardOutput();
7387
else
74-
s = new FileStream(outputfile, FileMode.Create);
88+
s = new FileStream(outputFile, FileMode.Create);
7589

7690
if (format.Equals("application/vnd.star.linematrix"))
7791
{
@@ -80,10 +94,20 @@ static void Main(string[] args)
8094
}
8195

8296
//decode(format, filename, s);
83-
Document.ConvertFile(filename, s, format, opts);
97+
if (fieldData == String.Empty)
98+
{
99+
Document.ConvertFile(filename, s, format, opts);
100+
}
101+
else // Optional : ApplyTemplate
102+
{
103+
// Input : Template data file (Star Document Markup) and Field data (JSON)
104+
// Output: Replaced and Converted to target format
105+
Document.ConvertFileWithApplyTemplate(filename, fieldData, s, format, opts);
106+
}
107+
84108
s.Close();
85109

86-
Console.Error.WriteLine(String.Format("Wrote output to \"{0}\"", outputfile));
110+
Console.Error.WriteLine(String.Format("Wrote output to \"{0}\"", outputFile));
87111
break;
88112

89113
case "printarea":
@@ -267,7 +291,15 @@ static void PrintHelp()
267291
" \"image/png\" or \"application/vnd.star.markup\".",
268292
" decode <format> <filename> <output> - Convert file to the specified format. Format should",
269293
" be provides as a media type string.",
270-
" decoder data is writtenn to the file specified by",
294+
" decoder data is written to the file specified by",
295+
" <output>. If output is set to \"-\" or \"[stdout]\"",
296+
" then data will be written to standard output.",
297+
" decode <format> <templateFilename> <output> -template <fieldDataFilename>",
298+
" - Generates Star Document Markup data by combining a template, ",
299+
" which defines a print layout, and field data.",
300+
" Then convert the data to the specified format.",
301+
" Format should be provides as a media type string.",
302+
" decoder data is written to the file specified by",
271303
" <output>. If output is set to \"-\" or \"[stdout]\"",
272304
" then data will be written to standard output.",
273305
" thermal2/thermal58 - set device constraints for a thermal 58mm/2\" printer",

CloudPRNTSDKSamples/cputil/Readme_En.txt

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
************************************************************
2-
cputil Ver 1.1.2 28/04/2022
2+
cputil Ver 1.2.0 10/03/2025
33
Readme_En.txt Star Micronics Co., Ltd.
44
************************************************************
55

@@ -16,29 +16,27 @@
1616
1. Overview
1717
=============
1818

19-
This package contains cputil Ver 1.1.2.
19+
This package contains cputil Ver 1.2.0.
2020
cputil is intented to serve and a useful back-end tool to help
2121
with implementing CloudPRNT servers that are not .NET or .NET Core based.
2222

23-
cputil can be use on any platform supported by .NET 6.0 including:
24-
- Windows x86 and x64 ... cputil-win-x86_v112.zip / cputil-win-x64_v112.zip
25-
- Linux x64 ... cputil-linux-x64_v112.tar.gz
26-
- Apple Mac OS (OSX) x64 (Except 10.15 or later) ... cputil-osx-x64_v112.tar.gz
27-
- Apple Mac OS (OSX) x64 (10.15 or later) ... cputil-osx-x64_v112.zip
28-
- Linux Arm (Raspberry PI compatible) ... cputil-linux-arm_v112.tar.gz
23+
cputil can be use on any platform supported by .NET 8.0 including:
24+
- Windows x64 ... cputil-win-x64_v120.zip
25+
- Linux x64 ... cputil-linux-x64_v120.tar.gz
26+
- Apple macOS x64 /arm64 (10.15 or later) ... cputil-macos_v120.zip
2927

3028
In all cases, it is possible to build a self contained package that can be
3129
run on the desired platform without the need for a .NET Framework or .NET Core
3230
installation.
3331

34-
Please refer to SDK documents for details.
35-
(https://www.star-m.jp/products/s_print/CloudPRNTSDK/Documentation/en/index.html)
32+
Please refer to Star CloudPRNT Protocol Guide for details.
33+
(https://star-m.jp/products/s_print/sdk/StarCloudPRNT/manual/en/cputil.html)
3634

3735
=============
3836
2. Contents
3937
=============
4038

41-
cputil-<Platform Name>_v112.zip(or .tar.gz)
39+
cputil-<Platform Name>_v120.zip(or .tar.gz)
4240
|- Readme_En.txt // Release Notes (English)
4341
|- Readme_Jp.txt // Release Notes (Japanese)
4442
|- SoftwareLicenseAgreement.pdf // Software License Agreement (English)
@@ -51,16 +49,15 @@
5149
==========
5250
3. Scope
5351
==========
54-
cputil can be use on any platform supported by .NET 6.0 including:
55-
- Windows x86 and x64 ... cputil-win-x86_v112.zip / cputil-win-x64_v112.zip
56-
- Linux x64 ... cputil-linux-x64_v112.tar.gz
57-
- Apple Mac OS (OSX) x64 (Except 10.15 or later) ... cputil-osx-x64_v112.tar.gz
58-
- Apple Mac OS (OSX) x64 (10.15 or later) ... cputil-osx-x64_v112.zip
59-
- Linux Arm (Raspberry PI compatible) ... cputil-linux-arm_v112.tar.gz
52+
cputil can be use on any platform supported by .NET 8.0 including:
53+
- Windows x64 ... cputil-win-x64_v120.zip
54+
- Linux x64 ... cputil-linux-x64_v120.tar.gz
55+
- Apple macOS x64 / arm64 (10.15 or later) ... cputil-macos_v120.zip
6056

6157
Works with these CloudPRNT client printers:
6258
- mC-Print2
6359
- mC-Print3
60+
- mC-Label3 / TSP100IV SK
6461
- TSP100IV
6562
- TSP650II with IFBD-HI01X
6663
- TSP700II with IFBD-HI01X
@@ -69,17 +66,17 @@
6966
- SP700 with IFBD-HI02X
7067

7168
Please refer to each CloudPRNT client printer for details.
72-
You can check the manual from Star web site.
73-
(https://www.star-m.jp/products/s_print/CloudPRNTSDK/Documentation/en/developerguide/introduction.html)
69+
You can check the Star CloudPRNT Protocol Guide.
70+
(https://star-m.jp/products/s_print/sdk/StarCloudPRNT/manual/en/index.html)
7471

7572
==================
7673
4. Usage Example
7774
==================
7875

7976
The example of usages for cputil are like below.
8077

81-
And it also can be refer to SDK documents for details.
82-
(https://www.star-m.jp/products/s_print/CloudPRNTSDK/Documentation/en/articles/cputil/cputil_usage.html)
78+
And it also can be refer to Star CloudPRNT Protocol Guide for details.
79+
(https://star-m.jp/products/s_print/sdk/StarCloudPRNT/manual/en/cputil.html)
8380

8481
### Installation
8582
Please unzip/extract cputil-<Platform Name>.zip(or .tar.gz) to any specified path on PC.
@@ -89,15 +86,13 @@
8986
Please open the terminal or command prompt on each PC and perform following command.
9087

9188
[Windows]
92-
> cd <Extracted Directory Path>\cputil-win-x64_v112\cputil-win-x64
93-
or
94-
> cd <Extracted Directory Path>\cputil-win-x86_v112\cputil-win-x86
89+
> cd <Extracted Directory Path>\cputil-win-x64_v120\cputil-win-x64
9590

9691
[Linux]
9792
$ cd <Extracted Directory Path>/cputil-linux-x64
9893

9994
[macOS]
100-
$ cd <Extracted Directory Path>/cputil-osx-x64
95+
$ cd <Extracted Directory Path>/cputil-macos
10196

10297
Notes:
10398
On macOS 10.15 or later, cputil will be installed by Star provided pkg installer.
@@ -354,7 +349,7 @@
354349
===============
355350

356351
1. Word wrapping / column command for starmarkup features with Unicode character are only supported
357-
by mC-Print2 / mC-Print3 / TSP650II.
352+
by mC-Print2 / mC-Print3 / mC-Label3 / TSP100IV / TSP100IV SK / TSP650II.
358353

359354
=================
360355
6. OSS Licenses
@@ -375,6 +370,19 @@
375370
8. Release History
376371
====================
377372

373+
Ver 1.2.0
374+
2025/03/10:
375+
Support the command option of [-template] for [decode] command : for template printing function.
376+
Update the SixLabors.ImageSharp library from V1.0.4 to V2.1.9.
377+
Update the .NET framework from .NET 6.0 to .NET 8.0.
378+
Support the following Star Document Markup tags.
379+
- [buzzer]
380+
- [drawer]
381+
- [fixedWidth]
382+
- [linespacing]
383+
- [templateArray]
384+
Support the `variable-left` option of [column] Star Document Markup tag.
385+
378386
Ver 1.1.2
379387
2022/04/28:
380388
Update the SixLabors.ImageSharp library from V1.0.2 to V1.0.4 to support .NET 6.0 environment.

CloudPRNTSDKSamples/cputil/Readme_Jp.txt

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
************************************************************
2-
cputil Ver 1.1.2 2022/04/28
2+
cputil Ver 1.2.0 2025/03/10
33
Readme_Jp.txt スター精密(株)
44
************************************************************
55

@@ -16,32 +16,30 @@
1616
1. 概要
1717
==========
1818

19-
本パッケージは、cputil V1.1.2 です。
19+
本パッケージは、cputil V1.2.0 です。
2020
cputil は、.NET Frameworkまたは .NET Core ベースではない CloudPRNTサーバーの実装に役立つ
2121
便利なバックエンド ツールとして機能することを目的としています。
2222

23-
cputilは、.NET 6.0を用いて実装しております。
23+
cputilは、.NET 8.0を用いて実装しております。
2424

2525
このため、
26-
  .NET 6.0に対応したプラットフォームで利用出来ます。
26+
  .NET 8.0に対応したプラットフォームで利用出来ます。
2727
 cputilを利用するPCにて、.NET Frameworkのインストールは不要です。
2828

2929
具体的にcputilを利用できるプラットフォームは以下の通りです。
30-
- Windows x86 and x64 ... cputil-win-x86_v112.zip / cputil-win-x64_v112.zip
31-
- Linux x64 ... cputil-linux-x64_v112.tar.gz
32-
- Apple Mac OS (OSX) x64 (10.15以降を除く) ... cputil-osx-x64_v112.tar.gz
33-
- Apple Mac OS (OSX) x64 (10.15以降) ... cputil-osx-x64_v112.zip
34-
- Linux Arm (Raspberry PI compatible) ... cputil-linux-arm_v112.tar.gz
30+
- Windows x64 ... cputil-win-x64_v120.zip
31+
- Linux x64 ... cputil-linux-x64_v120.tar.gz
32+
- Apple macOS x64 /arm64 (10.15以降) ... cputil-macos_v120.zip
3533

36-
詳細な説明は、SDKドキュメントファイルを参照ください
37-
(https://www.star-m.jp/products/s_print/CloudPRNTSDK/Documentation/ja/index.html)
34+
詳細な説明は、Star CloudPRNT プロトコルガイドを参照ください
35+
(https://star-m.jp/products/s_print/sdk/StarCloudPRNT/manual/ja/cputil.html)
3836

3937

4038
==========
4139
2. 内容
4240
==========
4341

44-
cputil-<Platform Name>_v112.zip(or .tar.gz)
42+
cputil-<Platform Name>_v120.zip(or .tar.gz)
4543
|- Readme_En.txt // リリースノート (英語)
4644
|- Readme_Jp.txt // リリースノート (日本語)
4745
|- SoftwareLicenseAgreement.pdf // ソフトウエア使用許諾書 (英語)
@@ -56,35 +54,34 @@
5654
3. 適用
5755
==========
5856

59-
本ソフトウェアは現在、.NET Core 6.0 によってサポートされるプラットフォームに対応しています。
60-
- Windows x86 and x64 ... cputil-win-x86_v112.zip / cputil-win-x64_v112.zip
61-
- Linux x64 ... cputil-linux-x64_v112.tar.gz
62-
- Apple Mac OS (OSX) x64 (10.15以降を除く) ... cputil-osx-x64_v112.tar.gz
63-
- Apple Mac OS (OSX) x64 (10.15以降) ... cputil-osx-x64_v112.zip
64-
- Linux Arm (Raspberry PI compatible) ... cputil-linux-arm_v112.tar.gz
57+
本ソフトウェアは現在、.NET Core 8.0 によってサポートされるプラットフォームに対応しています。
58+
- Windows x64 ... cputil-win-x64_v120.zip
59+
- Linux x64 ... cputil-linux-x64_v120.tar.gz
60+
- Apple macOS x64 /arm64 (10.15以降) ... cputil-macos_v120.zip
6561

6662
いずれの場合も、自己完結型パッケージにてビルドされており、
6763
.NET Framework または .NET Core のインストールを必要とせずに目的のプラットフォームで実行できます。
6864

6965
また、下記のCloudPRNTクライアント対応プリンタを対象としています。:
7066
- mC-Print2
7167
- mC-Print3
72-
- TSP100IV
68+
- mC-Label3
69+
- TSP100IV / TSP100IV SK
7370

74-
CloudPRNTについての詳細は、SDKドキュメントファイルを参照ください
75-
(https://www.star-m.jp/products/s_print/CloudPRNTSDK/Documentation/ja/developerguide/introduction.html)
71+
CloudPRNTについての詳細は、Star CloudPRNT プロトコルガイドを参照ください
72+
(https://star-m.jp/products/s_print/sdk/StarCloudPRNT/manual/ja/index.html)
7673

7774

7875
===============
7976
4. 使用例
8077
===============
8178
cputilの使用例は以下になります。
8279

83-
また、詳細な説明はSDKドキュメントファイルを参照してください
84-
(https://www.star-m.jp/products/s_print/CloudPRNTSDK/Documentation/ja/articles/cputil/cputil_usage.html)
80+
また、詳細な説明はStar CloudPRNT プロトコルガイドを参照してください
81+
(https://star-m.jp/products/s_print/sdk/StarCloudPRNT/manual/ja/cputil.html)
8582

8683
### インストレーション
87-
PC 上の任意のパスに cputil-<プラットフォーム名>_v112.zip(または .tar.gz)を解凍してください。
84+
PC 上の任意のパスに cputil-<プラットフォーム名>_v120.zip(または .tar.gz)を解凍してください。
8885
(インストール場所と方法は、PC/サーバー管理者が任意で選択できます)
8986

9087
以下の操作は、本使用例をテストするために実施します。
@@ -93,15 +90,13 @@
9390
また起動後、次のコマンドを実行してください。
9491

9592
[Windows]
96-
> cd <Extracted Directory Path>\cputil-win-x64_v112\cputil-win-x64
97-
or
98-
> cd <Extracted Directory Path>\cputil-win-x86_v112\cputil-win-x86
93+
> cd <Extracted Directory Path>\cputil-win-x64_v120\cputil-win-x64
9994

10095
[Linux]
10196
$ cd <Extracted Directory Path>/cputil-linux-x64
10297

10398
[macOS]
104-
$ cd <Extracted Directory Path>/cputil-osx-x64
99+
$ cd <Extracted Directory Path>/cputil-macos
105100

106101
備考:
107102
macOS 10.15以降では、cputilはStarが提供するpkgイントーラーによってインストールされます。
@@ -178,7 +173,7 @@
178173
mediaTypes リストを準備できます。
179174

180175
例えば、PNG イメージを印刷ジョブソースとして使用するサーバーの場合は次のコマンドを利用してください。
181-
(この例では sourceimage.png は入力ファイル名です。当該ファイルを準備しcputil実行可能ファイルと同じディレクトリに配置してください)
176+
この例では sourceimage.png は入力ファイル名です。当該ファイルを準備しcputil実行可能ファイルと同じディレクトリに配置してください)
182177

183178
コマンド例:
184179
[Windows]
@@ -340,9 +335,22 @@
340335
8. 変更履歴
341336
=============
342337

338+
Ver 1.2.0
339+
2025/03/10:
340+
「decode」コマンド : 「-template」コマンドオプションによりテンプレート印刷機能をサポート
341+
.NET フレームワークを.NET 6.0から.NET 8.0へ更新
342+
画像処理のためのSixLabors.ImageSharpライブラリをV1.0.4からV2.1.9へ更新
343+
以下のStarドキュメントマークアップタグをサポート
344+
- [buzzer]
345+
- [drawer]
346+
- [fixedWidth]
347+
- [linespacing]
348+
- [templateArray]
349+
Starドキュメントマークアップタグ [column] variable-leftオプションをサポート
350+
343351
Ver 1.1.2
344352
2022/04/28:
345-
  SixLabors.ImageSharpライブラリを.NET 6.0環境に対応するためV1.0.2からV1.0.4へ更新
353+
 SixLabors.ImageSharpライブラリを.NET 6.0環境に対応するためV1.0.2からV1.0.4へ更新
346354
Newtonsoft.JsonライブラリをV12.0.3からV13.0.1へ更新
347355
.NET フレームワークを.NET Core 3.1から .NET 6.0へ更新
348356

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Template Printing Samples
2+
Please select a sample that closely resembles the layout you would like to print in your application and edit the sample data to make use of it.
3+
4+
<a id="ReceiptSamples"></a>
5+
## Receipt Samples
6+
There are some samples of generating receipts using the template printing function.
7+
8+
Please combine ReceiptSampleXX_SampleName_TemplateData.stm as template and ReceiptSampleXX_SampleName_FieldData.json as field data.
9+
10+
| \# | Sample Name | Printing Result Image |
11+
|----|-------------|-----------------------|
12+
| 1 | Receipt (with FieldData_1.json) | <img src="ReceiptSamples/images/ReceiptSample01_CafeReceipt.png" width="258px"> |
13+
| 2 | Online Order | <img src="ReceiptSamples/images/ReceiptSample02_OnlineOrder.png" width="258px"> |
14+
| 3 | Order1 | <img src="ReceiptSamples/images/ReceiptSample03_Order_EN.png" width="258px"> |
15+
| 4 | Order2 | <img src="ReceiptSamples/images/ReceiptSample04_Order_JP.png" width="258px"> |

0 commit comments

Comments
 (0)