Print data generation device, print data generation method, printing API generation device, and printing API generation method

By using a template with non-repetitive API call commands and specifying a repetition range, print data generation APIs can handle variable elements efficiently, enhancing code readability and simplifying the process.

JP2025103123APending Publication Date: 2025-07-09STAR MICRONICS CO LTD

Patent Information

Application Number
JP2023220247
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2025-07-09

AI Technical Summary

Technical Problem

Existing print data generation APIs require repetitive code descriptions for handling variable numbers of print elements, making the program code unintuitive and difficult to understand.

Method used

Generate print data using a template with API call commands in the smallest unit that do not include repetitions, specifying a repetition range based on template and field data, and replacing insertion fields with print elements to create a print data generation API that is executed multiple times according to the variable number of elements.

Benefits of technology

This approach allows for intuitive generation of print data with a variable number of elements without repetitive code descriptions in the calling application, improving readability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025103123000001_ABST
    Figure 2025103123000001_ABST
Patent Text Reader

Abstract

To make it possible to execute merge printing by generating print data having a variable number of print elements without incorporating description required for repeatedly calling a print data generation application programming interface (API) in a program code of an application that calls the API.SOLUTION: Print data are generated using a template composed of commands of the minimum unit not including repetitions, the number of which corresponds to a variable number of print elements, and field data including data of print elements to be inserted into merge fields of application programming interface (API) call commands included in the template. A repetition range is specified from the template, a print data generation API is generated by replacing the merge fields, including repeat replacement of repetitions within the specified range, with the data of the print elements, and by executing the generated print data generation API, print data including print-related commands into which the data of the print elements have been inserted is generated.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a print data generation apparatus, a print data generation method, a print API generation apparatus, and a print API generation method, and is particularly suitable for use in an apparatus and method for generating print data for insert printing, and an apparatus and method for generating a print data generation API.

Background Art

[0002] Conventionally, in a system that transmits receipt print data from a POS terminal to a printer to execute printing, there is known a configuration in which print data including commands such as character decoration and paper cutting in addition to a print instruction is transmitted (for example, see Patent Document 1). FIG. 4 of Patent Document 1 shows print data including a plurality of character string print-related command groups composed of a combination of a character string print instruction command including dedicated instruction codes and character string information and a character string decoration command. For each character string print-related command group, the printer converts each character code included in the character string print instruction command into each corresponding font data, and then performs printing after applying the decoration specified by the character string decoration command.

[0003] Also conventionally, in order to make it easier to handle printer control from the upper software of a POS terminal, a print data generation API (Application Programming Interface) that can be called from each programming language has been provided, and print data including the above-described commands is generated by this print data generation API. When generating print data including a plurality of commands corresponding to print elements with variable numbers of elements (for example, item parts of a receipt) as shown in FIG. 4 of Patent Document 1 using this print data generation API, the application side that calls the print data generation API obtains the number of elements from field data in which information on the character string to be printed is recorded, and repeatedly executes the print data generation API by the number of elements to generate print data.

[0004] However, when the print data generation API is repeatedly executed multiple times, in the program code of the application that calls the print data generation API, it is necessary to incorporate descriptions such as loops and conditional branches, resulting in code that is not intuitive and difficult to understand.

Prior Art Documents

Patent Documents

[0005]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0006] The present invention has been made to solve such problems, and without incorporating the descriptions necessary for repeatedly calling the print data generation API into the program code of the calling application, it is an object to be able to generate print data with a variable number of print elements and execute insert printing.

Means for Solving the Problems

[0007] In order to solve the above problems, in the present invention, print data including a plurality of print-related commands is generated using a template and field data including data of print elements to be inserted into the insertion fields of the template. The template includes one or more API call commands for generating print-related commands, and the one or more API call commands are composed of commands in the smallest unit that do not include repetitions according to the variable number of print elements. Then, based on both the contents of the template and the field data or the contents of the template, the range of API call commands to be repeatedly executed a number of times according to the variable number of print elements is specified from the template, and the insertion fields included in the API call commands are replaced with the data of the print elements, including repeated replacements within the specified range, to generate a print data generation API including a plurality of API call commands. By executing the generated print data generation API, print data including print-related commands into which the data of the print elements is inserted is generated.

Advantages of the Invention

[0008] According to the present invention configured as described above, based on a template in which one or more API call commands are composed of commands in the smallest unit that do not include repetitions, a print data generation API is generated so that the API call commands are repeatedly executed a number of times according to the variable number of print elements, and print data is generated by executing this print data generation API. Therefore, it becomes possible to generate print data by sequentially executing a plurality of API call commands included in the generated print data generation API. As a result, it is possible to generate print data with a variable number of print elements and perform insert printing without incorporating the description necessary for repeatedly calling the print data generation API into the program code of the calling application.

Brief Description of the Drawings

[0009]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10A

Figure 10B

Figure 11

Figure 12

Figure 13

Figure 14A

Figure 14B

Figure 15

Figure 16

Mode for Carrying Out the Invention

[0010] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing an overall schematic configuration example of the printing system of this embodiment. As shown in FIG. 1, the printing system according to this embodiment includes a host device 10 and a printer 20. In the configuration shown in FIG. 1, the host device 10 includes a printing data generation device and a printing API generation device of this embodiment.

[0011] The host device 10 and the printer 20 are connected by a wired interface cable such as a serial cable, Ethernet (registered trademark), or USB (Universal Serial Bus), for example. Alternatively, the host device 10 and the printer 20 may be connected via a wireless communication network such as Bluetooth (registered trademark), Wi-Fi (registered trademark), or wireless LAN. Alternatively, the host device 10 and the printer 20 may be connected via a communication network such as the Internet.

[0012] FIG. 2 is a diagram showing a hardware configuration example of the printing system according to this embodiment. As shown in FIG. 2, the host device 10 includes a control unit 101, a storage unit 102, an input unit 103, a display unit 104, and an I / F 105 as a hardware configuration. Further, the printer 20 includes a control unit 201, a storage unit 202, an I / F 203, and a printing unit 204 as a hardware configuration.

[0013] The control unit 101 of the host device 10 is composed of, for example, a microcomputer equipped with a CPU, RAM, and ROM, operates according to the operating system and other programs stored in the storage unit 102, and executes information processing using various data stored in the storage unit 102. In addition to the microcomputer, a DSP (Digital Signal Processor) or the like may be provided.

