Printing control method and system

By providing printing control methods and systems in the receipt printing system, users can edit and modify the receipt content and templates independently, solving the problem of difficulty in positioning when printing abnormalities, and improving operational convenience and efficiency.

WO2025130656A1PCT designated stage expired Publication Date: 2025-06-26SHANGHAI SUMI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/137339
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-18
Filing Date
2024-12-06
Publication Date
2025-06-26

AI Technical Summary

Technical Problem

When existing ticket printing systems encounter printing exceptions, it is difficult to quickly and accurately locate the problem, and it is difficult for users to modify the ticket content or edit the template independently, resulting in unfriendly and inefficient operations.

Method used

It provides a printing control method and system, which allows users to edit and modify the receipt content and templates by obtaining order source files and printing configuration information, parsing and generating visual debugging files and printing preview files.

Benefits of technology

It realizes automatic analysis, debugging, preview, editing and printing of tickets for printing abnormal orders, improving user operation convenience and efficiency and reducing the possibility of printing errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024137339_26062025_PF_FP_ABST
    Figure CN2024137339_26062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a printing control method and system. The method comprises: acquiring an order source file to be parsed and printing configuration information; on the basis of the printing configuration information, parsing the order source file to obtain a first visual debugging file and a first printing preview file; saving the first visual debugging file and the first printing preview file; on the basis of the first visual debugging file or the first printing preview file, updating the printing configuration information; and on the basis of the updated printing configuration information, generating a second visual debugging file and a second printing preview file. By means of the present application, visual and automatic parsing, debugging, previewing, editing and printing can be performed on an order receipt which is printed abnormally.
Need to check novelty before this filing date? Find Prior Art

Description

Printing control method and system Technical Field

[0001] The present application relates to the field of computers, and in particular to a printing control method and system. Background Art

[0002] A receipt, also known as a shopping receipt, is a sales receipt given to a consumer by a shopping mall or other commercial establishment. Currently, all cash register systems on the market support receipt printing, including printing of shopping receipts during front-end payment.

[0003] In existing technology, receipts are typically automatically generated based on the corresponding order information and a specified template. These receipts are not visually displayed during the printing process. When an order is printed abnormally, it is difficult to quickly and accurately identify the problem. There are many reasons for order printing errors, such as mismatched encoding formats, improper use of EPOS commands, and mismatched command types. For example, a receipt may be too long due to excessive line spacing.

[0004] For users, if they want to modify the data on the receipt or edit the template, they need to directly modify the source data. This method of editing the receipt is not user-friendly and difficult to operate, especially when the receipt printing is abnormal and there is only a sample receipt image, or when the template needs to be recreated. For example, developers need to remotely obtain the customer's order content and parse the hexadecimal data of the order byte by byte to analyze the cause of the abnormality. This not only requires manual segmentation of the byte ranges corresponding to different types of instructions, but also requires comparison and analysis of some complex instructions against the EPOS instruction set. At the same time, order files are usually KB or even MB in size, which brings a lot of workload to developers. The base conversion and a large number of repetitive actions in the entire process result in very low parsing efficiency. Therefore, it is necessary to provide a visual and easy-to-operate interactive method for users to independently modify the content of the receipt or edit the receipt template. Summary of the Invention

[0005] In order to solve the above technical problems, the present application provides a printing control method and system, through which order receipts with printing abnormalities can be automatically parsed, debugged, previewed, edited and printed.

[0006] Specifically, the technical solution of this application is as follows:

[0007] In a first aspect, the present application discloses a printing control method, comprising:

[0008] Get the order source file to be parsed and the printing configuration information;

[0009] Parsing the order source file according to the print configuration information to obtain a first visual debugging file and a first print preview file;

[0010] The first visual debugging file and the first print preview file are saved.

[0011] In some embodiments, the printing control method further includes:

[0012] updating the printing configuration information according to the first visual debugging file;

[0013] Generate a second visual debugging file and a second print preview file according to the updated print configuration information;

[0014] or, updating the printing configuration information according to the first print preview file;

[0015] Generate a second visual debugging file and a second print preview file according to the updated print configuration information;

[0016] The second visual debugging file and the second print preview file are saved.

[0017] In some implementations, obtaining printing configuration information includes:

