A method, device, printing equipment and medium for batch printing of similar entries

By mapping similar entries to be printed into text arrays and combining them with template data to generate pictures to be printed, the problems of inconvenient operation and inconsistent style positions in batch printing of similar entries in the prior art are solved, and the operation and consistency of style positions are achieved.

CN119739355APending Publication Date: 2025-04-01JINGCHEN SOFTWARE TECHNOLOGY (WUHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411728616.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art is inconvenient to operate when printing similar entries in batches, and it is prone to problems with inconsistent entries styles or positions.

Method used

By obtaining batch data to be printed, including the common attributes of the entry, the printing template and the same entries to be printed, it is mapped into text arrays and template data, and the pictures to be printed are generated and batch printed.

Benefits of technology

It realizes batch printing with convenient operation, ensuring consistency in entry style and position.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739355A_ABST
    Figure CN119739355A_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, printing equipment and medium for batch printing of similar entries, belonging to the field of document printing, and the method comprises: obtaining batch data to be printed, the batch data to be printed comprises common attributes of entries, a printing template and a number of similar entries to be printed; mapping the similar entries to be printed into a text array, mapping the common attributes of the entries and the printing template into template data; extracting text data from the text array, generating pictures to be printed according to the text data and the template data, and batch printing the pictures to be printed. The present invention maps the similar entries to be printed into a text array, and automatically generates pictures to be printed after combining the text data in the array with the template data in sequence, which is easy to operate and can ensure that the style and position of the entries remain consistent during the printing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of document printing, and in particular to a method, device, printing equipment and medium for batch printing of similar entries. Background Art

[0002] In the printing business of home scenarios or small B-end scenarios, there will be some demand for printing similar entries. For example, in home storage, for the switch stickers at home, it is necessary to print the power switch, entrance light, dining room light, ceiling light and balcony light at the same time. Or in the school opening season, for each student in the class, it is necessary to print name stickers containing their respective names and class information.

[0003] The existing traditional printing method for these similar entries usually requires editing and saving multiple templates on the drawing board, and then printing all the saved templates one by one. This operation is inconvenient and time-consuming, and there may be errors in manually editing each template, which may easily lead to inconsistent styles of entries on multiple templates or inconsistent positions of entries in each template.

[0004] Therefore, the prior art has the technical problems of inconvenient operation of batch printing of similar entries and prone to inconsistent entry styles or positions, which need to be improved. Summary of the invention

[0005] In view of this, it is necessary to provide a method, device, printing equipment and medium for batch printing of similar entries to solve the technical problems in the prior art that batch printing of similar entries is inconvenient and prone to inconsistent entry styles or positions.

[0006] In order to solve the above technical problems, on the one hand, the present invention provides a method for batch printing of similar entries, comprising: Obtaining batches of data to be printed, the batches of data to be printed including common attributes of entries, printing templates and a number of similar entries to be printed; Map the same type of entries to be printed into a text array, and map the common attributes of the entries and the printing template into template data; Extract text data from the text array, generate pictures to be printed according to the text data and template data, and print the pictures to be printed in batches.

[0007] In a possible implementation, the common attribute data includes at least one of entry position coordinates, font, font size, alignment, text width, and text height.

[0008] In a possible implementation, the entries of the same type to be printed use a carriage return as a separator, and the text attributes of the entries of the same type to be printed are set based on a preset protocol.

[0009] In a possible implementation, the same type of entries to be printed are mapped into a text array, including: An initial json array is constructed, and the same type of entries to be printed are segmented according to the delimiter and written into the initial json array in sequence to obtain a text array.

[0010] In a possible implementation, mapping the entry common attributes and the printing template into template data includes: According to the preset data mapping rules, data format mapping is performed on the common attributes of the entry and the printing template data to obtain the template data.

[0011] In a possible implementation, extracting text data from a text array and generating a to-be-printed image according to the text data and template data includes: Extract text data from the text array, and generate template data to be printed based on the text data and template data; The template data to be printed is analyzed based on preset data analysis rules to obtain the image to be printed.

[0012] In a possible implementation, printing the pictures to be printed in batches includes: The print quantity is determined according to the amount of text data in the text array, and the pictures to be printed are printed in sequence according to the print quantity.

[0013] On the other hand, the present invention also provides a device for batch printing of similar entries, comprising: A data acquisition unit, used for acquiring batches of data to be printed, the batches of data to be printed including common attributes of entries, a printing template and a number of entries of the same type to be printed; A data mapping unit, used for mapping the same type of entries to be printed into a text array, and mapping the common attributes of the entries and the printing template into template data; The batch printing unit is used to extract text data from the text array, generate pictures to be printed according to the text data and template data, and print the pictures to be printed in batches.

[0014] On the other hand, the present invention also provides a printing device, including a memory and a processor, wherein: Memory for storing computer programs; The processor is coupled to the memory and is used to execute the computer program to implement the steps in the above-mentioned method for batch printing of similar entries.

[0015] On the other hand, the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method for batch printing of similar entries are implemented.

[0016] The beneficial effects of the present invention are as follows: in the method for batch printing of similar entries provided by the present invention, firstly, batch data to be printed is obtained, and the batch data to be printed includes common attributes of entries, a printing template, and a number of similar entries to be printed; then, the similar entries to be printed are mapped to a text array, and the common attributes of the entries and the printing template are mapped to template data; finally, the text data of the text array is extracted, and pictures to be printed are generated according to the text data and the template data, and the pictures to be printed are batch printed. The present invention maps similar entries to be printed to a text array, and automatically generates pictures to be printed after combining the text data in the array with the template data in sequence, which is easy to operate and can ensure that the style and position of the entries remain consistent during the printing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for batch printing of similar entries provided by the present invention; Figure 2 This is a schematic diagram of batch input of similar entries according to an embodiment of the present invention; Figure 3 A schematic diagram of a process of generating a picture to be printed according to an embodiment of the present invention; Figure 4 A schematic diagram of the structure of an embodiment of a device for batch printing of similar entries provided by the present invention; Figure 5 A schematic structural diagram of an embodiment of a printing device provided by the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0020] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0021] The descriptions of "first" and "second" in the embodiments of the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0022] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0023] The present invention provides a method, device, printing equipment and medium for batch printing of similar entries, which are described below respectively.