[0014] The storage unit 102 is composed of a computer-readable storage medium. For example, the storage unit 102 includes a ROM, a RAM, a hard disk, a semiconductor memory, or the like. Various programs executed by the control unit 101 are stored in the storage unit 102. Among the various programs, there are an application program that generates field data to be inserted into the insertion field during the execution of the insertion printing, a print data generation program for generating print data using the field data, and the like. The field data includes data of one or more print elements and is variable data indicating how many print elements are included (the number of print elements, that is, the number of elements of the insertion printing).

[0015] In addition, the storage unit 102 stores various data including data used in the processing of the control unit 101 and data generated during the processing. Among the various data, there are a template and field data used when generating print data, a print data generation API (also referred to as a replaced template) generated by inserting the field data into the insertion field included in the template, command-system print data generated by executing the print data generation API, and the like. The details of the template and the field data will be described later.

[0016] The input unit 103 is composed of, for example, a keyboard, a mouse, a touch panel, etc., and inputs data corresponding to the user's operation input to the control unit 101. The display unit 104 is composed of, for example, a liquid crystal display, etc., and displays information according to an instruction input from the control unit 101. The I / F 105 is composed of a communication module that exchanges data with the printer 20, and outputs various data to the printer 20 according to an instruction input from the control unit 101.

[0017] In the present embodiment, the data to be printed generated by the application program in the storage unit 102 based on the control of the control unit 101 is converted into print data in a command system that can be understood by the printer 20, and the converted print data is output from the I / F 105 to the printer 20. When performing insert printing, the control unit 101 generates print data including a plurality of print-related commands using a template and field data. As an example, the host device 10 generates print data of a receipt including the name and price of purchased items as print elements with variable numbers of elements, and the printer 20 prints the receipt based on this print data.

[0018] The control unit 201 of the printer 20 is composed of, for example, a microcomputer equipped with a CPU, RAM, and ROM, etc., and performs overall control of the printer 20 according to a program stored in the storage unit 202. In addition to the microcomputer, a DSP or the like may be provided. The storage unit 202 includes a ROM, a RAM, a semiconductor memory, etc., and stores various programs and data necessary for printing execution.

[0019] The I / F 203 is composed of a communication module that exchanges data with the host device 10, receives the print data transmitted from the host device 10, and outputs it to the control unit 201. The printing unit 204 forms an image based on the print data on a recording medium such as printing paper by executing printing according to the print-related commands indicated by the print data sent from the host device 10 under the control of the control unit 201.

[0020] FIG. 3 is a block diagram showing an example of the functional configuration of the host device 10. As shown in FIG. 3, the host device 10 of the present embodiment includes a printing API generation unit 11, a print data generation unit 12, a field data generation unit 13, a template storage unit 14, and a field data storage unit 15. The processes of the printing API generation unit 11, the print data generation unit 12, and the field data generation unit 13 are executed by the programs stored in the control unit 101 and the storage unit 102 of FIG. 2. The template storage unit 14 and the field data storage unit 15 are configured by the storage unit 102 of FIG. 2.

[0021] The field data generation unit 13 generates field data including data of print elements to be inserted into the insertion fields of the template stored in the template storage unit 14 by the operation of the application program stored in the storage unit 102. The field data generated by the field data generation unit 13 is stored in the field data storage unit 15.

[0022] The print elements consist of a combination of an item name and an insertion value (such as a character string, a numeric string, or a combination thereof) into the insertion field. As shown in FIG. 4(a), the print elements include print elements (hereinafter referred to as array elements) in which one or more insertion values are arranged and printed on the printing paper, and print elements (hereinafter referred to as single elements) in which only one insertion value is arranged and printed on the printing paper. The number of elements (the number of insertion values) of the array element is variable. On the other hand, the number of elements of the single element is always single and fixed. For example, when printing a receipt, the names and prices of purchased items are examples of array elements, and the store name and purchase date and time are examples of single elements.

[0023] The template storage unit 14 stores templates used when generating print data using the field data. The template includes a plurality of API call commands for generating printing-related commands. The printing-related commands include a command for instructing printing (hereinafter referred to as a print instruction command) and a command for instructing decoration (hereinafter referred to as a decoration instruction command).

[0024] The API call command is a command that instructs the invocation of an API library configured to generate printing-related commands. As shown in FIG. 4(b), the API call command includes a command for invoking a generation library of a printing instruction command (hereinafter referred to as a printing instruction API call command) and a command for invoking a generation library of a decoration instruction command (hereinafter referred to as a decoration instruction API call command).

[0025] The printing instruction API call command includes those that contain a replacement rule for inserting a printing element into the insertion field and those that do not contain a replacement rule. For the printing instruction API call command containing a replacement rule, there are cases where the data of the array element is inserted into the insertion field according to the replacement rule and cases where the data of a single element is inserted into the insertion field. On the other hand, the decoration instruction API call command does not contain a replacement rule.

[0026] FIG. 5 is a diagram for explaining an example of template replacement. As shown in FIG. 5, in the present embodiment, a part starting with the symbol ${ and ending with the symbol} is used as the insertion field, and the string of the insertion field is replaced with the insertion value of the printing element obtained from the field data using the string inside the ${} as the key. FIG. 5 shows an example of replacing the insertion field of the printing instruction API call command with the data of a single element.

[0027] The plurality of API call commands included in the template are composed of a minimum unit command group that does not include a number of repetitions corresponding to the variable number of printing elements. The minimum unit command group that does not include a repetition means that, for the printing instruction API call command containing a replacement rule, even when inserting a plurality of insertion values repeatedly with array elements, the API call command is not included as many as the number of array elements.

[0028] The printing API generation unit 11 determines a range of API call commands (which may be abbreviated as the "repetition range" in the following description) from among a plurality of API call commands included in the template, based on both the content of the template and the field data or the content of the template, and repeats the process a number of times corresponding to the variable number of printing elements. By replacing the insertion fields included in the API call commands with the data of the printing elements, including the repeated replacement within the specified range, a printing data generation API (replaced template) including a plurality of API call commands is generated.

[0029] The printing data generation unit 12 generates printing data including printing-related commands with the data of the printing elements inserted therein by executing the printing data generation API generated by the printing API generation unit 11. That is, the printing data generation unit 12 calls an API library configured to generate printing-related commands according to a plurality of API call commands included in the printing data generation API, and executes the processes defined in the API library to generate printing data including a plurality of printing-related commands. Then, the generated printing data is output to the printer 20.

[0030] Hereinafter, three embodiments regarding the process of the printing API generation unit 11 will be described. The first embodiment specifies the repetition range of the API call commands based on the content of the template. The second and third embodiments specify the repetition range of the API call commands based on both the content of the template and the field data.