[0018] Receive a print instruction from a user; select a corresponding channel to connect to the printer according to the print instruction;

[0019] Acquire first configuration information of the printer, and return the first configuration information to the software page;

[0020] The first configuration information is automatically / manually modified to obtain the printing configuration information; the printing configuration information includes one or more of encoding format, paper width, and printing density.

[0021] In some embodiments, parsing the order source file according to the print configuration information to obtain a first visual debugging file and a first print preview file includes:

[0022] Acquire the encoding format of the order source file according to the printing configuration information;

[0023] Obtaining an order information set through character parsing and decoding operations; the order information set includes one or more of character data, a QR code, a barcode, and a raster bitmap;

[0024] Parsing the order source file using EPOS instruction parsing rules to obtain an instruction information set; the instruction information set is a collection of EPOS instructions in the order source file;

[0025] generating a first visual debugging file according to the order information set and the instruction information set, wherein in the first visual debugging file, instruction information elements in the instruction information set correspond one-to-one to order information elements in the order information set;

[0026] A first print preview file of the order source file is generated according to the print configuration information.

[0027] In some embodiments, the order source file is in Hex file format;

[0028] The encoding format of the order source file is hexadecimal encoding;

[0029] The EPOS instructions include one or more of paragraph and text attribute setting instructions, barcode / QR code and raster bitmap instructions, print and paper feed instructions, and absolute print position setting instructions.

[0030] In some implementations, updating the print configuration information according to the first visual debugging file or the first print preview file includes:

[0031] By calling one or more of: a dot-line conversion / offset module, a font double-height image generation module, a print setting update module, a raster bitmap generation module, a barcode generation module, and a QR code generation module, the print configuration information is adjusted so that the second print preview file meets the expected settings.

[0032] In some embodiments, the printing control method further includes:

[0033] Obtaining a receipt image, using optical character recognition (OCR) technology to identify relevant data in the receipt image, and generating a third visual electronic module and a third print preview file;

[0034] The relevant data includes: text, symbols, icons and layout information;

[0035] Adjusting the relevant data, and generating a fourth visual electronic module and a fourth print preview file according to the adjusted relevant data;

[0036] The fourth visualization electronic module and the fourth print preview file are saved.

[0037] In a second aspect, the present application further discloses a printing control system, characterized in that it is used to execute a printing control method described in any of the above embodiments, including:

[0038] The acquisition module is used to obtain the order source file to be parsed and print configuration information;

[0039] A parsing module, configured to parse the order source file according to the print configuration information to obtain a first visual debugging file and a first print preview file;

[0040] The storage module is used to store the first visual debugging file and the first print preview file.

[0041] In some embodiments, the printing control system further includes:

[0042] An updating module, configured to update the printing configuration information according to the first visual debugging file; and generate a second visual debugging file and a second print preview file according to the updated printing configuration information;

[0043] Alternatively, the updating module is further configured to update the printing configuration information according to the first printing preview file; and generate a second visual debugging file and a second printing preview file according to the updated printing configuration information.

[0044] In some embodiments, the acquisition module is further used to acquire a receipt image;

[0045] The parsing module is further configured to use optical character recognition (OCR) technology to identify relevant data in the receipt image and generate a third visual electronic module and a third print preview file; the relevant data includes text, symbols, icons, and layout information;

[0046] The updating module is further configured to adjust the relevant data and generate a fourth visual electronic module and a fourth print preview file according to the adjusted relevant data;

[0047] The storage module is further used to store the fourth visual electronic module and the fourth print preview file.

[0048] Compared with the prior art, this application has at least one of the following beneficial effects:

[0049] 1. The printing control method and system provided by this application can parse locally imported order files according to the specified encoding format and print settings, and generate a Word document similar to the actual printed receipt for previewing the printing effect. When the layout of the printed receipt does not meet expectations, the cause of the anomaly can be quickly and accurately analyzed. This facilitates technical support personnel to help customers analyze and handle related customer complaints. In addition, the printing platform provided by this application can be used to more conveniently design order layouts, reducing the possibility of later printing errors caused by long abstract instructions.