[0024] Figure 1 A flow chart of an embodiment of a method for batch printing of similar entries provided by the present invention is shown as follows: Figure 1 As shown, the batch printing method of similar entries includes: S101, obtaining batch data to be printed, the batch data to be printed including common attributes of entries, a printing template and a number of similar entries to be printed; S102, mapping the same type of entries to be printed into a text array, and mapping the common attributes of the entries and the printing template into template data; S103, extracting text data from the text array, generating pictures to be printed according to the text data and template data, and printing the pictures to be printed in batches.

[0025] Compared with the prior art, in the method for batch printing of similar entries provided by the embodiment of the present invention, firstly, batch data to be printed is obtained, and the batch data to be printed includes common attributes of entries, a printing template, and a number of similar entries to be printed; then, the similar entries to be printed are mapped to a text array, and the common attributes of the entries and the printing template are mapped to template data; finally, the text data of the text array is extracted, and pictures to be printed are generated according to the text data and the template data, and the pictures to be printed are batch printed. The present invention maps similar entries to be printed to a text array, and automatically generates pictures to be printed after combining the text data in the array with the template data in sequence. The operation is convenient and the style and position of the entries can be kept consistent during the printing process.

[0026] In some embodiments of the present invention, the common attribute data includes at least one of entry position coordinates, font, font size, alignment, text width and text height.

[0027] In some embodiments of the present invention, the similar entries to be printed use carriage returns as separators, and the similar entries to be printed set text attributes based on a preset protocol.

[0028] Specifically, Figure 2 Schematic diagram of batch input of similar entries according to an embodiment of the present invention, such as Figure 2 As shown, in the process of generating similar entries to be printed, in order to facilitate batch input by users, the embodiment maps the label paper in the printer to the drawing board on the software, and the actual size of the label paper is also mapped to the logical size of the drawing board. Users can batch input multiple similar entries, and multiple similar entries share common attribute data such as the entry position coordinates, font, font size, alignment, text width and text height in the template. When each entry is mapped to the template, the common attributes remain unchanged, and only the specific text content is replaced according to the content of the input batch data to be printed.

[0029] In addition, when selecting the separator, considering that in some special cases, a single entry may contain commas, spaces or some other characters, in order to facilitate the user's habit of manually inputting the soft keyboard, the carriage return character is used as the separator. At the same time, using the carriage return character as the separator, the carriage return character can be mapped to an ASCII code during the processing process, which is convenient for program processing, and the carriage return character will not conflict with the normal characters entered by the user. However, it should be understood that in some other actual application scenarios, other separators can also be selected according to application requirements.

[0030] In addition, in order to distinguish between similar entries to be printed and ordinary text entries, the embodiment sets different text attributes for entry text and ordinary text according to a preset protocol. The respective text attributes can effectively distinguish between similar entries to be printed and ordinary text entries during the parsing process.

[0031] In some embodiments of the present invention, mapping the same type of words to be printed into a text array includes: Construct an initial json array, split the same type of words to be printed according to the delimiter, and write them into the initial json array in sequence to obtain a text array.