[0031] (First Embodiment) In the first embodiment, the template has a hierarchical structure of a plurality of API call commands and includes a repeat start flag at any hierarchy. The print API generation unit 11 identifies the repeat range based on the repeat start flag and the hierarchical structure. The hierarchical structure is generally used to specify the range to which character decoration is applied in the print data generation API. That is, in the print data generation API, the character decoration specified by a decoration instruction API call command at a certain hierarchy is applied to that hierarchy and the hierarchies below it, while it is not applied to the hierarchies above it. In the first embodiment, this mechanism is used to identify the repeat range.

[0032] FIG. 6 is a diagram for explaining the processing content of the print API generation unit 11 according to the first embodiment. In FIG. 6, the decoration instruction API call command is shown by a dotted line frame, and the print instruction API call command is shown by a solid line frame. Among the print instruction API call commands, those including a replacement rule are shown by a thick solid line frame, and those not including a replacement rule are shown by a thin solid line frame. The execution order of the API call commands is shown from top to bottom in the figure, and the hierarchies become deeper from left to right in the figure. Note that "\n" included in the API call command means a line feed instruction. The same applies to the figures listed below.

[0033] FIG. 6(a) shows an example of a template and field data having a hierarchical structure, and a repetition range RR specified by the print API generation unit 11 is shown by a rectangular frame in the template. The template includes a hierarchical control function. In the figure, the symbol "↓" means to lower the hierarchy, and the symbol "↑" means to raise the hierarchy. The repetition range RR also includes a hierarchical control function. FIG. 6(b) shows an example of a print data generation API (replaced template) generated by replacing the insertion fields included in the API call command with the data of the print elements included in the field data, including the repetition replacement in the specified range. In the present embodiment, an example in which the field data is configured in the JSON format is shown, but it is not limited thereto. For example, the field data can be configured in any data format such as XML, CSV, and Flat file.

[0034] In the example of FIG. 6, the template is composed of three hierarchies. From the beginning of the first hierarchy, one decoration instruction API call command and one printing instruction API call command are described one by one. After the repetition start flag SF is described at the beginning of the subsequent second hierarchy, one decoration instruction API call command and one printing instruction API call command are described one by one. Further, after one decoration instruction API call command and one printing instruction API call command are described one by one when entering the third hierarchy, the printing instruction API call command is described one when returning to the first hierarchy.

[0035] As shown in FIG. 6(a), the printing API generation unit 11 identifies the API call commands included in the second layer including the repeat start flag SF and the third layer below it as the range of API call commands (repeat range RR) for executing repeat substitution. That is, the decoration instruction API call command and the printing instruction API call command included in the second layer, and the decoration instruction API call command and the printing instruction API call command included in the third layer are identified as the repeat range RR. The repeat range RR also includes the layer control functions related to the API call commands identified as described above. The layer control functions related to the identified API call commands mean the layer control functions (in the example of FIG. 6(a), the four layer control functions indicated by the symbols "↓" and "↑" in the first layer and the second layer) that control the transition to the layer (the second layer and the third layer in the example of FIG. 6(a)) in which the identified API call commands are included or the transition from that layer.

[0036] Then, the printing API generation unit 11 generates a print data generation API (replaced template) by replacing the insertion fields of the plurality of printing instruction API call commands included in the template with the data (insertion values) of the print elements included in the field data. At this time, as shown in FIG. 6(b), the printing API generation unit 11 copies the API call commands and the related layer control functions included in the identified repeat range RR so that the number is the same as the number of array elements included in the field data, and repeats the process of replacing the insertion fields of the printing instruction API call commands with the data of the array elements the number of times corresponding to the number of array elements. The number of array elements can be grasped by referring to the field data with the internal string enclosed in ${} as the key.

[0037] As shown in FIG. 6(a), the field data includes one single element SE and two array elements AE. In the example of FIG. 6(a), one single element SE is the store name, and the two array elements AE are the product name and the price. Both of the two array elements AE have two elements (the number of inserted values). When the field data is configured in this way, the printing API generation unit 11 copies a set of a plurality of API call commands included in the repetition range RR, and then repeats the substitution process for the inserted values of the insertion fields twice for the print instruction API call command. The printing data generation API generated as a result of this process is shown in FIG. 6(b).

[0038] That is, the insertion field "${store_name}" of the first-layer print instruction API call command shown in FIG. 6(a) is replaced with the data "Star Store" of the single element SE included in the field data. The data "Star Store" of the single element SE used for this substitution is obtained from the field data using the internal string enclosed by ${} as the key (the same applies to the following API call commands). Also, the insertion field "${items.name}" of the second-layer print instruction API call command included in the repetition range RR is replaced twice with the data "T shirt" and "Denim" of the array element AE included in the field data, and the insertion field "${items.price}" of the third-layer print instruction API call command is replaced twice with the data "10.99" and "29.99" of the array element AE included in the field data.

[0039] Regarding the API call commands including the replacement rules of array elements and the related decorated instruction API call commands, it is necessary to repeat the execution for the number of array elements. However, in this embodiment, the API call commands are copied the required number of times to generate a print data generation API. Therefore, in the calling source application (print data generation program), it is only necessary to execute the multiple API call commands included in the generated print data generation API one by one in order from the beginning as shown in Fig. 6(b). As a result, there is no need to incorporate the description necessary for repeatedly calling the API call commands into the program code of the calling source application. This also applies to the second and third embodiments described later.

[0040] Fig. 7 is a diagram showing the print result when the print data generated by the print data generation unit 12 based on the print data generation API shown in Fig. 6(b) is output to the printer 20. As described above, as a result of the replacement process of the print instruction API call commands of the second and third layers being repeatedly executed twice in the repetition range RR, "T shirt" and "Denim" are printed as the product names "name" of the second layer, and "10.99" and "29.99" are printed as the prices "price" of the third layer. Since the API call command of the second layer does not include "\n", the "name" of the second layer and the "price" of the third layer are printed without line breaks.

[0041] In the example of the print data generation API shown in FIG. 6(b), since the character decoration of "left alignment" is specified at the beginning of the first layer, all the character decorations of "left alignment" are applied to the character strings printed based on the print instruction commands generated from the print instruction API call commands described below the first layer. Also, since the character decoration of "bold" is specified at the second layer, all the character decorations of "bold" are applied to the character strings printed based on the print instruction commands generated from the print instruction API call commands described below the second layer. Further, since the character decoration of "underline" is specified at the third layer, the character decoration of "underline" is applied to the character strings printed based on the print instruction commands generated from the print instruction API call commands described at the third layer.