[0050] 2. The printing platform provided by this application supports two operating modes: debug mode and standard mode. In debug mode, all instruction information sets can be annotated and printed based on the standard mode, generating a visual debugging file. The printing platform provided by this application integrates the automatic parsing, debugging, previewing, editing, and printing functions into a single page for greater convenience. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of the present application.

[0052] FIG1 is a flowchart of a method embodiment provided by the present application;

[0053] FIG2 is a schematic diagram of a visual debugging file in debugging mode according to an embodiment of the present application;

[0054] FIG3 is a comparison diagram of the preview effect and the actual printing effect in the embodiment provided by this application;

[0055] FIG4 is a flow chart of another method embodiment provided by the present application;

[0056] FIG5 is a structural block diagram of a printing platform in a system embodiment provided by the present application;

[0057] FIG6 is a schematic structural diagram of a printing platform in another system embodiment provided by the present application;

[0058] FIG7 is a schematic diagram of the calling logic between the modules of the printing platform in another system embodiment provided by the present application. DETAILED DESCRIPTION

[0059] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present application with unnecessary details.

[0060] It will be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections.

[0061] To simplify the drawings, only portions relevant to the invention are schematically depicted in each figure; they do not represent the actual structure of the product. Furthermore, to simplify the drawings and facilitate understanding, in some figures, only one component with the same structure or function is schematically depicted or labeled. In this document, "one" not only means "only one" but also "more than one."

[0062] It should be further understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0063] It should be noted that, unless otherwise specified or limited, the terms "mounted," "connected," and "connected" should be understood broadly. For example, they can refer to fixed, removable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; and internal communication between two components. Those skilled in the art will understand the specific meanings of these terms in this application based on the specific circumstances.

[0064] In specific implementations, the terminal devices described in the embodiments of the present application include, but are not limited to, other portable devices such as mobile phones, laptop computers, tutoring machines, or tablet computers with touch-sensitive surfaces (e.g., touch screen displays and / or touchpads). It should also be understood that in some embodiments, the terminal device is not a portable communication device, but rather a desktop computer with a touch-sensitive surface (e.g., touch screen displays and / or touchpads).

[0065] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0066] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific implementation methods of the present application will be described below with reference to the accompanying drawings. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without inventive work.

[0067] When customers encounter printing and typesetting anomalies, it's often difficult to pinpoint the cause. Developers are required to remotely retrieve the customer's order details and parse the hexadecimal data byte by byte to analyze the cause of the anomaly. This requires not only manual segmentation of the byte ranges corresponding to different types of instructions, but also comparison and analysis of some complex instructions against the EPOS instruction set. Furthermore, order files are often in the KB or even MB range, placing a significant workload on developers. The constant base conversion and repetitive steps throughout the process lead to low parsing efficiency.

[0068] There are many reasons for order printing errors, such as mismatched encoding formats, improper use of EPOS instructions, mismatched instruction types, etc. For example, the receipt is too long because the line spacing is set too large.

[0069] In summary, when encountering an order with abnormal printing, it is difficult to quickly and accurately identify the problem, which requires a high level of instruction parsing experience and proficiency from the developer. Therefore, it is necessary to develop a tool that can automatically parse order content.

[0070] Referring to FIG1 of the specification, an embodiment of a printing control method provided by the present application is executed by a printing platform, wherein the printing platform includes a debugging mode and a standard mode. The method comprises the following steps:

[0071] S100, obtaining the order source file to be parsed and printing configuration information.

[0072] Specifically, obtaining the proposed print configuration information includes: S110: receiving a print instruction from a user; S120: selecting a corresponding channel to connect to a printer based on the user's print instruction; S130: obtaining and modifying the configuration information of the connected printer. More preferably, S130: obtaining first configuration information of the current printer, returning the first configuration information to the software interface, and adjusting the first configuration information to generate the proposed print configuration information.

[0073] S200: Parsing the order source file according to the print configuration information to obtain a first visual debugging file and a first print preview file. Specifically, the process includes: parsing the order source file using EPOS instruction parsing rules to obtain an instruction information set, and obtaining an order information set through character parsing and decoding. The instruction information elements in the instruction information set correspond one-to-one to the order information elements in the order information set.

[0074] The order source file to be parsed is in Hex format. The printing configuration information includes one or more of encoding mode, paper width, and print density. The order information set includes one or more of character data, QR code, barcode, and raster bitmap.

