A label printing method and apparatus
By using a B/S architecture for label printing, the problems of style misalignment and font loss in existing technologies are solved. It enables simple operation and multi-template printing without the need for software installation, improving user autonomy and printing efficiency, and supporting seamless template sharing and compatibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGSU BONSS MEDICAL TECH
- Filing Date
- 2025-03-24
- Publication Date
- 2026-07-14
AI Technical Summary
Existing label printing methods suffer from issues such as misaligned styles, missing fonts, and abnormal sizes, and cannot meet the need to print the same set of label data using multiple templates simultaneously.
The label printing method, which adopts a B/S architecture, receives print requests through a browser, sends print setting instructions, including print template selection, and fills the print template with label data. It converts the data into a format that the printer can recognize, supports a multi-stage conversion engine to ensure print quality, and enables seamless template sharing and automatic control.
It enables simple label printing without the need for software installation, avoids style misalignment and font loss, supports multiple template printing, improves user autonomy and printing efficiency, and achieves seamless template sharing and compatibility.
Smart Images

Figure CN120491913B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of computer technology, and specifically relates to a label printing method and apparatus. Background Technology
[0002] Label printing is frequently required in enterprise production activities. Currently, the common approach for label printing is a client / server (C / S) architecture, which requires the installation of specialized software (such as Bartender) on the client side. While this architecture offers a wealth of template designs, it suffers from poor user autonomy and flexibility. Specifically, it involves complex operation, making it difficult for users without design experience to quickly learn how to use it. Furthermore, each print job requires manually modifying the label data in the template to match the next set of labels to be printed, which is extremely inconvenient for production activities that require printing large quantities of labels.
[0003] Currently, label printing methods using a B / S (Browser / Server) architecture also exist. In this architecture, users access the system through a browser, eliminating the need for client installation and maintenance. Due to its wide applicability, strong interactivity, and high system maintainability, it is gradually becoming the preferred architecture for enterprise information systems. However, in practical applications, printed labels suffer from issues such as misaligned styles, missing fonts, and abnormal sizes. Furthermore, during production, the same set of label data may require printing using multiple templates simultaneously, but existing label printing methods cannot meet this requirement. Summary of the Invention
[0004] The purpose of this invention is to address the aforementioned shortcomings in the prior art by providing a label printing method and apparatus to solve the problems of misaligned styles, missing fonts, and abnormal sizes in existing label printing.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] Firstly, a label printing method is provided, applied to a server, the method comprising:
[0007] The system receives a label printing request from a browser and sends a print settings instruction to the browser. The print settings instruction includes print option settings instructions for at least one printer, and each print option settings instruction includes at least a print template selection instruction.
[0008] Receive a print option setting request for at least one printer sent by the browser, fill the label data to be printed into the corresponding print template, and form at least one print object;
[0009] Convert the format of at least one of the printed objects into a printer-recognizable format to form at least one print instruction;
[0010] At least one of the print instructions is sent to at least one corresponding printer to print at least one label data.
[0011] Furthermore, the format of the printable object is HTML format, and converting the format of at least one of the printable objects into a printer-recognizable format includes:
[0012] Convert the HTML format of a printed object to PDF format;
[0013] Convert PDF printable objects to PNG images;
[0014] The PNG image is binarized.
[0015] Convert the binarized PNG image into ZPL instructions.
[0016] Furthermore, each print option setting instruction also includes a print interval setting instruction, a print round setting instruction, and a print count setting instruction, so as to provide setting functions for print interval, print round, and print count on the browser, respectively.
[0017] Furthermore, after sending at least one of the print instructions to at least one corresponding printer to print at least one label data, the method further includes:
[0018] Receive print record information from at least one printer and generate a print log based on the print record information.
[0019] Furthermore, the methods also include:
[0020] In response to receiving a request from the browser to save print option settings for at least one printer, the print option settings data for at least one printer are saved.
[0021] Secondly, a label printing method is provided for use in a terminal device, the method comprising:
[0022] In response to a user-triggered label printing action, a label printing request is sent from the browser to the server.
[0023] Receive print setting instructions sent by the server, wherein the print setting instructions include print option setting instructions for at least one printer, and each print option setting instruction includes at least a print template selection instruction;
[0024] Receive a user-triggered print option setting action for at least one printer, wherein the print option setting action includes at least selecting a print template;
[0025] Send a request to the server for printing option settings for at least one printer.
[0026] Furthermore, it also includes:
[0027] Receive user-triggered actions to save print option settings for at least one printer;
[0028] Send a request to the server to save the printing option settings for at least one printer.
[0029] Furthermore, before sending a label printing request to the server via the browser in response to a user-triggered label printing action, the method further includes:
[0030] Receive user-triggered actions to process tag data, and process the tag data, including:
[0031] Add, delete, modify, view, import, or export tag data.
[0032] Furthermore, in sending a request to the server for printing option settings for at least one printer, the method also includes:
[0033] Receive user-triggered actions to process print templates, and process the print templates, including:
[0034] Add, delete, modify, or reset print templates.
[0035] Furthermore, new print templates have been added, including:
[0036] Upon receiving a user-triggered action to add a new print template, the system jumps to the template design module, where the target print template is designed.
[0037] Thirdly, a label printing apparatus is provided for use in a server, the apparatus comprising:
[0038] The first instruction sending module is used to receive a label printing request sent by the browser and send a print setting instruction to the browser. The print setting instruction includes a print option setting instruction for at least one printer, and each print option setting instruction includes at least a print template selection instruction.
[0039] The request receiving and print object forming module is used to receive the print option setting request sent by the browser for at least one printer, fill the label data to be printed into the corresponding print template, and form at least one print object;
[0040] A format conversion module is used to convert the format of at least one of the printed objects into a printer-recognizable format to form at least one print instruction;
[0041] The second instruction sending module is used to send at least one of the printing instructions to at least one corresponding printer to print at least one label data.
[0042] Fourthly, a label printing apparatus, applied to a terminal device, the apparatus comprising:
[0043] The first request sending module is used to respond to the label printing action triggered by the user and send a label printing request to the server through the browser;
[0044] The first instruction receiving module is used to receive print setting instructions sent by the server. The print setting instructions include print option setting instructions for at least one printer, and each print option setting instruction includes at least a print template selection instruction.
[0045] The second instruction receiving module is used to receive a print option setting action triggered by a user for at least one printer, wherein the print option setting action includes at least selecting a print template;
[0046] The second request sending module is used to send a print option setting request for at least one printer to the server.
[0047] The label printing method and apparatus provided by this invention have the following beneficial effects:
[0048] 1. This invention employs a B / S (Browser / Server) architecture for label printing, allowing users to create label templates directly on a webpage using a browser without installing any software or plugins. The operation is simple; during printing, users only need to select the print template and choose the corresponding data. Furthermore, based on the label template created on the webpage (browser), users can manually set the fields for data replacement in the label template. During printing, the label data is automatically filled into the template according to the corresponding fields. Additionally, by setting a multi-stage conversion engine, the template is printed strictly according to printer compatibility rules, completely avoiding problems such as misaligned styles, missing fonts, and abnormal sizes in the printed labels.
[0049] 2. In this invention, whether printing PDFs, images, or documents, the Zebra printer ultimately converts them into ZPL instructions and sends the data to the printer via the network. Although existing technologies can automatically convert them, the results after conversion can have significant deviations. Therefore, this invention can precisely control the printing range, printing quality, and paper size by automatically converting ZPL instructions, thus eliminating misalignment issues.
[0050] 3. Improved user efficiency: The traditional manual control of printing quantity, printing interval, and printing rounds is transformed into automatic control.
[0051] 4. Enhanced scalability: Supports the simultaneous filling of the same set of label data into multiple templates for printing, which can improve printing efficiency.
[0052] 5. Enhanced user autonomy: Users can design templates directly through the web interface without relying on Bartender.
[0053] 6. Enhanced Sharing and Collaboration: This invention enables seamless sharing of printing templates, avoiding the tedious process of repetitive design and configuration. Seamless sharing means that once a label template for a product is designed within the UMS system, other personnel can use it after logging into the system without needing to import or redesign the template.
[0054] 7. Improved compatibility: Templates can be designed and labels printed on any device that can access a webpage; no software or plugins need to be installed to use it. Attached Figure Description
[0055] Figure 1 This is a system block diagram of the label printing method of the present invention.
[0056] Figure 2 This is a block diagram of the label printing subsystem of the present invention.
[0057] Figure 3 This is a block diagram of the server components of the present invention.
[0058] Figure 4 This is a flowchart of a label printing method applied to a server according to the present invention.
[0059] Figure 5 This is a flowchart of a label printing method for applying the present invention to a terminal device. Detailed Implementation
[0060] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0061] This embodiment requires no software or plugins and is easy to operate. By setting up a multi-stage conversion engine, the template can be printed strictly according to the rules adapted to the printer, which can completely avoid problems such as misaligned styles, missing fonts, and abnormal sizes in the printed labels.
[0062] refer to Figure 1 This embodiment provides a system architecture for label printing methods and apparatus to help those skilled in the art understand the technical content of this specification, but it does not mean that the embodiments of this specification cannot be used in other devices, systems, environments or scenarios.
[0063] refer to Figure 1 This is a schematic diagram of a system architecture provided by the present invention, which specifically includes a terminal device, a printer, and a server;
[0064] Among them, terminal equipment;
[0065] The terminal device is used by the user to select a label to print in the browser and then sends that selection to the server.
[0066] Specifically, the terminal device in this embodiment can be a fixed device or a mobile terminal device. Any form of browser exists on the terminal device. In specific operation, the corresponding label printing selection made by the user in the browser is sent to the server through the network (e.g., using the TCP communication protocol). The server runs and returns the corresponding result. The server sends the corresponding printing instruction to the printer through the network, and the printer executes the label printing task.
[0067] To facilitate users' selection and settings related to label printing on their terminal devices, this implementation includes a label printing subsystem in the browser.
[0068] As a preferred embodiment, refer to Figure 2 The label printing subsystem specifically includes:
[0069] The label management module allows users to create labels for printing in separate rows and provides buttons such as "Print," "Details," "Modify," "Delete," "Import," and "Export" to enable functions such as importing and exporting data, deleting, modifying, and viewing details. Printing is performed within the label management module.
[0070] The template management module stores multiple print templates and provides buttons such as "Add", "Print Settings", "Modify", "Delete", "Search", and "Reset" to achieve the corresponding functions; for example, clicking the "Add" button will take you to the template design module to design a template.
[0071] The template design module allows users to create templates using various basic elements such as text, images, QR codes, barcodes, custom elements, and lines. Users can drag, click, edit, and import these elements to design templates. The module also provides buttons for adjusting paper width and height, rotating the paper, zooming in and out, clearing the page, importing JSON, viewing the template JSON, printing preview, and saving the template. Users can directly click on a template to start designing, or click the "Add" button in the template management module to access this module for template design.
[0072] As a preferred embodiment, the template design module can be the Hiprint plugin. Compared with professional label design software, this plugin provides simple and intuitive label design elements, and templates can be created using simple drag-and-drop and click methods, giving users greater autonomy.
[0073] The print task log module is used to record the information printed in the current print job.
[0074] server;
[0075] The server is used to accept label printing selections, run and return the corresponding selection results to the terminal devices, and send printing instructions to the printer.
[0076] refer to Figure 3 The server-side components include a UDI encoding database, a print record database, a label database, a template design plugin, an asynchronous thread pool, and an instruction conversion component.
[0077] The UDI encoding database, print record database, and label database are used to store UDI encoding data, print record data, and label data, respectively.
[0078] The template design plugin is integrated on the server side.
[0079] An asynchronous thread pool, based on its asynchronous task printing queue, instruction caching function, instruction backtracking function, and dynamic setting of printing interval, round, and number of prints, can achieve automatic timed printing of label data.
[0080] The instruction conversion component converts HTML format tag templates into ZPL instructions according to the following process: HTML template --> dynamic data replacement --> PDF file --> PNG image --> image binarization processing --> image to ZPL instructions;
[0081] The conversion process is as follows: HTML format tag templates are dynamically replaced to obtain a PDF file; the PDF file is scaled proportionally to the printing paper to generate a PNG image of the corresponding paper size; the PNG image is binarized and then converted into ZPL instructions.
[0082] In existing technologies, HTML templates or PDF files are sent to Zebra printers, which automatically perform format conversion. However, this conversion method can result in significant deviations, leading to issues such as misaligned styles, missing fonts, and abnormal sizes. In contrast, this invention uses an instruction conversion component to strictly convert HTML templates into ZPL instructions according to the ZPL protocol specifications, thereby avoiding printing misalignment and other problems.
[0083] A printer is used to accept printing instructions and perform label printing tasks.
[0084] This embodiment uses the UDI encoding printing of plasma electrodes in the medical device industry as an example to describe the working process:
[0085] Before leaving the factory, plasma electrodes need to have UDI codes affixed to the electrode body, the small box containing the electrodes, and the large carton containing a batch of electrodes. This involves matching the same UDI code with three printing templates for printing simultaneously. The printing process is as follows:
[0086] On the browser of the terminal device, click the tag management module, find the UDI code data of the plasma electrode, and click print;
[0087] In response to the click, the server sends print options to the browser, including print settings for three printers. Under each printer option are options for label template, number of labels to print per cycle, label printing rounds, cycle interval, and next print interval (on the production line, a UDI label is affixed after each batch is produced, hence the existence of printing rounds, cycle intervals, and next print interval options). The user can select one or more of the three printers on this interface and choose options such as label template and number of labels to print at once. After selection, the user can click "Save Configuration" to store the print settings data in the server. The server can directly call this configuration for the next print, without requiring the user to reset it.
[0088] In response to the user clicking the "OK Print" button, the server automatically fills the user-selected label template with UDI-encoded data. The instruction conversion component converts the HTML-formatted label template into ZPL instructions and sends them to the Zebra printer for printing. A print log is generated by the asynchronous thread pool for both successful and failed printing; please refer to the recorded video for the log details.
[0089] Before selecting a label template, users can click on the template management module to check for any errors or omissions in the label template to be printed. If modifications are needed, they can jump to the template design module to make changes, or directly click on the template design module to redesign the template.
[0090] refer to Figure 4 This embodiment provides a label printing method applied to a server, the method including the following steps:
[0091] Step S1: Receive the label printing request sent by the browser, send a print setting instruction to the browser, the print setting instruction includes print option setting instructions for at least one printer, and each print option setting instruction includes at least a print template selection instruction;
[0092] In this step S1, each print option setting instruction also includes a print interval setting instruction, a print round setting instruction, and a print count setting instruction, so as to provide the setting functions for print interval, print round, and print count on the browser respectively.
[0093] Step S2: Receive the print option setting request sent by the browser for at least one printer, fill the label data to be printed into the corresponding print template, and form at least one printable object.
[0094] Step S3: Convert the format of at least one of the printed objects into a format recognizable by the printer to form at least one print instruction;
[0095] In step S3, the format of the printed object is HTML format. Converting the format of at least one printed object into a printer-recognizable format includes:
[0096] Convert the HTML format of a printed object to PDF format;
[0097] Convert PDF printable objects to PNG images;
[0098] The PNG image is binarized.
[0099] Convert the binarized PNG image into ZPL instructions.
[0100] Step S4: Send at least one print instruction to at least one corresponding printer to print at least one label data;
[0101] This step, after sending at least one print instruction to at least one corresponding printer to print at least one set of label data, also includes:
[0102] Receive print record information from at least one printer and generate a print log based on the print record information.
[0103] As a preferred embodiment, the method of this embodiment further includes:
[0104] In response to receiving a request from the browser to save print option settings for at least one printer, save the print option settings data for at least one printer.
[0105] refer to Figure 5 This embodiment provides a label printing method applied to a terminal device, and the method specifically includes the following steps:
[0106] Step A1: In response to the user-triggered label printing action, send a label printing request to the server through the browser;
[0107] Prior to step A1, that is, before the browser sends a label print request to the server in response to a user-triggered label print action, the method also includes:
[0108] Receive user-triggered actions to process tag data, and process the tag data. This processing specifically includes:
[0109] Add, delete, modify, view, import, or export tag data.
[0110] Step A2: Receive the print setup instructions sent by the server. The print setup instructions include print option setting instructions for at least one printer, and each print option setting instruction includes at least a print template selection instruction.
[0111] In step A2, each print option setting instruction also includes a print interval setting instruction, a print round setting instruction, and a print count setting instruction, so as to provide the setting functions for print interval, print round, and print count respectively on the browser.
[0112] Step A3: Receive a print option setting action triggered by the user for at least one printer, the print option setting action including at least selecting a print template.
[0113] Step A4: Send a request to the server for print option settings for at least one printer;
[0114] This step A4 also includes:
[0115] Receive user-triggered actions to process print templates, and process the print templates, including:
[0116] Add, delete, modify, or reset print templates;
[0117] Preferably, the newly added print template includes:
[0118] Upon receiving a user-triggered action to add a new print template, the system jumps to the template design module, where the target print template is designed.
[0119] As a preferred embodiment, the method further includes:
[0120] Receive user-triggered actions to save print option settings for at least one printer;
[0121] Send a request to the server to save the printing option settings for at least one printer.
[0122] This embodiment further provides a label printing device applied to a server, the device comprising:
[0123] The first instruction sending module is used to receive a label printing request sent by the browser and send a print setting instruction to the browser. The print setting instruction includes a print option setting instruction for at least one printer, and each print option setting instruction includes at least a print template selection instruction.
[0124] The request receiving and print object forming module is used to receive the print option setting request sent by the browser for at least one printer, fill the label data to be printed into the corresponding print template, and form at least one print object;
[0125] A format conversion module is used to convert the format of at least one of the printed objects into a printer-recognizable format to form at least one print instruction;
[0126] The second instruction sending module is used to send at least one of the printing instructions to at least one corresponding printer to print at least one label data.
[0127] Accordingly, this embodiment also provides a label printing device for use in terminal equipment, the device comprising:
[0128] The first request sending module is used to respond to the label printing action triggered by the user and send a label printing request to the server through the browser;
[0129] The first instruction receiving module is used to receive print setting instructions sent by the server. The print setting instructions include print option setting instructions for at least one printer, and each print option setting instruction includes at least a print template selection instruction.
[0130] The second instruction receiving module is used to receive a print option setting action triggered by a user for at least one printer, wherein the print option setting action includes at least selecting a print template;
[0131] The second request sending module is used to send a print option setting request for at least one printer to the server.
[0132] Although specific embodiments of the invention have been described in detail with reference to the accompanying drawings, this should not be construed as limiting the scope of protection of this patent. Various modifications and variations that can be made by a person skilled in the art without inventive effort within the scope described in the claims still fall within the scope of protection of this patent.
Claims
1. A label printing method, characterized in that, Applied to a server, the method includes: The system receives a label printing request from a browser and sends a print settings instruction to the browser. The print settings instruction includes print option settings instructions for at least one printer, and each print option settings instruction includes at least a print template selection instruction. Receive a print option setting request for at least one printer sent by the browser, fill the label data to be printed into the corresponding print template, and form at least one print object; Convert the format of at least one of the printed objects into a printer-recognizable format to form at least one print instruction; Send at least one of the print instructions to at least one corresponding printer to print at least one copy of label data; The printable object is in HTML format. Converting at least one of the printable objects into a printer-recognizable format includes: Convert the HTML format of a printed object to PDF format; Convert PDF printable objects to PNG images; The PNG image is binarized. Convert the binarized PNG image into ZPL instructions; Each print option setting instruction also includes a print interval setting instruction, a print round setting instruction, and a print count setting instruction, so as to provide the setting functions for print interval, print round, and print count on the browser, respectively; After sending at least one of the aforementioned print instructions to at least one corresponding printer to print at least one label data, the method further includes: Receive print record information from at least one printer and generate a print log based on the print record information; The method further includes: In response to receiving a request from the browser to save print option settings for at least one printer, the print option settings data for at least one printer are saved.
2. A label printing method, characterized in that, Applied to a terminal device, the method includes: In response to a user-triggered label printing action, a label printing request is sent from the browser to the server. The system receives print setting instructions sent by the server. The print setting instructions include print option setting instructions for at least one printer. Each print option setting instruction includes a print template selection instruction, a print interval setting instruction, a print round setting instruction, and a print count setting instruction, so as to provide print template, print interval, print round, and print count setting functions on the browser, respectively. Receive a user-triggered print option setting action for at least one printer, the print option setting action including selecting a print template and setting at least one of print interval, print round, and print count; Send a request to the server for printing option settings for at least one printer.
3. The label printing method according to claim 2, characterized in that, Also includes: Receive user-triggered actions to save print option settings for at least one printer; Send a request to the server to save the printing option settings for at least one printer.
4. The label printing method according to claim 2, characterized in that, Before sending a label printing request to the server via the browser in response to a user-triggered label printing action, the method further includes: Receive user-triggered actions to process tag data, and process the tag data, including: Add, delete, modify, view, import, or export tag data.
5. The label printing method according to claim 2, characterized in that, The method further includes sending a request to the server for print option settings for at least one printer: Receive user-triggered actions to process print templates, and process the print templates, including: Add, delete, modify, or reset print templates.
6. The label printing method according to claim 5, characterized in that, The newly added print template includes: Upon receiving a user-triggered action to add a new print template, the system jumps to the template design module, where the target print template is designed.
7. A label printing device, characterized in that, Applied to a server, the device includes: The first instruction sending module is used to receive a label printing request sent by the browser and send a print setting instruction to the browser. The print setting instruction includes a print option setting instruction for at least one printer. Each print option setting instruction includes at least a print template selection instruction. Each print option setting instruction also includes a print interval setting instruction, a print round setting instruction, and a print count setting instruction, so as to provide print interval, print round, and print count setting functions on the browser, respectively. The request receiving and print object forming module is used to receive the print option setting request sent by the browser for at least one printer, fill the label data to be printed into the corresponding print template, and form at least one print object; A format conversion module is used to convert the format of at least one of the printable objects into a printer-recognizable format to form at least one print instruction; wherein the printable object is in HTML format, converting the format of at least one of the printable objects into a printer-recognizable format includes: Convert the HTML format of a printed object to PDF format; Convert PDF printable objects to PNG images; The PNG image is binarized. Convert the binarized PNG image into ZPL instructions; The second instruction sending module is configured to send at least one of the printing instructions to at least one corresponding printer to print at least one label data; it also includes: Receive print record information from at least one printer and generate a print log based on the print record information; A save module is configured to save the print option settings data for at least one printer in response to receiving a request from the browser to save print option settings for at least one printer.
8. A label printing device, characterized in that, Applied to a terminal device, the device includes: The first request sending module is used to respond to the label printing action triggered by the user and send a label printing request to the server through the browser; The first instruction receiving module is used to receive the print setting instruction sent by the server. The print setting instruction includes print option setting instructions for at least one printer. Each print option setting instruction includes a print template selection instruction, a print interval setting instruction, a print round setting instruction, and a print count setting instruction, so as to provide print template, print interval, print round, and print count setting functions on the browser respectively. The second instruction receiving module receives a print option setting action triggered by the user for at least one printer. The print option setting action includes selecting a print template and setting at least one of the following: print interval, print cycle, and print count. The second request sending module is used to send a print option setting request for at least one printer to the server.