[0042] (Second Embodiment) In the second embodiment, the template does not have a hierarchical structure and does not include the repeat start flag SF. The print API generation unit 11 specifies the repeat range RR based on both the types of API call commands and the field data included in the template.

[0043] FIG. 8 is a diagram for explaining the processing content of the print API generation unit 11 according to the second embodiment. For easy understanding of the explanation, ascending indexes IDX i (i = 0, 1, 2,...) starting from "0" are set for a plurality of API call commands included in the template.

[0044] FIG. 8(a) shows an example of a template and field data that do not have a hierarchical structure, and shows the repeated range RR specified by the print API generation unit 11 as a rectangular frame in the template. Since it does not have a hierarchical structure for specifying the application range of character decoration, the template includes a decoration instruction API call command for canceling the application of character decoration in addition to the decoration instruction API call command for instructing the application of character decoration. The field data is the same as that shown in FIG. 6(a). FIG. 8(b) shows an example of a print data generation API (replaced template) generated by replacing the inserted fields included in the API call command with the data of the print elements included in the field data, including the repeated replacement in the specified range.

[0045] As shown in FIG. 8(a), the print API generation unit 11 determines, from the print instruction API call command including the replacement rule by the repeated array elements among the plurality of print elements included in the field data, all the API call commands included up to immediately before the print instruction API call command not including the replacement rule by the array elements, and the decoration instruction API call command existing before the print instruction API call command including the replacement rule by the array elements, as the repeated range RR. Among the plurality of API call commands included in the template, which one is the print instruction API call command including the replacement rule by the array element AE can be determined by referring to the field data using the character string of the inserted field of the print instruction API call command as a key.

[0046] In the template shown in Fig. 8(a), the API call commands with indexes IDX0 and IDX2 are decoration instruction API call commands that exist before the printing instruction API call commands including the replacement rule by the array element AE. Therefore, these two are included in the repetition range RR. The API call command with index IDX1 is a printing instruction API call command, but by referring to the field data using the string "store_name" of the insertion field as a key, it is determined that the printing element corresponding to the string "store_name" is not the array element AE. Therefore, the API call command with index IDX1 is not included in the repetition range RR.

[0047] The API call command with index IDX3 is a printing instruction API call command, and by referring to the field data using the string "items.name" of the insertion field as a key, it is determined that the printing element corresponding to the string "items.name" is the array element AE. Therefore, the printing API generation unit 11 determines that the API call command with index IDX3 is a printing instruction API call command including the replacement rule by the array element AE, and starts searching for the repetition range RR starting from this position.

[0048] The API call commands with indexes IDX4, IDX5, and IDX7 after index IDX3 are decoration instruction API call commands. Also, the API call command with index IDX6 is a printing instruction API call command, but by referring to the field data using the string "items.price" of the insertion field as a key, it is determined that the printing element corresponding to the string "items.price" is the array element AE. Therefore, the printing API generation unit 11 determines that the API call commands with indexes IDX4 to IDX7 are within the repetition range RR and none of them indicate the end position of the repetition range RR.

[0049] The API call command of index IDX8 is a print instruction API call command, and the string "Thank you" is not surrounded by the replacement rule "${}". Therefore, the print API generation unit 11 determines that the API call command of index IDX8 is a print instruction API call command that does not include the replacement rule by the array element AE, and specifies the end position of the repetition range RR of the API call command of index IDX7 immediately before this as the end position.

[0050] Then, the print API generation unit 11 generates a print data generation API (replaced template) by replacing the insertion fields of a plurality of print instruction API call commands included in the template with the data (insertion values) of the print elements included in the field data. At this time, as shown in FIG. 8(b), the print API generation unit 11 copies the API call commands included in the specified repetition range RR so that the number is the same as the number of array elements included in the field data, and repeats the process of replacing the insertion fields of the print instruction API call commands with the data of the array elements the number of times corresponding to the number of array elements.

[0051] FIG. 9 is a diagram showing a print result when the print data generated by the print data generation unit 12 based on the print data generation API shown in FIG. 8(b) is output to the printer 20. In the example of the print data generation API shown in FIG. 8(b), after canceling the "bold" character decoration for the product name "name", the "underline" character decoration for the price "price" is set. Therefore, the product name is printed only with the bold character decoration, and the price is printed only with the underline character decoration.

[0052] FIGS. 10A and 10B are flowcharts showing an operation example of the print API generation unit 11 according to the second embodiment. FIG. 11 is a diagram showing an example of a replaced template in the generation process by the processing according to this flowchart. Hereinafter, the operation will be described with reference to FIGS. 10A, 10B, and 11.

[0053] First, the printing API generation unit 11 initializes the value of the repetition start index IDX to be used as a parameter to "-1" (step S1). Next, the printing API generation unit 11 determines whether there is a next API call command in the template (step S2). If not, the processes of the flowcharts shown in FIGS. 10A and 10B are terminated. S When there is a next API call command, the printing API generation unit 11 acquires the next API call command from the template (step S3), and determines whether the value of the current repetition start index IDX

[0054] S is "-1" (step S4). When the value of the repetition start index IDX S is "-1", the printing API generation unit 11 determines whether the API call command acquired in step S3 includes a replacement rule for array elements (step S5).

[0055] When the API call command does not include a replacement rule for array elements, the printing API generation unit 11 determines whether the API call command includes a replacement rule for a single element (step S6). When the API call command includes a replacement rule for a single element, the printing API generation unit 11 acquires the data of the single element specified by the replacement rule from the field data, and replaces the insertion field of the API call command with the acquired data of the single element (step S7). Then, the API call command is added to the replaced template (step S8).

[0056] On the other hand, if it is determined in step S6 that the API call command does not include a replacement rule for a single element, the process of step S7 is skipped, and the API call command acquired in step S3 is directly added to the replaced template (step S8). After the process of step S8, the process returns to step S2, and if there is a next API call command, it is acquired (step S3).

[0057] ​In step S3, when the API call commands of indexes IDX0 and IDX2 shown in FIG. 8(a) are acquired, the process of step S7 is skipped, and the API call commands are directly added to the replaced template (step S8). Also, in step S3, when the API call command of index IDX1 shown in FIG. 8(a) is acquired, after replacing the insertion field of the API call command with the data of a single element specified by the replacement rule (step S7), the API call command is added to the replaced template (step S8). Up to this stage, the replaced template is configured as shown in FIG. 11(a).