[0075] The instruction information set, that is, the EPOS instruction, includes one or more of paragraph and text attribute setting instructions, barcode / QR code and raster bitmap instructions, print and paper feed instructions, and absolute print position setting instructions.

[0076] S300: Save the first visual debugging file and the first print preview file.

[0077] Specifically, the visual debugging file is in Word document format or image format.

[0078] In the debugging mode, the order information set is written into the visual debugging file. The information elements in the instruction information set are annotated to the corresponding information elements in the order information set to generate the visual debugging file. Switching to the standard mode, the print preview file is generated.

[0079] Another embodiment of a print control method of the present application, based on the above embodiment, further includes: S400, updating the print configuration information based on the first visual debugging file, generating a second visual debugging file and a second print preview file based on the updated print configuration information, and saving the second visual debugging file and the second print preview file.

[0080] In another implementation of this embodiment: S400, updating the print configuration information according to the first print preview file, generating a second visual debugging file and a second print preview file according to the updated print configuration information, and saving the second visual debugging file and the second print preview file.

[0081] More preferably, the visual debugging file or the print preview file is modified so that the print preview file conforms to the expected settings, and a new instruction information set is generated according to the modified visual debugging file so that the printer can print.

[0082] Specifically, in the debugging mode, one or more of the point-line conversion / offset module, the font double-height image generation module, the print setting update module, the raster bitmap generation module, the barcode generation module, and the QR code generation module are called to adjust the order information set and the instruction information set, so that the print preview file meets the expected settings and saves the current instruction information so that the printer can print.

[0083] Another embodiment of a printing control method of the present application specifically includes the following steps:

[0084] S100: Receive a first enabling instruction and control the operating mode of the printing platform to switch to a debugging mode. Specifically, the printing platform provided in this application supports two operating modes: a debugging mode and a standard mode.

[0085] S200: Obtain the order source file to be parsed, parse the order source file according to the specified encoding format and print settings, obtain EPOS instructions through parsing, save them locally, and generate a visual debugging file.

[0086] Specifically, the order source file is parsed according to the specified encoding format and print settings, including: S210, parsing according to the rules of the standard EPOS instruction set or a specific cloud printer instruction set. S220, the data in the order source file that is parsed as EPOS instructions is normal data. S230, the data that cannot be parsed in the order source file is marked as abnormal data, the cause of the abnormality is estimated and a corresponding solution is provided. More preferably, if the entire receipt content can be parsed according to the standard instructions, it means that there is no error in the order source file, or the error has been successfully modified. Unsuccessful parsing means that there is a situation in the receipt data that does not comply with the EPOS instruction standard, and garbled characters will basically appear in the actual printing. After the visual exception, the abnormal data and modification suggestions can be found by viewing the debug document, and the modification can be parsed again until success or exit. In other implementations of this embodiment, it is also possible to verify whether the error has been successfully modified by a second parsing.

[0087] The order source file is a Hex format file. The EPOS instructions include paragraph and text attribute setting instructions, barcode / QR code and raster bitmap instructions, print and paper feed instructions, and absolute print position setting instructions. EPOS instructions, this print control command is a standardized instruction set for dot matrix printers developed by EPSON itself, and has now become the de facto industrial standard for dot matrix printer control language. The EPOS print command set is a simplified version of the ESC / POS print control command. Most bill printing now uses the EPOS instruction set. Its notable feature is that a large part of the instructions are a string of codes that begin with the ESC control character.

[0088] S240, annotate the parsed EPOS instructions at the corresponding position of the order source file to obtain a visual debugging file. Specifically, a new blank file is created, and the data of the order source file is written section by section. After each section of data is written, the EPOS instruction name and instruction value accumulated in the current data, as well as the Hex byte data string corresponding to the section of data are marked. After writing is completed, a visual debugging file is obtained. Specifically, the visual debugging file is shown in Figure 2 of the specification, which includes the hexadecimal order source file and the parsed EPOS instructions. Under debug mode, the visual debugging file is visualized by converting the hexadecimal data of the receipt into an intuitively viewable image. The advantages are: 1. Avoiding the manual byte-by-byte parsing of the receipt content, a simulated printed picture or document can be directly generated. The debug mode can also interpret the EPOS instructions in the receipt and output them to a picture or document, making it convenient to quickly locate the problem. 2. It is more convenient to edit and adjust the receipt template. The user does not need to consider the editing of the EPOS instructions, but only needs to focus on the typesetting.