[0032] In some embodiments of the present invention, mapping the common attributes of entries and the printing template into template data includes: According to the preset data mapping rules, data format mapping is performed on the common attributes of the entry and the printing template data to obtain the template data.

[0033] Specifically, in order to stably and effectively process batch input of similar entries, the embodiment maps the content edited by the user on the drawing board to a json data model. In the embodiment, the json data model is divided into multiple fields for storing the information edited by the user on the drawing board.

[0034] Among them, for the same type of entries to be printed, the embodiment first divides them into multiple sub-entries according to the separator, and then adds a text data field in the text element field of the json data model to save the information of each sub-entry. The text data field is an array type. The embodiment saves the entry information by writing the same type of entries to be printed into the json array in sequence after the segmentation is completed, and parses them in sequence in the subsequent processing process to ensure that the same type of entries to be printed can be printed in sequence according to the order input by the user.

[0035] For other contents such as common attributes of entries and print templates, the embodiment maps common attributes of entries and print templates to corresponding fields respectively according to the preset data mapping rules of json fields, obtains template data, and completes the mapping of batch data to be printed to the json data model.

[0036] In some embodiments of the present invention, Figure 3 FIG. 1 is a flow chart of generating a picture to be printed according to an embodiment of the present invention. Figure 3 As shown, extract the text data of the text array, and generate the picture to be printed according to the text data and the template data, including: S301, extracting text data from a text array, and generating template data to be printed according to the text data and template data; S302: Analyze the template data to be printed based on preset data analysis rules to obtain a picture to be printed.

[0037] Specifically, the bottom layer of the image library in the embodiment adopts SKIA technology. SKIA is an open source 2D rendering engine developed in C++, which encapsulates APIs related to drawing on specific platforms. These APIs can be used to draw text, pictures, shapes, etc., and support Android, iOS and Windows platforms, with cross-platform characteristics. The embodiment extracts the text data in the text array and combines it with the template data to obtain the template data to be printed with the entry text, receives the template data to be printed in json format through the graphics library, parses each element field according to the agreed preset data parsing rules, and draws text, pictures or shapes on the canvas to generate a whole picture to be printed. Then the picture to be printed is sent to the module that controls the printing operation to complete the printing process.

[0038] In some embodiments of the present invention, printing the pictures to be printed in batches includes: The print quantity is determined according to the amount of text data in the text array, and the pictures to be printed are printed in sequence according to the print quantity.

[0039] Specifically, the embodiment controls the printing process of the printer through the printing SDK (Software Development Kit). During the printing process, the printing SDK provides a startJob interface to start the printing process. This interface will pass the count parameter to inform the printing SDK of the number of prints for this print, and the number of prints is determined according to the number of text data in the text array. At the same time, the printing SDK provides a callback onBufferFree to receive image data. Every time the printing SDK needs to send the printer image data, it notifies the software end to send the image data through this callback. Before the software end prints the entries in batches, the template with the entry text is first converted to generate a json data model with multiple entries. When performing the printing operation, the startJob interface of the printing SDK is called to pass in the total number of entries. Each time the onBufferFree callback is called, the image library interface is called for the current entry json data, and the image is generated and sent to the SDK, and finally sent to the printer through the printing SDK for printing. The effect of editing multiple entries at one time for batch printing is achieved.

[0040] In summary, in order to facilitate the user's batch printing operation, the style and position of the entries are kept consistent. The present invention first obtains a batch of data to be printed, which includes common attributes of entries, a printing template, and several similar entries to be printed; then the similar entries to be printed are mapped to a text array, and the common attributes of the entries and the printing template are mapped to template data; finally, the text data of the text array is extracted, and the pictures to be printed are generated according to the text data and the template data, and the pictures to be printed are batch printed. The present invention automatically generates pictures to be printed by mapping similar entries to be printed to a text array, and combining the text data in the array with the template data in sequence. The operation is convenient and can ensure that the style and position of the entries remain consistent during the printing process.

[0041] In order to better implement the batch printing method of similar entries in the embodiment of the present invention, based on the batch printing method of similar entries, correspondingly, Figure 4 As shown, the present invention also provides a device for batch printing of similar entries, and the device 400 for batch printing of similar entries includes: The data acquisition unit 401 is used to acquire batches of data to be printed, wherein the batches of data to be printed include common attributes of entries, a printing template, and a number of entries of the same type to be printed; A data mapping unit 402 is used to map the same type of entries to be printed into a text array, and map the common attributes of the entries and the printing template into template data; The batch printing unit 403 is used to extract text data from the text array, generate pictures to be printed according to the text data and template data, and print the pictures to be printed in batches.