[0058] In step S5 above, when it is determined that the API call command includes the replacement rule for array elements, the value of the repeat start index IDX S is updated with the value of the index IDX i of the current API call command (step S9). Then, the process returns to step S2. In step S3, when the API call command of index IDX3 is acquired, since it is determined that the API call command includes the replacement rule for array elements, the value of the repeat start index IDX S is updated with index IDX3. This index IDX3 will indicate the search start position of the repeat range RR.

[0059] When the value of the repeat start index IDX S is updated, in step S4 after returning to step S2, it is determined that the value of the repeat start index IDX S is not "-1". In this case, the print API generation unit 11 determines whether the API call command acquired in step S3 is a print instruction command that does not include the replacement rule for array elements (step S10). Here, when it is determined that it is not a print instruction command that does not include the replacement rule for array elements, the process returns to step S2. In step S3, when the API call commands of indexes IDX4 to IDX7 are acquired, the determination in step S10 results in No.

[0060] On the one hand, in step S10, when it is determined that the printing instruction command does not include the replacement rule of array elements, the printing API generation unit 11 extracts the following repeated replacement target API call commands from the template (step S11). · The decoration instruction API call commands included from the beginning of the template to one before the repeated start index IDX S · All API call commands included from the repeated start index IDX S to one before the current index IDX i are obtained.

[0061] In the example of FIG. 8(a), at the stage where the API call command of index IDX8 is obtained in step S3, it is determined that it is a printing instruction command that does not include the replacement rule of array elements. Therefore, the printing API generation unit 11 obtains the decoration instruction API call commands included in indexes IDX0 to IDX2 from the beginning of the template to one before the repeated start index IDX3, and all API call commands included in indexes IDX3 to IDX7 from the repeated start index IDX3 to one before the current index IDX8. The multiple API call commands obtained here become the repeated range RR.

[0062] Next, the printing API generation unit 11 copies the multiple API call commands obtained in step S11 to have the same number as the number of array elements included in the field data, and repeatedly executes the process of replacing the insertion field of the printing instruction API call command with the data of the array elements the number of times corresponding to the number of array elements. Then, the multiple API call commands after execution are added to the replaced template (step S12). At this stage so far, the replaced template is configured as shown in FIG. 11(b).

[0063] ​Next, the print API generation unit 11 determines whether the API call command of the index IDX8 acquired in step S3 includes a single-element replacement rule (step S13). If the API call command includes a single-element replacement rule, the print API generation unit 11 acquires the data of the single element specified by the replacement rule from the field data, and replaces the insertion field of the API call command with the acquired single-element data (step S14). Then, the API call command is added to the replaced template (step S15).

[0064] On the other hand, if the API call command does not include a single-element replacement rule, the process of step S14 is skipped, and the API call command acquired in step S3 is directly added to the replaced template (step S15). By executing the process of step S15, the replaced template becomes the state shown in FIG. 8(b). After that, the print API generation unit 11 returns the value of the repeat start index IDX S to the initial value "-1" (step S16), and then returns to step S2. In the example of the template shown in FIG. 8(a), since there is no API call command after the index IDX8, the processes of the flowcharts shown in FIGS. 10A and 10B are terminated.

[0065] (Third Embodiment) In the third embodiment, the template has a hierarchical structure but does not include the repeat start flag SF. In the third embodiment, the repeat range RR is specified based on both the types of API call commands and field data included in the template and the hierarchical structure of the API call commands.

[0066] FIG. 12 is a diagram for explaining the processing content of the print API generation unit 11 according to the third embodiment. FIG. 12(a) shows an example of a template and field data having a hierarchical structure, and the repeating range RR specified by the print API generation unit 11 is indicated by a rectangular frame in the template. The template includes a hierarchical control function. In the figure, the symbol "↓" means to lower the hierarchy, and the symbol "↑" means to raise the hierarchy. The repeating range RR also includes a hierarchical control function. The field data is the same as that shown in FIG. 6(a). FIG. 12(b) shows an example of a print data generation API (replaced template) generated by replacing the insertion fields included in the API call command with the data of the print elements included in the field data, including the replacement of repetitions in the specified range.

[0067] As shown in FIG. 12(a), the print API generation unit 11 specifies, as the repeating range RR, the topmost hierarchy among the hierarchies including the print instruction API call command including the replacement rule by the repeating array elements among the plurality of print elements included in the field data and the API call commands included in the hierarchy below that. The repeating range RR also includes the hierarchical control function related to the API call command specified as described above. In the example of FIG. 12(a), as the related hierarchical control function, the hierarchical control function (the four hierarchical control functions indicated by the symbols "↓" and "↑" in the first and second hierarchies) that controls the transition to and from the second and third hierarchies in which the specified API call command is included is included in the repeating range RR. Among the plurality of API call commands included in the template, which one is the print instruction API call command including the replacement rule by the array element AE can be determined by referring to the field data using the character string of the insertion field of the print instruction API call command as a key.

[0068] In the template shown in FIG. 12(a), there is no print instruction API call command including a replacement rule by the array element AE in the first layer, and there are print instruction API call commands including a replacement rule by the array element AE in the second and third layers. Therefore, the print API generation unit 11 specifies, as the repetition range RR, the decoration instruction API call command and the print instruction API call command including the replacement rule of the array element among the API call commands included in the second layer and below, and the hierarchical control function related thereto. In the example shown in FIG. 12(a), since there is no print instruction API call command including a replacement rule by a single element SE below the second layer, all the API call commands below the second layer are included in the repetition range RR.

[0069] Then, the print API generation unit 11 generates a print data generation API (replaced template) by replacing the insertion fields of a plurality of print instruction API call commands included in the template with the data (insertion value) of the print elements included in the field data. At this time, as shown in FIG. 12(b), the print API generation unit 11 copies the API call commands included in the specified repetition range RR and the hierarchical control function related thereto so that the number is the same as the number of array elements included in the field data, and repeatedly executes the process of replacing the insertion fields of the print instruction API call commands with the data of the array elements the number of times corresponding to the number of array elements.

[0070] FIG. 13 is a diagram showing a print result when the print data generated by the print data generation unit 12 based on the print data generation API shown in FIG. 12(b) is output to the printer 20. In the example of the print data generation API shown in FIG. 12(b), character decoration of "bold" for the product name "name" is specified in the third layer, and then character decoration of "underline" for the price "price" is specified in the second layer. Therefore, the product name is printed only with bold character decoration, and the price is printed only with underline character decoration.