[0089] S300, debug the visual debugging file and generate a print preview document to determine whether the modification achieves the expected effect. A new EPOS instruction is obtained after the modification. Specifically, the print preview document is similar to the actual printed receipt, so that the printing effect can be previewed. The print preview document is generally in word format, picture format, etc. The comparison chart of the preview effect and the actual printing effect is shown in Figure 3. Specifically, the preview effect can intuitively present the simulated printing effect on documents in word / html / picture formats, etc., which has the advantage of facilitating dynamic modification and abnormality analysis.

[0090] S400: Send the new EPOS instruction to the printer so that the printer can print the order receipt.

[0091] Shopping receipts are not only used for accounting purposes, but also provided to customers as proof of purchase. Traditional cash register receipt printers require a computer to download a driver before use. With the advent of cloud printers, receipt machines no longer require a computer, but instead receive printing instructions remotely via a wireless network. The principle of cloud printers printing receipts is to issue a print instruction through a server, which is then transmitted to the printer via WIFI, thus achieving cloud printing. Specifically, the server issues a print instruction through the software development kit SDK and sends the content to be printed to the cloud printer. After receiving the instruction, the cloud printer parses the content and prints it out. Because cloud printers support WIFI connection, wireless printing can be achieved, which is convenient and fast.

[0092] Another embodiment of a printing control method of the present application, as shown in Figure 4 of the specification, in order to parse the order content more quickly and accurately, and to visualize the actual printing effect more intuitively, we provide a tool that can automatically parse and preview the order content, and integrate it into the cloud printing platform (cloud-printer-utility) tool. The automatic parsing tool can parse the input order file according to the specified encoding format and print settings, and generate a Word document similar to the actual printed receipt to preview the printing effect. Therefore, the actual use scenarios of the tool can be divided into the following categories: 1. For developers: When the layout of the printed receipt does not meet expectations, developers can use the automatic parsing tool to quickly and accurately analyze the cause of the exception.

[0093] 2. For technical support personnel: This tool makes it easier for technical support personnel to help customers analyze and resolve relevant customer complaints.

[0094] 3. For customers: Customers can use this automatic parsing tool to more conveniently design order layouts, reducing the possibility of later printing errors caused by long abstract instructions.

[0095] Specifically, the implementation steps are as follows: S1. The cloud printing platform receives a printing instruction from the user and selects a corresponding channel to connect to the printer.

[0096] Specifically, the web interactive interface serves as an independent interface of the cloud-printer-utility. The automatic parsing tool mainly consists of three parts: file selection, printing parameter setting, and starting parsing.

[0097] S2. After the connection is successful, the cloud-printer-utility obtains the configuration information of the printer and modifies it.

[0098] Specifically: the cloud printing platform obtains the first configuration information of the current printer, and returns the first configuration information to the software page for display, so that the user can modify the first configuration information.

[0099] S3. Save the modified second configuration information of the printer. Write the second configuration information to the printer. After writing, obtain the second configuration information of the current printer and return the second configuration information to the software page for display. The configuration information includes encoding mode, paper width, and print density.

[0100] Specifically, after clicking the folder icon button and selecting the order file, the path and file size (in bytes) will be displayed, and a Reload button will be provided to reload the order file. Then, you can select the relevant parameters (encoding method, paper width, print density, and parsing mode) according to the current settings of the cloud printer. Finally, click the Parse button to parse it. The generated visual Word file will be automatically saved in the same directory as the order file.

[0101] S4. The user uploads the local order file to the cloud printing platform and selects the parsing mode. After the printing platform parses the file, the visual debugging file is saved locally. After comparative analysis, the user modifies the visual debugging file and re-issues the EPOS command to the printer so that the printer can print the receipt.

[0102] Preferably, the details of the steps are the same as those in the previous embodiment and will not be repeated here.

[0103] Another embodiment of a printing control method of the present application, based on any of the above method embodiments, further includes the following steps:

