This application claims priority of Japanese Patent Application No. 2023-220247 filed
on Dec. 27, 2023. The contents of this application are incorporated herein by reference in their entirety.
The present invention relates to a print data generation device, a print data generation method, a print API generation device, and a print API generation method. More specifically, the present invention is suitable for use in a device and a method for generating print data used for merge printing, and a device and a method for generating a print data generation API.
In a known conventional system that executes printing by transmitting print data of a receipt to a printer from a POS terminal, print data including commands for character styling, paper cutting, and so on are transmitted together with print instructions (see Japanese Patent No. 7006096). FIG. 4 of Japanese Patent No. 7006096 shows print data including a plurality of text string print-related command groups constituted by combinations of text string print instruction commands, which include dedicated command code and text string information, and text string styling commands. The printer converts the text code included in the text string printing instruction command of each text string print-related command group into corresponding font data, and then executes printing after applying the styling instructed by the text string styling command.
Furthermore, conventionally, a print data generation API (Application Programming Interface) that can be called from each programming language is provided to facilitate control of a printer from upper-level software of a POS terminal, and print data including the commands described above are generated by the print data generation API. When the print data generation API is used to generate print data including a plurality of commands corresponding to print elements (the item parts of a receipt, for example) having a variable number of elements, as shown in FIG. 4 of Japanese Patent No. 7006096, the number of elements is acquired on the side of an application that calls the print data generation API from field data in which information about the text strings to be printed is recorded, and the print data are generated by repeatedly executing the print data generation API a number of times corresponding to the number of elements.
However, when the print data generation API is repeatedly executed a plurality of times, description of loops, conditional branches, and so on must be incorporated into the program code of the application that calls the print data generation API, leading to a problem in that the code becomes unintuitive and difficult to understand.
The present invention has been designed to solve this problem, and an object thereof is to make it possible to execute merge printing by generating print data having a variable number of print elements without incorporating description required in order to repeatedly call a print data generation API in the program code of an application serving as the call source.
To solve the problem described above, in the present invention, print data including a plurality of print-related commands are generated using a template and field data including data of print elements to be inserted into merge 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 constituted by commands of the smallest unit not including repetitions, the number of which corresponds to the number of print elements, which is variable. A print data generation API including a plurality of API call commands is generated by specifying a range of API call commands for repeatedly executing processing a number of times corresponding to the variable number of print elements from the template on the basis of the content of both the template and the field data or the content of the template, and replacing merge fields included in the API call commands, including repeat substitutions within the specified range, with the data of the print elements, whereupon print data including print-related commands into which the data of the print elements have been inserted are generated by executing the generated print data generation API.
According to the present invention, configured as described above, on the basis of a template in which one or more API call commands are constituted by commands of the smallest unit not including repetitions, a print data generation API written such that the API call commands are executed repeatedly a number of times corresponding to the variable number of print elements is generated, whereupon print data are generated by executing the print data generation API. The print data can thus be generated by executing the plurality of API call commands included in the generated print data generation API in order. As a result, it is possible to execute merge printing by generating print data having a variable number of print elements without incorporating description required in order to repeatedly call a print data generation API in the program code of an application serving as the call source.
An embodiment of the present invention will be described below on the basis of the figures.
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 through a wireless communication network such as Bluetooth (registered trademark), Wi-Fi (registered trademark), or a wireless LAN. Alternatively, the host device 10 and the printer 20 may be connected through a communication network such as the Internet.
The control unit 101 of the host device 10 is constituted by a microcomputer including a CPU, a RAM, a ROM, and so on, for example, and operates in accordance with an operating system and other programs stored in the storage unit 102 so as to execute information processing using various data stored in the storage unit 102. The control unit 101 may include a DSP (Digital Signal Processor) and so on in addition to the microcomputer.
The storage unit 102 is constituted by a computer-readable storage medium. For example, the storage unit 102 is configured to include a ROM, a RAM, a hard disk, a semiconductor memory, or the like. The storage unit 102 stores various programs executed by the control unit 101. The various programs include an application program for generating field data to be inserted into merge fields when executing merge printing, a print data generation program for generating print data using the field data, and so on. The field data are data including data of one or more print elements, and the number of print elements included in the field data (the number of print elements, or in other words the number of elements of the merge printing) is variable.
The storage unit 102 also stores various data including data used in the processing of the control unit 101 and data generated in the course of the processing. The various data include a template and field data used when generating the print data, a print data generation API (also referred to as a substitute template) generated by inserting the field data into merge fields included in the template, print data having a command structure generated by executing the print data generation API, and so on. The template and the field data will be described in detail below.
The input unit 103 is constituted by a keyboard, a mouse, a touch panel, or the like, for example, and inputs data corresponding to operation input by a user into the control unit 101. The display unit 104 is constituted by a liquid crystal display or the like, for example, and displays information in response to instructions input from the control unit 101. The I/F 105 is constituted by a communication module that exchanges data with the printer 20, and outputs various data to the printer 20 in response to instructions input from the control unit 101.
In this embodiment, data to be printed, which are generated by the application program in the storage unit 102 on the basis of the control of the control unit 101, are converted into print data having a command structure that can be understood by the printer 20, whereupon the converted print data are output to the printer 20 from the I/F 105. When executing merge printing, the control unit 101 uses the template and the field data to generate print data including a plurality of print-related commands. For example, print data of a receipt, which includes names, prices, and so on of purchased items as print elements having a variable number of elements, are generated by the host device 10, whereupon the receipt is printed by the printer 20 on the basis of the generated print data.
The control unit 201 of the printer 20 is constituted by a microcomputer including a CPU, a RAM, a ROM, and so on, for example, and performs overall control of the printer 20 in accordance with a program stored in the storage unit 202. The control unit 201 may include a DSP and so on in addition to the microcomputer. The storage unit 202 is configured to include a ROM, a RAM, a semiconductor memory, or the like, and stores various programs and data required for executing printing.
The I/F 203 is constituted by a communication module that exchanges data with the host device 10, and receives print data transmitted from the host device 10 and outputs the received print data to the control unit 201. The printing unit 204 executes printing under the control of the control unit 201 in accordance with print-related commands indicated by the print data transmitted from the host device 10, and thereby forms an image based on the print data on a recording medium such as a printing sheet.
The field data generation unit 13 generates field data including data of print elements to be inserted into merge fields of a template stored in the template storage unit 14 in response to an operation of the application program stored in the storage unit 102. The field data generated by the field data generation unit 13 are stored in the field data storage unit 15.
Each print element is constituted by a combination of an item name and an insertion value (a text string, a numeric string, a combination thereof, or the like) to be inserted into the merge field. As shown in
The template storage unit 14 stores a template that is used to generate print data using field data. The template includes a plurality of API call commands for generating print-related commands. The print-related commands include commands instructing printing (referred to hereinafter as print instruction commands) and a command instructing styling (referred to hereinafter as styling instruction commands).
The API call commands are commands instructing call-up of an API library configured to generate print-related commands. As shown in
The print instruction API call commands include commands including a substitution rule for inserting a print element into a merge field, and commands not including the substitution rule. The print instruction API call commands that include the substitution rule include cases in which array element data are inserted into a merge field in accordance with the substitution rule and cases in which single element data are inserted into a merge field in accordance with the substitution rule. The styling instruction API call commands, meanwhile, do not include the substitution rule.
The plurality of API call commands included in the template are constituted by a group of commands of the smallest unit not including repetitions, the number of which corresponds to the variable number of print elements. A group of commands of the smallest unit not including repetitions means that for the print instruction API call commands including the substitution rule, the command group does not include a number API call commands corresponding to the number of elements in the array elements, even in the case of array elements for which a plurality of insertion values are repeatedly inserted.
The print API generation unit 11 generates a print data generation API (a substitute template) including a plurality of API call commands by specifying, on the basis of the content of both the template and the field data or the content of the template, a range (occasionally abbreviated to “repeat range” in the following description) of API call commands for repeatedly executing processing a number of times corresponding to the variable number of print elements from among the plurality of API call commands included in the template, and replacing the merge fields included in the API call commands, including repeat substitutions in the specified range, with the data of the print elements.
The print data generation unit 12 then generates print data including print-related commands into which the data of the print elements have been inserted by executing the print data generation API generated by the print API generation unit 11. More specifically, the print data generation unit 12 calls an API library configured to generate print-related commands in accordance with the plurality of API call commands included in the print data generation API, and generates print data including a plurality of print-related commands by executing processing prescribed by the API library. The generated print data are then output to the printer 20.
Three embodiments relating to the processing of the print API generation unit 11 will be described below. In a first embodiment, the repeat range of the API call commands is specified on the basis of the content of the template. In second and third embodiments, the repeat range of the API call commands is specified on the basis of the content of both the template and the field data.
In the first embodiment, the template has a hierarchical structure of a plurality of API call commands and also includes a repeat start flag on one of the layers of the hierarchy. The print API generation unit 11 specifies the repeat range on the basis of the repeat start flag and the hierarchical structure. The hierarchical structure is a typical structure used to specify a range in which to apply text styling in a print data generation API. More specifically, in the print data generation API, text styling specified by a styling instruction API call command on a certain layer of the hierarchy is applied to the relevant layer and layers therebelow, but is not applied to layers thereabove. In the first embodiment, this mechanism is used to specify the repeat range.
Section (A) of
In the example of
As shown in section (A) of
The print API generation unit 11 generates the print data generation API (the substitute template) by replacing the merge fields of the plurality of print instruction API call commands included in the template with the data (the insertion values) of the print elements included in the field data. At this time, as shown in section (B) of
As shown in section (A) of
More specifically, the merge field “${store_name}” of the print instruction API call command of the first layer shown in section (A) of
The API call commands including the array element substitution rule and the styling instruction API call commands associated therewith must be executed repeatedly in accordance with the number of array elements, but in this embodiment, the print data generation API is generated by copying the API call commands in the required number. Therefore, in the call source application (the print data generation program), the plurality of API call commands included in the generated print data generation API shown in section (B) of
In the example of the print data generation API shown in section (B) of
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 on the basis of both the types of the API call commands included in the template and the field data.
Section (A) of
As shown in section (A) of
In the template shown in section (A) of
The API call command with the index IDX3 is a print instruction API call command, and by referring to the field data using the text string “items.name” of the merge field as a key, it is determined that the print element corresponding to the text string “items.name” is an array element AE. Accordingly, the print API generation unit 11 determines that the API call command with the index IDX3 is a print instruction API call command including the substitution rule for the array elements AE, and starts to search for the repeat range RR using this position as a start point.
The API call commands with the indexes IDX4, IDX5, and IDX7 following the index IDX3 are styling instruction API call commands. Furthermore, the API call command with the index IDX6 is a print instruction API call command, and by referring to the field data using the text string “items.price” of the merge field as a key, it is determined that the print element corresponding to the text string “items.price” is an array element AE. Accordingly, the print API generation unit 11 determines that the API call commands with the indexes IDX4 to IDX7 are within the repeat range RR but that none thereof denote the end position of the repeat range RR.
The API call command with the index IDX8 is a print instruction API call command, but the text string “Thank you” is not surrounded by the substitution rule “${ }”. Accordingly, the print API generation unit 11 determines that the API call command with the index IDX8 is a print instruction API call command not including the substitution rule for the array elements AE, and therefore identifies the immediately preceding API call command with the index IDX7 as the end position of the repeat range RR.
The print API generation unit 11 then generates a print data generation API (a substitute template) by replacing the merge fields of the plurality of print instruction API call commands included in the template with the data (the insertion values) of the print elements included in the field data. At this time, as shown in section (B) of
First, the print API generation unit 11 initializes the value of a repeat start index IDXS, which is used as a parameter, to “−1” (step S1). Next, the print API generation unit 11 determines whether or not a following API call command exists in the template (step S2), and when no following command exists, the processing of the flowcharts shown in
When a following API call command exists, the print API generation unit 11 acquires the following API call command from the template (step S3) and determines whether or not the current value of the repeat start index IDXS is “−1” (step S4). When the value of the repeat start index IDXS is “−1”, the print API generation unit 11 determines whether or not the API call command acquired in step S3 includes the array element substitution rule (step S5).
When the API call command does not include the array element substitution rule, the print API generation unit 11 determines whether or not the API call command includes the single element substitution rule (step S6). When the API call command includes the single element substitution rule, the print API generation unit 11 acquires the data of the single element specified by the substitution rule from the field data, and replaces the merge field of the API call command with the acquired data of the single element (step S7). The API call command is then added to the substitute template (step S8).
When, on the other hand, it is determined in step S6 that the API call command does not include the single element substitution rule, the processing of step S7 is skipped, and the API call command acquired in step S3 is added as is to the substitute template (step S8). Following the processing of step S8, the processing returns to step S2, where, if a following API call command exists, the following API call command is acquired (step S3).
At the stage where the API call commands with the indexes IDX0 and IDX2 shown in section (A) of
When it is determined in step S5 that the API call command includes the array element substitution rule, the value of the repeat start index IDXS is updated to the current value of the index IDXi of the API call command (step S9). The processing then returns to step S2. At the stage where the API call command with the index IDX3 has been acquired in step S3, it is determined that the API call command includes the array element substitution rule, and therefore the value of the repeat start index IDXS is updated to the index IDX3. The index IDX3denotes the start position of the search for the repeat range RR.
When the value of the repeat start index IDXS is updated, it is determined in step S4 after returning to step S2 that the value of the repeat start index IDXS is not “−1”. In this case, the print API generation unit 11 determines whether or not the API call command acquired in step S3 is a print instruction command that does not include the array element substitution rule (step S10). Here, when it is determined that the API call command is not a print instruction command that does not include the array element substitution rule, the processing returns to step S2. At the stage where the API call commands with the indexes IDX4 to IDX7 have been acquired in step S3, No is acquired in the determination of step S10.
When, on the other hand, it is determined in step S10 that the API call command is a print instruction command that does not include the array element substitution rule, the print API generation unit 11 extracts the API call commands to be subjected to repeat substitution, indicated hereafter, from the template (step S11): the styling instruction API call commands included from the start of the template up to a point one before the repeat start index IDXS; and all of the API call commands included from the repeat start index IDXS to a point one before the current index IDXi.
In the example of section (A) of
Next, the print API generation unit 11 copies the plurality of API call commands acquired in the step S11 until the number of copies is identical to the number of array elements included in the field data, and then repeatedly executes processing for replacing the merge fields of the print instruction API call commands with the data of the array elements a number of times corresponding to the number of array elements. The executed plurality of API call commands are then added to the substitute template (step S12). As a result of the stages up to this point, the substitute template is configured as shown in section (B) of
Next, the print API generation unit 11 determines whether or not the API call command with the index IDX8, acquired in step S3, includes the single element substitution rule (step S13). When the API call command includes the single element substitution rule, the print API generation unit 11 acquires the data of the single element specified by the substitution rule from the field data, and replaces the merge field of the API call command with the acquired single element data (step S14). The API call command is then added to the substitute template (step S15).
When, on the other hand, the API call command does not include the single element substitution rule, the processing of step S14 is skipped and the API call command acquired in step S3 is added as is to the substitute template (step S15). By executing the processing of step S15, the substitute template enters the state of section (B) of
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 on the basis of both the types of the API call commands included in the template and the field data, and also the hierarchical structure of the API call commands.
As shown in section (A) of
In the template shown in section (A) of
The print API generation unit 11 then generates a print data API (a substitute template) by replacing the merge fields of the plurality of print instruction API call commands included in the template with the data (the insertion values) of the print elements included in the field data. At this time, as shown in section (B) of
API shown in section (B) of
First, the print API generation unit 11 initializes the value of the range search underway flag RF to “No” (step S21). Next, the print API generation unit 11 determines whether or not a following API call command exists in the template (step S22), and when no following command exists, the processing of the flowcharts shown in
When a following API call command exists, the print API generation unit 11 acquires the following API call command from the template (step S23) and determines whether or not the current value of the range search underway flag RF is “No” (step S24). When the value of the range search underway flag RF is “No”, the print API generation unit 11 determines whether or not the API call command acquired in step S23 includes the array element substitution rule (step S25).
When the API call command does not include the array element substitution rule, the print API generation unit 11 determines whether or not the API call command includes the single element substitution rule (step S26). When the API call command includes the single element substitution rule, the print API generation unit 11 acquires the data of the single element specified by the substitution rule from the field data, and replaces the merge field of the API call command with the acquired data of the single element (step S27). The API call command is then added to the substitute template (step S28). At this time, if there is a hierarchy control function associated with the API call command, the hierarchy control function is added to the substitute template together therewith.
When, on the other hand, it is determined in step S26 that the API call command does not include the single element substitution rule, the processing of step S27 is skipped, and the API call command acquired in step S23 is added as is to the substitute template (step S28). At this time, if there is a hierarchy control function associated with the API call command, the hierarchy control function is added to the substitute template together therewith. Following the processing of step S28, the processing returns to step S22, where, if a following API call command exists, the following API call command is acquired (step S23).
At the stage where the API call commands with the indexes IDX0 and IDX2 shown in section (A) of
When it is determined in step S25 that the API call command includes the array element substitution rule, the value of the range search underway flag RF is updated to “Yes”, and the uppermost layer variable AP is set at the value of the current layer of the API call command (step S29). The processing then returns to step S22. At the stage where the API call command with the index IDX3 has been acquired in step S23, it is determined that the API call command includes the array element substitution rule, and therefore the value of the range search underway flag RF is updated to “Yes”, and the value “3” indicating the third layer is set as the value of the uppermost layer variable AP.
When the value of the range search underway flag RF is updated to “Yes”, it is determined in step S24 after returning to step S22 that the value of the range search underway flag RF is not “No”. In this case, the print API generation unit 11 determines whether or not the API call command acquired in step S23 is a print instruction command (step S30). Here, when it is determined that the API call command is not a print instruction command, the print API generation unit 11 adds the API call command acquired in step S23 as is to the substitute template (step S31). At this time, if there is a hierarchy control function associated with the API call command, the hierarchy control function is added to the substitute template together therewith. As a result of the stages up to acquisition of the API call command with the index IDX4, the substitute template is configured as shown in section (B) of
Next, the print API generation unit 11 determines whether or not the value of the current layer is smaller than the value of the uppermost layer variable AP (step S32). When the value of the current layer is smaller, the value of the uppermost layer variable AP is updated to the value of the current layer (step S33). The processing then returns to step S22. When, on the other hand, the value of the current layer is not smaller than the value of the uppermost layer variable AP, the processing of step S33 is skipped and the processing returns to step S22. At the stage where the API call command with the index IDX4 has been acquired in step S23, the processing of step S33 is executed so as to update the value of the uppermost layer variable AP to the value “2” of the current layer.
When it is determined in step S30 that the API call command acquired in step S23 is a print instruction command, the print API generation unit 11 then determines whether or not the print instruction API call command includes the array element substitution rule (step S34). Here, when it is determined that the command includes the array element substitution rule, the processing advances to step S32. At the stage where the API call command with the index IDX5 has been acquired in step S23, since the command includes the array element substitution rule, the processing advances to step S32. In this case, the value of the current layer is not smaller than the value of the uppermost layer variable AP, and therefore the processing of step S33 is skipped and the processing returns to step S22.
When, on the other hand, it is determined in step S34 that the command does not include the array element substitution rule, the print API generation unit 11 extracts the API call commands of the repeat substitution subjects and the associated hierarchy control functions from the template (step S35). In the third embodiment, the styling instruction API call commands and the print instruction API call commands including the array element substitution rule, among the API call commands included on the uppermost layer, indicated by the uppermost layer variable AP, and the layers therebelow, as well as the hierarchy control functions associated therewith are extracted from the template. In the example of section (A) of
Next, the print API generation unit 11 copies the plurality of API call commands and hierarchy control functions acquired in step S35 until the number of copies is identical to the number of array elements included in the field data, and then repeatedly executes processing for replacing the merge fields of the print instruction API call commands with the data of the array elements a number of times corresponding to the number of array elements. The executed plurality of API call commands and the hierarchy control functions are then added to the substitute template (step S36). As a result of the stages up to this point, the substitute template is configured as shown in section (C) of
Next, the print API generation unit 11 determines whether or not the API call command with the index IDX6, acquired in step S23, includes the single element substitution rule (step S37). When the API call command includes the single element substitution rule, the print API generation unit 11 acquires the data of the single element specified by the substitution rule from the field data, and replaces the merge field of the API call command with the acquired data of the single element (step S38). The API call command is then added to the substitute template (step S39). At this time, if there is a hierarchy control function associated with the API call command, the hierarchy control function is added to the substitute template together therewith.
When, on the other hand, the API call command does not include the single element substitution rule, the processing of step S38 is skipped, and the API call command acquired in step S23 is added as is to the substitute template (step S39). At this time, if there is a hierarchy control function associated with the API call command, the hierarchy control function is added to the substitute template together therewith. By executing the processing of step S39, the substitute template enters the state shown in section (B) of
In this embodiment, as described in detail above, print data including a plurality of print-related commands are generated using a template and field data including data of print elements to be inserted into merge fields of API call commands included in the template. In the template, the plurality of API call commands are constituted by a group of commands of the smallest unit not including repetitions, the number of which corresponds to the number of print elements, which is variable. A print data generation API including a plurality of API call commands is then generated by specifying the repeat range RR from among the plurality of API call commands included in the template, and replacing the merge fields included in the API call commands, including repeat substitutions within the specified range, with the data of the print elements, whereupon print data including print-related commands into which the data of the print elements have been inserted is generated by executing the generated print data generation API.
According to this embodiment, configured as described above, the print data generation API is generated by copying the print instruction API call commands including the array element substitution rule and the styling instruction API call commands associated therewith in the required number in accordance with the number of array elements, and then inserting the data of the array elements into the merge fields, whereupon the print data are generated by executing the print data generation API. In the call source application (the print data generation program), therefore, the API call commands included in the generated print data generation API need only be executed once each in order from the start. Thus, print data with a variable number of print elements can be generated and merge printing can be executed without incorporating description required in order to repeatedly call the API call commands in the program code of the call source application. As a result, the readability of the program code of the application serving as the API call source can be improved.
Note that in the first embodiment described above, the repeat start flag SF may be set in a plurality of locations within the template. For example, when merge printing is performed by disposing a print element with a fixed number of elements after a print element with a variable number of elements and disposing a print element with a variable number of elements thereafter, the repeat start flag SF can be set in two locations corresponding respectively to the first print element with a variable number of elements and the next print elements with a variable number of elements.
Furthermore, in the second and third embodiments described above, examples in which the repeat range RR is specified on the basis of both the types of the API call commands and the field data were described, but the repeat range RR may be specified without referring to the field data. For example, the types of the API call commands may be determined on the basis of the text strings of the API call commands, and the repeat range RR may be specified on the basis of the types of the API call commands. In this case, associations indicating which text strings correspond to which types of API call commands are defined in advance, whereupon a template and a program that references the template are created in accordance with the definitions.
Moreover, in the third embodiment described above, an example in which the repeat range RR is specified by extracting from the template the styling instruction API call commands and the print instruction API call commands including the array element substitution rule, among the API call commands included on the uppermost layer, indicated by the uppermost layer variable AP, and the layers therebelow. In other words, of the API call commands included in the layer including the repeat start flag SF and the layers therebelow, the styling instruction API call commands and the print instruction API call commands including the array element substitution rule may be specified as the repeat range RR.
Furthermore, in the first to third embodiments described above, configurations in which the template includes a plurality of API call commands were described, but the template may be configured to include only one API call command. In this case, for example, the print API generation unit 11 determines whether or not the API call command included in the template is a print instruction API call command including the substitution rule for repeated array elements, and having determined that the API call command is a print instruction API call command including the array element substitution rule, specifies the command as the API call command repeat range.
Note that in the first to third embodiments described above, the format of the substituted text strings may be specified in accordance with a substitution rule for the API call commands included in the template. For example, the merge field for the substitution rule that starts with the symbol ${ and ends with the symbol } may be configured as shown below (the symbols “ ” and + are explanatory and are not actually written), thereby making it possible to specify a representation or a layout of the text string when the field data are inserted into the merge field in accordance with the content of a format specifier.
“${“+“key”+“format specifier”+“}”
The following specifiers, for example, can be used as the format specifier.
(A) Format specifier for numerical field data
(B) Format specifier specifying the number of characters
Thus, when the field data are a numerical value, for example, the text string obtained when the numerical value is inserted into the merge field of the template can be controlled. For example, when the field data are pi 3.14159265359, it is possible to specify whether the value will be printed on the template as “3”, “3.14”, or “3.14159265359”. Furthermore, when the width of the printing sheet is narrow such that there is a limit on the number of characters that fit on one line, it is possible, by means of template specification, to avoid an unintended line break where the text string of the field data is too long to fit on one line and the printed text extends onto the next line.
A specific example is described below. Here, an example in which the printing sheet is a receipt and a text string including a list of items is printed will be described. The number of characters that can be printed on one line of the receipt is 32, making it necessary to keep the number of characters of one line of the print data to within 32 characters. In this case, a template that has been subjected to format specification, as shown in section (A) of
On the template shown in section (A) of
When the template of section (A) of
In addition, all of the embodiments described above merely illustrate specific examples of implementation of the present invention, and the technical scope of the present invention is not to be interpreted as being limited thereby. In other words, the present invention can be implemented in various forms without deviating from the spirit or the main features thereof.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2023-220247 | Dec 2023 | JP | national |