[0071] FIG. 14A and FIG. 14B are flowcharts showing operation examples of the printing API generation unit 11 according to the third embodiment. In this flowchart, a range search flag RF indicating whether or not the repeated range RR is being searched and a top-level variable AP indicating the top level of the repeated range RR are used as parameters. FIG. 15 is a diagram showing an example of a template after replacement in the generation process by the processing according to this flowchart. Hereinafter, the operation will be described with reference to FIGS. 14A, 14B, and 15. In FIG. 15, the symbols “↑” and “↓” indicating the hierarchical control functions are not shown.

[0072] First, the printing API generation unit 11 initializes the value of the range search flag RF to “No” (step S21). Next, the printing API generation unit 11 determines whether or not the next API call command exists in the template (step S22). If not, the processing of the flowchart shown in FIGS. 14A and 14B ends.

[0073] If the next API call command exists, the printing API generation unit 11 acquires the next API call command from the template (step S23), and determines whether or not the value of the current range search flag RF is “No” (step S24). If the value of the range search flag RF is “No”, the printing API generation unit 11 determines whether or not the API call command acquired in step S23 includes an array element replacement rule (step S25).

[0074] When the API call command does not include the replacement rule for array elements, the API generation unit 11 for printing determines whether the API call command includes the replacement rule for a single element (step S26). When the API call command includes the replacement rule for a single element, the API generation unit 11 for printing acquires the data of the single element specified by the replacement rule from the field data, and replaces the insertion field of the API call command with the acquired data of the single element (step S27). Then, the API call command is added to the replaced template (step S28). At this time, if there is a hierarchical control function related to the API call command, it is also added to the replaced template.

[0075] On the other hand, when it is determined in step S26 that the API call command does not include the replacement rule for a single element, the process of step S27 is skipped, and the API call command acquired in step S23 is directly added to the replaced template (step S28). At this time, if there is a hierarchical control function related to the API call command, it is also added to the replaced template. After the process of step S28, the process returns to step S22, and if there is a next API call command, it is acquired (step S23).

[0076] At the stage where the API call commands of indexes IDX0 and IDX2 shown in FIG. 12(a) are acquired in step S23, the process of step S27 is skipped, and the API call command is directly added to the replaced template (step S28). At this time, the hierarchical control function related to the API call command of index IDX2 is also added to the replaced template. Also, at the stage where the API call command of index IDX1 shown in FIG. 12(a) is acquired in step S23, after replacing the insertion field of the API call command with the data of the single element specified by the replacement rule (step S27), the API call command is added to the replaced template (step S28). Up to this stage, the replaced template is configured as shown in FIG. 15(a).

[0077] In step S25 above, when it is determined that the API call command includes the replacement rule of the array element, the value of the range search flag RF is updated to "Yes", and the top-level variable AP is set to the value of the hierarchy of the current API call command (step S29). Then, the process returns to step S22. When the API call command of index IDX3 is obtained in step S23, since it is determined that the API call command includes the replacement rule of the array element, the value of the range search flag RF is updated to "Yes", and the value "3" indicating the third hierarchy is set as the value of the top-level variable AP.

[0078] When the value of the range search flag RF is updated to "Yes", in step S24 after returning to step S22, it is determined that the value of the range search flag RF is not "No". In this case, the print API generation unit 11 determines whether the API call command obtained in step S23 is a print instruction command (step S30). Here, when it is determined that it is not a print instruction command, the print API generation unit 11 directly adds the API call command obtained in step S23 to the replaced template (step S31). At this time, if there is a hierarchy control function related to the API call command, it is also added to the replaced template. Until the API call command of index IDX4 is obtained, the replaced template is configured as shown in FIG. 15(b). At this time, the hierarchy control function related to the API call command of index IDX4 is also added to the replaced template.

[0079] After that, the printing API generation unit 11 determines whether the value of the current layer is smaller than the value of the top layer variable AP (step S32). If it is smaller, the value of the top layer variable AP is updated with the value of the current layer (step S33). After that, the process returns to step S22. On the other hand, if the value of the current layer is not smaller than the value of the top layer variable AP, the process of step S33 is skipped and the process returns to step S22. When the API call command of index IDX4 is acquired in step S23, the process of step S33 is executed and the value of the top layer variable AP is updated to the value "2" of the current layer.

[0080] In step S30 above, when it is determined that the API call command acquired in step S23 is a printing instruction command, the printing API generation unit 11 continues to determine whether the printing instruction API call command includes an array element replacement rule (step S34). Here, if it is determined that the array element replacement rule is included, the process proceeds to step S32. When the API call command of index IDX5 is acquired in step S23, since the array element replacement rule is included, the process proceeds to step S32. In this case, since the value of the current layer is not smaller than the value of the top layer variable AP, the process of step S33 is skipped and the process returns to step S22.

[0081] On the other hand, in step S34, if it is determined that the array element replacement rule is not included, the printing API generation unit 11 repeatedly extracts the API call commands to be replaced and the hierarchical control functions related to them from the template (step S35). In the third embodiment, among the API call commands included in the layer below the top layer indicated by the top layer variable AP, the decoration instruction API call command, the printing instruction API call command including the array element replacement rule, and the hierarchical control functions related to them are extracted from the template. In the example of FIG. 12(a), the API call commands of indexes IDX2 to IDX5 and the hierarchical control functions related to them are extracted from the template. The plurality of API call commands and hierarchical control functions extracted here become the repetition range RR.

[0082] Next, the printing API generation unit 11 copies the plurality of API call commands and hierarchical control functions acquired in step S35 so that the number is the same as the number of array elements included in the field data, and repeats the process of replacing the insertion field of the print instruction API call command with the data of the array elements for the number of times corresponding to the number of array elements. Then, the plurality of API call commands and hierarchical control functions after execution are added to the replaced template (step S36). At this stage so far, the replaced template is configured as shown in FIG. 15(c).

[0083] Next, the printing API generation unit 11 determines whether the API call command of the index IDX6 acquired in step S23 includes a single-element replacement rule (step S37). If the API call command includes a single-element replacement rule, the printing API generation unit 11 acquires the data of the single element specified by the replacement rule from the field data, and replaces the insertion field of the API call command with the acquired data of the single element (step S38). Then, the API call command is added to the replaced template (step S39). At this time, if there is a hierarchical control function related to the API call command, it is also added to the replaced template.