[0104] S510, obtaining a receipt image, using optical character recognition technology (OCR) to identify relevant data in the receipt image, and generating a third visual electronic module and a third print preview file.

[0105] S520, the relevant data includes: text, symbols, icons and layout information.

[0106] S530: Adjust the relevant data, and generate a fourth visual electronic module and a fourth print preview file according to the adjusted relevant data.

[0107] S540: Save the fourth visual electronic module and the fourth print preview file.

[0108] Specifically, if you need to change the preview document, you can change the original receipt data, or you can save it as a template and adjust it through the template. The template is saved on the computer where the debugging tool is located, and can also be saved in the cloud later. After the template is generated, you can directly fill in the information such as product name and price locally and print it, or you can use it on the app or web. In this embodiment, the process of adjusting the template of the preview document is also visualized, including the following technical means:

[0109] 1. After parsing the receipt data according to EPOS instruction rules, input the content into Word / HTML / image to simulate the effect of receipt printing. For example, the parsed content can be output to a Word document using python-docx.

[0110] 2. Receipt templates are used in scenarios where EPOS instructions are abstracted. Template components are implemented using one or more sets of EPOS instructions. The displayed content can be modified dynamically, creating a visual receipt template. When printing is required, the "Generate Receipt" function converts the template into actual printed receipt data. This visualization tool is intended for both developers and users.

[0111] Based on the same technical concept, the present application also discloses a printing control system, which can be used to implement any of the above-mentioned printing control methods. Specifically, an embodiment of a printing control system of the present application, as shown in Figure 5 of the specification, includes: a printing platform and a printer as described in any of the above-mentioned method embodiments.

[0112] The printing platform is used to parse the source file of the order with printing anomalies according to the specified encoding format and print settings, generate a Word document similar to the actual printed receipt to preview the printing effect, and generate a visual debugging file to debug the printing anomaly data. The printing platform is also used to generate dynamic editing templates to manage the receipts. The printer is connected to the printing platform by signal and is used to print the order receipt according to the preset print settings. Preferably, the printer is a cloud printer.

[0113] Specifically, the printing platform includes:

[0114] The acquisition module 10 is used to acquire the order source file to be parsed and the printing configuration information.

[0115] Specifically, the acquisition module 10 selects a corresponding channel to connect to the printer. After the connection is successful, it obtains and modifies the configuration information of the printer, obtains the first configuration information of the current printer, returns the first configuration information to the software page, and adjusts the first configuration information to generate the proposed print configuration information. The configuration information includes encoding mode, paper width, and print density.

[0116] The parsing module 20 is configured to parse the order source file according to the print configuration information to obtain a first visual debugging file and a first print preview file.

[0117] Specifically, the parsing module 20 obtains the order source file to be parsed and the planned print configuration information obtained by the acquisition module 10. According to the specified encoding format and print configuration information, the order source file is parsed to obtain the order information set and the instruction information set. The order information set and the instruction information set are edited to generate a visual debugging file in the debugging mode and a corresponding print preview file in the standard mode. The order source file is a Hex format file. The EPOS instructions include paragraph and text attribute setting instructions, barcode / QR code and raster bitmap instructions, print and paper feed instructions and absolute print position setting instructions. Specifically, the parsing module is also used to parse according to the rules of the standard EPOS instruction set or a specific cloud printer instruction set. The data in the order source file that is parsed as EPOS instructions is normal data. The data that cannot be parsed in the order source file is marked as abnormal data, the cause of the abnormality is estimated and a corresponding solution is provided.

[0118] Preferably, the visualization unit is configured to annotate the parsed EPOS instructions at corresponding locations in the order source file, thereby generating a visualization debugging file. Specifically, the following steps are performed: a blank file is created, and the data from the order source file is written segment by segment. After each segment is written, the accumulated EPOS instruction name and instruction value in the current data are annotated, as well as the corresponding Hex byte data string for that segment. Once writing is complete, a visualization debugging file is generated.

[0119] The storage module 30 is used to store the first visual debugging file and the first print preview file.

[0120] In another implementation of this embodiment, the printing control system further includes:

[0121] The updating module 40 is configured to update the printing configuration information according to the first visual debugging file and generate a second visual debugging file and a second print preview file according to the updated printing configuration information.