[0042] The similar term batch printing device 400 provided in the above embodiment can implement the technical solution described in the above similar term batch printing method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above similar term batch printing method embodiment, which will not be repeated here.

[0043] like Figure 5 As shown, the present invention also provides a printing device 500. The printing device 500 includes a processor 501, a memory 502 and a display 503. Figure 5 Only some of the components of the printing device 500 are shown, but it should be understood that implementation of all of the shown components is not required, and more or fewer components may be implemented instead.

[0044] In some embodiments, the memory 502 may be an internal storage unit of the printing device 500, such as a hard disk or memory of the printing device 500. In other embodiments, the memory 502 may also be an external storage device of the printing device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the printing device 500.

[0045] In some embodiments, the processor 501 may be a central processing unit (CPU), a microprocessor or other data processing chip, which is used to run program codes or process data stored in the memory 502, such as the batch printing program of similar entries in the present invention.

[0046] The display 503 is used to display information on the printing device 500 and to display a visual user interface. The components 501-503 of the printing device 500 communicate with each other via a system bus.

[0047] In one embodiment, when the processor 501 executes the batch printing program of similar entries in the memory 502, the following steps may be implemented: Obtaining batches of data to be printed, the batches of data to be printed including common attributes of entries, printing templates and a number of similar entries to be printed; Map the same type of entries to be printed into a text array, and map the common attributes of the entries and the printing template into template data; Extract text data from the text array, generate pictures to be printed according to the text data and template data, and print the pictures to be printed in batches.

[0048] It should be understood that: when the processor 501 executes the batch printing program of similar entries in the memory 502, in addition to the above functions, other functions can also be realized. For details, please refer to the description of the corresponding method embodiment above.

[0049] Furthermore, the embodiment of the present invention does not specifically limit the type of the printing device 500 mentioned, and the printing device 500 may be a portable printing device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable printing devices include but are not limited to portable printing devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable printing device may also be other portable printing devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the printing device 500 may not be a portable printing device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0050] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the batch printing method of similar entries provided in the above-mentioned method embodiments.

[0051] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0052] The above is a detailed introduction to the batch printing method, device, printing equipment and storage medium of similar entries provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for batch printing of similar entries, characterized in that: include: Acquire a batch of data to be printed, wherein the batch of data to be printed includes common attributes of entries, a printing template, and a number of entries of the same type to be printed; Mapping the to-be-printed similar entries into a text array, and mapping the entry common attributes and the printing template into template data; The text data of the text array is extracted, pictures to be printed are generated according to the text data and the template data, and the pictures to be printed are printed in batches.

2. The method for batch printing of similar entries according to claim 1, characterized in that: The public attribute data includes at least one of entry position coordinates, font, font size, alignment, text width and text height.

3. The method for batch printing of similar entries according to claim 1, characterized in that: The similar entries to be printed use carriage returns as separators, and the similar entries to be printed set text attributes based on a preset protocol.

4. The method for batch printing of similar entries according to claim 3, characterized in that: The mapping of the to-be-printed similar entries into a text array includes: An initial json array is constructed, and the to-be-printed similar terms are segmented according to the separators and sequentially written into the initial json array to obtain a text array.

5. The method for batch printing of similar entries according to claim 1, characterized in that: The mapping of the common attributes of the entry and the printing template into template data includes: The template data is obtained by performing data format mapping on the common attributes of the entry and the printing template data according to a preset data mapping rule.

6. The method for batch printing of similar entries according to claim 1, characterized in that: The step of extracting text data from the text array and generating a picture to be printed according to the text data and the template data includes: Extracting text data from the text array, and generating template data to be printed according to the text data and the template data; The template data to be printed is analyzed based on preset data analysis rules to obtain the picture to be printed.

7. The method for batch printing of similar entries according to claim 1, characterized in that: The step of printing the pictures to be printed in batches comprises: The printing quantity is determined according to the quantity of text data in the text array, and the pictures to be printed are printed in sequence according to the printing quantity.

8. A device for batch printing of similar entries, characterized in that: include: A data acquisition unit, used for acquiring batches of data to be printed, wherein the batches of data to be printed include common attributes of entries, a printing template, and a number of entries of the same type to be printed; A data mapping unit, used for mapping the to-be-printed similar entries into a text array, and mapping the entry common attributes and the printing template into template data; The batch printing unit is used to extract the text data of the text array, generate the pictures to be printed according to the text data and the template data, and print the pictures to be printed in batches.

9. A printing device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store computer programs; The processor, coupled to the memory, is used to execute a computer program to implement the steps in the method for batch printing of similar entries as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method for batch printing of similar entries as described in any one of claims 1 to 7 are implemented.