[0084] On the other hand, if the API call command does not include a replacement rule for a single element, the process of step S38 is skipped, and the API call command obtained in step S23 is directly added to the replaced template (step S39). At this time, if there is a hierarchical control function related to the API call command, it is also added to the replaced template. By executing the process of step S39, the replaced template becomes the state shown in FIG. 12(b). Thereafter, after the print API generation unit 11 returns the value of the range search flag RF to the initial value "No" (step S40), it returns to step S22. In the example of the template shown in FIG. 12(a), since there is no API call command after index IDX6, the processes of the flowcharts shown in FIGS. 14A and 14B are terminated.

[0085] As described in detail above, in the present embodiment, print data including a plurality of print-related commands is generated using a template and field data including data of print elements to be inserted into the insertion fields of the API call commands included in the template. The template is composed of a plurality of API call commands by a minimum unit command group that does not include a number of repetitions corresponding to the variable number of print elements. Then, the repetition range RR is specified from among the plurality of API call commands included in the template, and the insertion fields included in the API call commands are replaced with the data of the print elements, including the replacement of repetitions within the specified range, thereby generating a print data generation API including a plurality of API call commands. By executing the generated print data generation API, print data including print-related commands into which the data of the print elements is inserted is generated.

[0086] According to the present embodiment configured as described above, for the printing instruction API call command including the replacement rule of the array elements and the related decoration instruction API call command, after copying the necessary number according to the number of the array elements, the data of the array elements is inserted into the insertion field and the print data generation API is generated, and the print data is generated by executing this print data generation API. Therefore, in the calling source application (print data generation program), it is only necessary to execute the API call commands included in the generated print data generation API one by one in order from the beginning. As a result, it is possible to generate print data with a variable number of print elements and execute the insert printing without incorporating the description necessary for repeatedly calling the API call command into the program code of the calling source application. As a result, the readability of the program code of the API calling source application can be improved.

[0087] In addition, in the above first embodiment, the repeat start flag SF may be set at a plurality of locations in the template. For example, when arranging print elements with a fixed number of elements after print elements with a variable number of elements, and further arranging print elements with a variable number of elements thereafter to perform insert printing, it is possible to set the repeat start flag SF at two locations corresponding to each of the first print elements with a variable number of elements and the next print elements with a variable number of elements.

[0088] Also, in the above second and third embodiments, an example has been described in which the repetition range RR is specified based on both the type of the API call command and the field data, but the repetition range RR may be specified without referring to the field data. For example, the type of the API call command may be determined based on the character string of the API call command, and the repetition range RR may be specified based on the type of the API call command. In this case, the association of which character string corresponds to which type of API call command is defined in advance, and the template and the program of the template reference source are created according to the definition.

[0089] Also, in the above-described third embodiment, an example was described in which among the API call commands included in the layers below the top layer indicated by the top layer variable AP, the decoration instruction API call command and the printing instruction API call command including the replacement rule of array elements are extracted from the template to specify the repetition range RR. However, the same may be applied to the first embodiment. That is, among the API call commands included in the layers below the layer including the repeat start flag SF, the decoration instruction API call command and the printing instruction API call command including the replacement rule of array elements may be specified as the repetition range RR.

[0090] Also, in the above-described first to third embodiments, a configuration in which a plurality of API call commands are included in the template has been described. However, a configuration in which only one API call command is included in the template may also be used. In this case, for example, the print API generation unit 11 determines whether the API call command included in the template is a printing instruction API call command including a replacement rule by repeated array elements. When it is determined that the API call command is a printing instruction API call command including the replacement rule by the array elements, it is specified as the repetition range of the API call command.

[0091] Note that in the above-described first to third embodiments, it may be possible to specify the format of the string after replacement according to the replacement rule of the API call command included in the template. For example, the interpolation field of the replacement rule starting with the symbol ${ and ending with the symbol} is configured as follows (“” and + symbols are for explanation and are not actually described), and according to the content of the format specifier, the expression or layout of the string when the field data is inserted into the interpolation field may be specified. “${” + “key” + “format specifier” + “}”

[0092] As the format specifier, for example, the following can be used. (A) Format specifiers for numerical field data When the field data is numerical, it can be specified using format specifiers such as those used in the C language's printf function to indicate what string it will be replaced with. Some specific examples are as follows. %d: Convert to a string as a signed decimal integer. %f: Convert to a string as a decimal number. %1d: Convert to a string as a one-digit signed decimal integer. %5.2f: Convert to a string as a decimal number with a total of 5 digits including the decimal point and 2 digits after the decimal point.

[0093] (B) Format specifiers for specifying the number of characters The format specifier can be used to specify the number of characters after replacement and whether to omit. Some specific examples are as follows. %digit=4,last: Set the number of characters after replacement to 4. Trim the end of the field data. %digit=10,last,ellipsis: Set the number of characters after replacement to 10. Trim the end of the field data and append an ellipsis (...). %digit=10,middle,ellipsis: Set the number of characters after replacement to 10. Trim the middle of the field data and append an ellipsis (...). %digit=10,first,ellipsis: Set the number of characters after replacement to 10. Trim the beginning of the field data and append an ellipsis (...).

[0094] By doing so, for example, when the field data is numerical, it is possible to control what kind of character string it will become when inserted into the insertion field of the template. For example, when there is field data of pi 3.14159265359, it is possible to specify in the template whether to print the value as "3", "3.14", or "3.14159265359". Also, when the width of the printing paper is narrow and there is a limit to the number of characters that can fit in one line, it is possible to prevent unintended line breaks such as when the character string of the field data is too long to fit in one line and the printing wraps to the next line, through the specification of the template.

[0095] Specific examples will be described below. Here, an example will be described where the printing paper is a receipt and a character string including an item list is printed. Assume that the number of characters printable in one line of the receipt is 32 characters, and it is desired to keep the number of characters for one line of the print data within 32 characters. In this case, for example, prepare a template with format specifications as shown in Fig. 16(a).

[0096] In the template shown in Fig. 16(a), the part "${items.name%digit=23,last,ellipsis}" specifies that the product name should be 23 characters, and if it doesn't fit, the end should be truncated and "..." should be added. Up to this point, the number of characters printed in one line is 23 characters / 32 characters. The next part " x" is a fixed character string placed before the replacement rule for the quantity. Up to this point, the number of characters printed in one line is 25 characters / 32 characters. The next part "${items.quantity%1d}" specifies that the numerical value of the quantity should be formatted as a 1-digit decimal integer as a character string. Up to this point, the number of characters printed in one line is 26 characters / 32 characters. The next part " " is a fixed character string placed before the replacement rule for the unit price. Up to this point, the number of characters printed in one line is 27 characters / 32 characters. The next part "${items.price%5.2f}\n" specifies that the numerical value of the unit price should be formatted as a character string with a total of 5 characters including the decimal point and 2 decimal places after the decimal point. Up to this point, the number of characters printed in one line is 32 characters / 32 characters. The final "\n" causes a line break.