[0122] Alternatively, the updating module 40 is further configured to update the printing configuration information according to the first printing preview file, and generate a second visual debugging file and a second printing preview file according to the updated printing configuration information.

[0123] Specifically, the update module 40 is used to modify the visual debugging file so that the print preview file conforms to the expected settings and generate new instruction information based on the modified visual debugging file. The preview unit in the parsing module 20 generates a print preview document that is close to the actual printed receipt to preview the printing effect.

[0124] In another embodiment of a printing control system provided by the present application, the acquisition module is also used to acquire a receipt image.

[0125] The parsing module is further configured to use optical character recognition (OCR) technology to identify relevant data in the receipt image and generate a third visual electronic module and a third print preview file. The relevant data includes text, symbols, icons, and layout information.

[0126] The updating module is further configured to adjust the relevant data and generate a fourth visual electronic module and a fourth print preview file according to the adjusted relevant data.

[0127] The storage module is further used to store the fourth visual electronic module and the fourth print preview file.

[0128] Specifically, if you need to change the preview document, you can modify the original receipt data, or save it as a template and adjust it later. The template is saved on the computer where the debugging tool is located, and can also be saved in the cloud later. After the template is generated, you can directly fill in the information such as product name and price locally and print it, or you can use it on the app or web. In this embodiment, the process of adjusting the template of the preview document is also visualized.

[0129] Another embodiment of a printing control system provided by the present application, as shown in FIG6 of the specification, based on the above system embodiment, the printing control system includes:

[0130] 1. Configure the reading module to generate a preview file based on the printer's current print settings.

[0131] Specifically, it supports manual configuration based on the current print settings of the cloud printer and supports reading the current print settings of the cloud printer.

[0132] 2. Instruction parsing module (parsing module), used to accurately parse EPOS instructions and order content.

[0133] Specifically, it supports parsing of commonly used EPOS commands, such as paragraph / text attribute setting commands, barcode / QR code / raster bitmap commands, print and paper feed commands, and absolute print position setting commands. It also supports page mode related commands and supports parsing of content in other languages.

[0134] 3. Visualization module, used to facilitate users to preview visualization results.

[0135] Specifically, it supports both standard and debug modes, generating a Word document in the same directory as the order. You can directly open the generated Word document by clicking a button on the interface.

[0136] 4. Qt interface module (QT application) is used to facilitate users to use the tool.

[0137] Specifically, it supports file selection, mode selection, and print setting selection. It also supports displaying and modifying the current print-related settings of the cloud printer.

[0138] Better yet, the visualization function and print preview function are both implemented based on the functions of basic components, which include: point-line conversion / offset module, raster bitmap generation module, font double-height image generation module, barcode generation module, print settings update module, QR code generation module, Word writing module, and Word page initialization module.

[0139] Specifically, when the user selects the parsing function, the parsing module thread calls the Python script to perform the order parsing operation. The calling logic between modules is shown in Figure 7 of the specification:

[0140] After reading the order file, the parsing module interprets the order content data, obtaining EPOS instructions and order content data, including character arrays, QR codes, barcodes, and raster bitmaps. It also retrieves pre-set print settings, including line spacing, alignment, font size, bold, underline, and color. These settings are then written to a Word document (preview document).

[0141] After saving the Word document as a template, adjust the template through: line information update module, point-line conversion / offset module, character writing module, font double-height image generation module, and annotation printing module, and finally save the Word document to the local computer.

[0142] A printing control method and system of the present application have the same technical concept, and the technical details of the embodiments of the two are applicable to each other. To reduce repetition, they will not be repeated here.

[0143] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, only the division of the above-mentioned program modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one processing unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software program unit. In addition, the specific names of the program modules are only for the purpose of distinguishing each other and are not used to limit the scope of protection of this application.

[0144] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0145] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0146] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. Exemplarily, the device embodiments described above are merely schematic. Exemplarily, the division of the modules or units is merely a logical function division. There may be other division methods in actual implementation. Exemplarily, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0147] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment as needed.

[0148] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0149] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.

[0150] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

Claims

1. A printing control method, characterized in that: include: Get the order source file to be parsed and the printing configuration information; According to the printing configuration information, the order source file is parsed to obtain a first visual debugging file and a first print preview file; The first visual debugging file and the first print preview file are saved.

2. A printing control method according to claim 1, characterized in that: Also includes: According to the first visual debugging file, updating the printing configuration information; Generate a second visual debugging file and a second print preview file according to the updated print configuration information; or, updating the printing configuration information according to the first print preview file; Generate a second visual debugging file and a second print preview file according to the updated print configuration information; The second visual debugging file and the second print preview file are saved.

3. A printing control method as claimed in claim 1, characterized in that: The obtaining of printing configuration information includes: Receive a printing instruction from a user; select a corresponding channel to connect to the printer according to the printing instruction; Acquire first configuration information of the printer, and return the first configuration information to the software page; The first configuration information is automatically / manually modified to obtain the printing configuration information; the printing configuration information includes one or more of a coding format, a paper width, and a printing density.

4. A printing control method according to any one of claims 1 to 3, characterized in that: The step of parsing the order source file according to the print configuration information to obtain a first visual debugging file and a first print preview file includes: Acquire the encoding format of the order source file according to the printing configuration information; Obtaining an order information set through character parsing and decoding operations; the order information set includes one or more of character data, a QR code, a bar code, and a raster bitmap; Parsing the order source file by using EPOS instruction parsing rules to obtain an instruction information set; the instruction information set is a collection of EPOS instructions in the order source file; Generate a first visual debugging file according to the order information set and the instruction information set, wherein in the first visual debugging file, instruction information elements in the instruction information set correspond one-to-one to order information elements in the order information set; A first print preview file of the order source file is generated according to the print configuration information.

5. A printing control method as claimed in claim 4, characterized in that: The order source file is in Hex file format; The encoding format of the order source file is hexadecimal encoding; The EPOS instructions include one or more of paragraph and text attribute setting instructions, barcode / QR code and raster bitmap instructions, print and paper feed instructions, and absolute print position setting instructions.

6. A printing control method as claimed in claim 2, characterized in that: The updating of the print configuration information according to the first visual debugging file or the first print preview file includes: By calling one or more of: a dot-line conversion / offset module, a font double-height image generation module, a print setting update module, a raster bitmap generation module, a barcode generation module, and a QR code generation module, the print configuration information is adjusted so that the second print preview file meets the expected settings.

7. A printing control method as claimed in claim 1, characterized in that: Also includes: Obtain a receipt image, use optical character recognition technology (OCR) to recognize relevant data in the receipt image, and generate a third visual electronic module and a third print preview file; The relevant data includes: text, symbols, icons and layout information; Adjusting the relevant data, and generating a fourth visual electronic module and a fourth print preview file according to the adjusted relevant data; The fourth visualization electronic module and the fourth print preview file are saved.

8. A printing control system, characterized in that: A printing control method for executing any one of claims 1 to 7, comprising: The acquisition module is used to obtain the order source file to be parsed and print configuration information; A parsing module, configured to parse the order source file to obtain a first visual debugging file and a first print preview file according to the print configuration information; The storage module is used to store the first visual debugging file and the first print preview file.

9. A printing control system as claimed in claim 8, further comprising: An updating module, used for updating the printing configuration information according to the first visual debugging file; Generate a second visual debugging file and a second print preview file according to the updated print configuration information; Alternatively, the updating module is further configured to update the printing configuration information according to the first printing preview file; and generate a second visual debugging file and a second printing preview file according to the updated printing configuration information.

10. A printing control system as claimed in claim 9, characterized in that: The acquisition module is also used to acquire the receipt image; The analysis module is further used to use optical character recognition technology OCR to recognize relevant data in the receipt image and generate a third visual electronic module and a third print preview file; the relevant data includes: text, symbols, icons and layout information; The updating module is further used to adjust the relevant data and generate a fourth visual electronic module and a fourth print preview file according to the adjusted relevant data; The storage module is also used to store the fourth visualization electronic module and the fourth print preview file.

Citation Information

Patent Citations

  • Template receipt custom printing method

    CN111625208A

  • Method and device for printing table data based on line printing style

    CN112230870A

  • A method, system, device, and media for visually configuring print formats.

    CN116804917A

  • Printing control method and system

    CN117971138A

  • Method for editing a printed page

    US20050114772A1