[0097] When the template in Fig. 16(a) is used in combination with the field data in Fig. 16(b), the printing result in Fig. 16(c) can be obtained. In this way, by specifying the number of characters according to the replacement rule of the template, the layout of the character string in one line can be flexibly specified. Also, the numerical value of the field data can be converted into a character string in a form along the receipt layout.

[0098] In addition, each of the above embodiments merely shows an example of implementation of the present invention, and the technical scope of the present invention should not be construed in a limited manner thereby. That is, the present invention can be implemented in various forms without departing from the gist or its main features.

Explanation of Reference Numerals

[0099] 10 Host device 11 Printing API generation unit 12 Printing data generation unit 13 Field data generation unit 14 Template storage unit 15 Field data storage unit 20 Printer

Claims

1. A print data generation device that generates print data including a plurality of print-related commands using a template and field data including data of print elements to be inserted into the insertion fields of the template, The template includes one or more API call commands for generating the print-related commands, and the one or more API call commands are composed of commands in the smallest unit that do not include repetitions according to the variable number of print elements, Based on the contents of both the template and the field data or the contents of the template, identify the range of API call commands that repeatedly execute processing a number of times according to the variable number of print elements from among the templates, and include replacement of repetitions within the identified range. A print API generation unit that generates a print data generation API including a plurality of API call commands by replacing the insertion fields included in the API call commands with the data of the print elements, A print data generation unit that generates the print data including the print-related commands into which the data of the print elements are inserted by executing the print data generation API generated by the print API generation unit A print data generation device characterized by the above.

2. The template includes a plurality of the API call commands, has a hierarchical structure of the plurality of API call commands, and includes a repeat start flag at any hierarchy, The print API generation unit according to claim 1, wherein the range of API call commands for executing the replacement of repetitions is specified based on the repeat start flag and the hierarchical structure.

3. The print API generation unit according to claim 2, wherein the API call commands included in the hierarchy including the repeat start flag and the hierarchies below it are specified as the range of API call commands for executing the replacement of repetitions.

4. The printing API generation unit according to claim 2 is characterized in that, among the API call commands included in the layer including the above-mentioned repetition start flag and the layers below it, the API call command for decoration instruction and the API call command for printing instruction including a substitution rule by an array element of repetition are specified as the range of the API call commands for executing the substitution of the above-mentioned repetition.

5. The printing data generation device according to claim 1, wherein the printing API generation unit specifies a range of API call commands for executing the substitution of the above-mentioned repetition based on both the type of the above-mentioned API call command and the above-mentioned field data or the type of the above-mentioned API call command.

6. The printing data generation device according to claim 5, wherein the printing API generation unit includes all API call commands included up to immediately before the API call command for printing instruction that does not include the substitution rule by the array element from the API call command for printing instruction including the substitution rule by the array element of repetition among the plurality of printing elements included in the above-mentioned field data, and the API call command for decoration instruction that exists before the API call command for printing instruction including the substitution rule by the array element, as the range of the API call commands for executing the substitution of the above-mentioned repetition.

7. The above-mentioned template includes a plurality of the above-mentioned API call commands and has a hierarchical structure of the plurality of API call commands. The printing data generation device according to claim 1, wherein the printing API generation unit specifies a range of API call commands for executing the substitution of the above-mentioned repetition based on both the type of the above-mentioned API call command and the above-mentioned field data or the type of the above-mentioned API call command and the above-mentioned hierarchical structure.

8. The printing API generation unit according to claim 7 is characterized in that, among the API call commands in the topmost layer and the lower layers of the hierarchy including the API call command of the printing instruction including the replacement rule by the repeating array elements among the plurality of printing elements included in the field data, the API call command of the decoration instruction and the API call command of the printing instruction including the replacement rule of the array elements are specified as the range of the API call commands for executing the repeating replacement.

9. A printing data generation method for generating printing data including a plurality of printing-related commands using a template and field data including data of printing elements to be inserted into the insertion fields of the template, The template includes one or more API call commands for generating the printing-related commands, and the one or more API call commands are composed of commands in the minimum unit that do not include repetitions according to the variable number of printing elements. A first step of generating a printing data generation API including a plurality of API call commands by specifying a range of API call commands that repeatedly execute processing a number of times according to the variable number of printing elements from the template based on the contents of both the template and the field data or the contents of the template by the printing API generation unit of the printing data generation device, and replacing the insertion fields included in the API call commands with the data of the printing elements including the repeated replacement within the specified range; A second step of generating the printing data including the printing-related commands into which the data of the printing elements are inserted by executing the printing data generation API generated by the printing API generation unit by the printing data generation unit of the printing data generation device. A printing data generation method characterized by the above.

10. A printing API generation device for generating a printing data generation API including a plurality of API call commands using a template and field data including data of printing elements to be inserted into the insertion fields of the template, The above template includes one or more API call commands for generating print-related commands included in print data, and the one or more API call commands are composed of commands in the smallest unit that do not include repetitions according to the variable number of print elements. Based on the contents of both the above template and the above field data or the content of the above template, a range of API call commands that repeatedly execute processing a number of times according to the variable number of print elements is specified from within the above template, and by replacing the above insertion fields included in the above API call commands with the data of the above print elements, including repeated replacement within the specified range, a print API generation unit that generates a print data generation API including a plurality of API call commands is provided. A print API generation device characterized by the above.

11. A print API generation method for generating a print data generation API including a plurality of API call commands using a template and field data including data of print elements to be inserted into insertion fields of the template, The above template includes one or more API call commands for generating print-related commands included in print data, and the one or more API call commands are composed of commands in the smallest unit that do not include repetitions according to the variable number of print elements. The print API generation unit of the print API generation device specifies a range of API call commands that repeatedly execute processing a number of times according to the variable number of print elements from within the above template based on the contents of both the above template and the above field data or the content of the above template, and by replacing the above insertion fields included in the above API call commands with the data of the above print elements, including repeated replacement within the specified range, generates a print data generation API including a plurality of API call commands. A print API generation method characterized by the above.

Citation Information

Patent Citations

  • Information processing device and control method for information processing device

    JP7006096B2

Cited By

  • Print data generation device and print data generation method

    EP4579428A1