Adaptive dual-color ribbon printing method, device, printer and storage medium
By generating a print preview in the printer software and splitting the cigarette name information, and determining the color printing information in combination with the position of the gap dotted frame, the problem that the printer software cannot recognize and avoid the two-color band printing gap is solved, and the high-quality and complete two-color band printing effect is achieved.
Patent Information
- Application Number
- CN202410682356.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-05-29
AI Technical Summary
Existing printer software cannot identify and avoid the gap area between the two-color band printing, resulting in missing parts of the printing of long information.
By obtaining editing information of the editing template, a print preview is generated, and the cigarette name information is split into the first part information and the second part information according to the preset splitting rules. The position of the gap dotted line frame is determined according to the print preview diagram, and the respective color printing information is determined based on the first part information and the first part information and the second part information and the second gap dotted line.
It realizes effective identification and avoiding ribbon gaps during the dual-color band printing process, prevents the loss of key information, and improves the quality and integrity of the printing labels.
Smart Images

Figure CN118642670B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of printer technology, and in particular to an adaptive dual-color ribbon printing method, device, printer and storage medium. Background Art
[0002] At present, many tobacco price tag printing software on the market use dual-color ribbon printing technology to print tobacco labels. Dual-color ribbon printing technology is a technology used in printers and label printers that uses two different color printing ribbons to print text, images or barcodes in different colors. Usually, black is used to print regular text, and red is used to print special information or amounts. Dual-color ribbon printing technology can efficiently print labels with different colors and contents, making the labels more attractive and recognizable.
[0003] However, when the tobacco brand name or other information is too long, the long content may cross the gap between the two ribbons, resulting in missing content in the middle area between the two ribbons. The software system corresponding to the existing printer cannot recognize and avoid the gap to print, resulting in missing information or incomplete labels. Summary of the invention
[0004] In view of this, the embodiments of the present application provide an adaptive dual-ribbon printing method, device, printer and storage medium, which solve the technical problem that the software system of the printer cannot identify and avoid the ribbon gap.
[0005] In a first aspect, the present application provides an adaptive dual-color ribbon printing method, which adopts the following technical solution:
[0006] Obtaining editing information of the editing template, wherein the editing information includes cigarette name information, price information and origin information;
[0007] Generate a print preview image according to the cigarette name information, the price information and the origin information;
[0008] When the two-color printing switch is turned on, the cigarette name information is split into the first part of information and the second part of information according to the preset splitting rule;
[0009] According to the print preview image, determine a first gap dotted line and a second gap dotted line of a gap dotted line frame;
[0010] Determine first color printing information according to the first part of information and the first gap dotted line;
[0011] Determine second color printing information according to the second portion of information and the second gap dotted line;
[0012] A target print preview image is obtained according to the first color print information and the second color print information.
[0013] In an optional implementation, the splitting of the cigarette name information into the first part of information and the second part of information according to a preset splitting rule includes:
[0014] Obtaining a preset splitting symbol in the preset splitting rule;
[0015] Detecting the cigarette name information, when the preset splitting symbol is detected for the first time, obtaining a first splitting position of the preset splitting symbol, and splitting the cigarette name information into the first part of information and the second part of information based on the first splitting position;
[0016] When the preset splitting symbol is not detected during traversal detection of the cigarette name information, it is determined that the cigarette name information is the first part of information, and the second part of information is determined to be empty.
[0017] In an optional implementation, determining the first gap dashed line and the second gap dashed line of the gap dashed line frame according to the print preview image includes:
[0018] Obtaining the gap size between the print preview image size and the gap dashed line frame;
[0019] Determine the center line of the print preview image according to the size of the print preview image;
[0020] According to the gap dotted line frame, the rated midpoint of the gap dotted line frame is calculated;
[0021] Determine the position information of the gap dashed line frame in the print preview image according to the midline of the print preview image and the midline of the gap dashed line frame;
[0022] The first gap dotted line position and the second gap dotted line position are determined according to the position information and the gap size.
[0023] In an optional implementation, determining the first color printing information according to the first portion of information and the first gap dashed line includes:
[0024] When the first portion of information is on the left side of the first gap dashed line, determining that the first portion of information is the first color printing information;
[0025] When the first part of the information is tangent to the first gap dotted line, the tangent element tangent to the first gap dotted line is obtained, the first part of the information is wrapped according to the tangent element to obtain the first wrap partial information, and the first wrap partial information is determined to be the first color printing information.
[0026] In an optional implementation, obtaining the second color printing information according to the second portion of information and the second gap dotted line includes:
[0027] When the second portion of information is on the right side of the second gap dashed line, the second portion of information is shifted leftward based on the first element of the second portion of information, and when the first element is tangent to the second gap dashed line, the second portion of information is determined to be the second color printing information;
[0028] When the second portion of information is tangent to the second gap dashed line, the second portion of information is shifted rightward based on the first element of the second portion of information, and when the first element is tangent to the second gap dashed line, the second portion of information is determined to be the second color printing information.
[0029] In an optional embodiment, the method further comprises:
[0030] Determine a first display area on the print preview image according to the first gap dotted line;
[0031] Determine a second display area on the print preview image according to the second gap dotted line;
[0032] Performing element editing on the first color printing information according to the first display area to obtain first target color printing information;
[0033] Performing element editing on the second color printing information according to the second display area to obtain second target color printing information;
[0034] The target printing preview image is updated according to the first target color printing information and the second target color printing information.
[0035] In an optional embodiment, the method further comprises:
[0036] When the two-color printing switch is turned off, the first part of information and the second part of information are combined, and the gap dotted frame is hidden to obtain single-color printing information;
[0037] The target print preview image is updated according to the single color print information.
[0038] In a second aspect, the present application provides an adaptive dual-color ribbon printing device, the device comprising:
[0039] A data loading module, used to obtain editing information of the editing template, wherein the editing information includes cigarette name information, price information and origin information;
[0040] A graphics generation module, used to generate a print preview image according to the cigarette name information, the price information and the origin information;
[0041] An information splitting module, used for splitting the cigarette name information into a first part of information and a second part of information according to a preset splitting rule when the two-color printing switch is turned on;
[0042] A gap generation module, used for determining a first gap dotted line and a second gap dotted line of a gap dotted line frame according to the print preview image;
[0043] An information confirmation module, used for determining first color printing information according to the first part of information and the first gap dotted line;
[0044] The information confirmation module is further used to determine the second color printing information according to the second part of information and the second gap dotted line;
[0045] The graphics updating module is used to obtain a target printing preview image according to the first color printing information and the second color printing information.
[0046] In the third aspect, the present application provides a printer, the specific model of which is not limited here, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the adaptive dual-color ribbon printing method when executing the computer program.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium, including a computer program, which, when executed by a processor, implements the steps of the adaptive dual-color ribbon printing method.
[0048] In summary, the present application obtains the editing information of the editing template and generates a print preview image according to the editing information; when the two-color printing switch is turned on, the cigarette name information in the editing information is split into the first part of information and the second part of information according to the preset splitting rule; and according to the print preview image, the first gap dotted line and the second gap dotted line of the gap dotted line frame are determined; the first color printing information is determined according to the first part of information and the first gap dotted line; the second color printing information is determined according to the second part of information and the second gap dotted line; and the target print preview image is generated according to the obtained first color printing information and the second color printing information. In the process of two-color ribbon printing, the effective identification and avoidance of the ribbon gap by the printer's software system is solved, and the label quality of two-color ribbon printing is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic flow chart of an adaptive dual-color ribbon printing method according to an embodiment of the present application;
[0050] Figure 2 A schematic diagram of an adaptive dual-color ribbon printing operation process shown in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of an existing dual-color ribbon printing software editing interface shown in an embodiment of the present application;
[0052] Figure 4 for Figure 3 A printed physical image corresponding to the schematic diagram of an existing dual-color ribbon printing software editing interface;
[0053] Figure 5 A schematic diagram of an interface for editing a template of an adaptive dual-color ribbon printing software shown in an embodiment of the present application;
[0054] Figure 6 for Figure 5 A printed physical image corresponding to the schematic diagram of the template interface of an adaptive dual-color ribbon printing software editing software shown;
[0055] Figure 7 A schematic diagram of the structure of an adaptive dual-color ribbon printing device shown in an embodiment of the present application;
[0056] Figure 8 A schematic diagram of the structure of an adaptive dual-color ribbon printer shown in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.
[0058] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0059] See also Figure 1 As shown, an adaptive dual-color ribbon printing method is shown in an embodiment of the present application, including the following steps.
[0060] S11, obtaining editing information of the editing template.
[0061] The editing template refers to a structured template preset in the display interface of the dual-color ribbon printing software based on user needs. The editing information on the editing template may include cigarette editing information and font editing information.
[0062] See also Figure 5 As shown, it is a schematic diagram of an adaptive dual-color ribbon printing software editing template interface shown in the present application, in which the cigarette editing information in the figure is the cigarette retail price label, wherein the editable information includes cigarette name information, price information and origin information; the font editing information in the figure includes font name, font size and font boldness, wherein the font name uses the default font by default, and the font size and font boldness are both represented by traditional digital size numbers and thickness numbers.
[0063] It should be noted that in the editing template, different editable information can be formulated according to different user needs. Color editing information can be added to the editing template, that is, the editing information can include cigarette editing information, font editing information and color editing information. The ideal printing color can be selected based on the color editing information. In addition, detail panels can also be added based on the edit information that has been set. For example, the tar content, production date and other information of the cigarette can be added to the cigarette information on the editing template. In short, based on user needs, a variety of different types of editing templates can be set to meet the expected printing needs.
[0064] It has flexible editing functions, can be customized according to users, and supports two-color printing, thus achieving more colorful printing effects.
[0065] By adopting the above technical solution, after the user edits the information on the editing template, by obtaining the editing information of the editing template, the printer can generate a variety of different printing labels according to the user's edited label layout and content, thereby meeting the printing needs of various users.
[0066] S12, generating a print preview image according to the cigarette name information, the price information and the origin information.
[0067] Among them, the cigarette name information includes the cigarette name, cigarette brand, cigarette name font and cigarette name position on the editing template; the price information includes the price value, price font and price position; the venue information includes the venue name, venue font and venue position.
[0068] It should be noted that if other elements are added to the editing template, the corresponding information obtained will include the corresponding name, font and location information. The print preview image includes the elements of the editing template and the editing information. Based on the cigarette name information, price information and venue information in the editing elements, the print preview image is generated to obtain the actual printing label effect of the printer.
[0069] See also Figure 5 As shown, the upper part of the cigarette retail price label is the print preview image, which can be found in Figure 6 As shown, Figure 5 The printed object picture corresponding to the editing template of the adaptive two-color ribbon printing software shown in the figure. Among them, "Cigarette Retail Price Label", "Brand (Specification)", "Venue" and so on are all elements that come with the editing template, and "Yellow Crane Tower (Soft Blue)", "Hubei" and "19.00" are all editing information.
[0070] By adopting the above technical solution, the generated print preview image can reflect the actual printing effect of the printer. Through the preview image, the user can view the layout, font, color and other details of the label before actual printing to ensure that the final printing effect meets expectations.
[0071] S13, when the two-color printing switch is turned on, the cigarette name information is split into a first part of information and a second part of information according to a preset splitting rule.
[0072] Among them, the two-color printing switch refers to the switch used to control whether the printer enables the two-color printing function. When the two-color printing switch is turned on, the printer will enter the two-color ribbon printing mode. When the two-color printing switch is turned off, it enters the monochrome printing mode; the preset splitting rule refers to splitting the corresponding cigarette name information into the first part of information and the second part of information based on the pre-set splitting conditions.
[0073] For example, see Figure 6 As shown, the cigarette name information "Yellow Crane Tower (Soft Blue)", assuming that the preset splitting rule is set to use "(" as the splitting symbol, "Yellow Crane Tower (Soft Blue)" will be split into "Yellow Crane Tower" and "(Soft Blue)", where the first part of the information is "Yellow Crane Tower" and the second part of the information is "(Soft Blue)".
[0074] By adopting the above technical solution, the printing mode of the printer can be selected by controlling the two-color printing switch, thereby realizing single-color or two-color printing, and improving the flexibility and diversity of printing. At the same time, the application of the preset splitting rules makes the processing of cigarette name information more intelligent and automatic. Through the pre-set splitting conditions, the cigarette name information can be accurately divided into corresponding parts, which provides support for the subsequent printer to print the cigarette name and improves the accuracy of the printer for printing the cigarette name.
[0075] In an optional implementation, the splitting of the cigarette name information into the first part of information and the second part of information according to a preset splitting rule includes:
[0076] Obtaining a preset splitting symbol in the preset splitting rule;
[0077] Detecting the cigarette name information, when the preset splitting symbol is detected for the first time, obtaining a first splitting position of the preset splitting symbol, and splitting the cigarette name information into the first part of information and the second part of information based on the first splitting position;
[0078] When the preset splitting symbol is not detected during traversal detection of the cigarette name information, it is determined that the cigarette name information is the first part of information, and the second part of information is determined to be empty.
[0079] The preset splitting symbol refers to a specific character that is preset and used as a symbol for splitting the cigarette name information. For example, the preset splitting symbol may be "(", "·". The first splitting position refers to the symbol position when the system detects that the preset splitting symbol appears for the first time in the cigarette name information.
[0080] After obtaining the symbol identifier of the preset split symbol, the system will scan and detect the cigarette name information. When the symbol identifier is scanned for the first time, the first split position of the symbol identifier is determined. The system will divide the cigarette name information into two parts according to the first split position. The first part of the information is the content on the left side of the split symbol, and the second part of the information is the content on the right side of the split symbol and the split symbol itself. When the scanning and detection of the entire cigarette name information still does not scan the symbol identifier, the cigarette name information is used as the first part of the information, and the second part of the information is empty.
[0081] It should be noted that the scanning detection of cigarette name information is from left to right. When there are two or more symbol identifiers in the cigarette name information, the position of the symbol identifier on the left detected by the first scan will be used as the first split position during the scanning detection process; when during the scanning process, the first element in the cigarette name information is the symbol identifier, the first information part is empty and the second information part is the cigarette name information.
[0082] Through this technical solution, the system can intelligently split the cigarette name information according to the preset splitting rules, and can process it correctly even in the absence of splitting symbols, thereby ensuring the accuracy and stability of the splitting operation. At the same time, the system can classify and manage data more effectively. During the printing process, the first part of the information and the second part of the information after the split can be printed separately, realizing more printing methods for the cigarette name information.
[0083] S14, determining a first gap dotted line and a second gap dotted line of a gap dotted line frame according to the print preview image.
[0084] Among them, the gap dotted box refers to the dotted box drawn on the system print preview interface. The gap dotted box is a rectangular box composed of the first gap dotted line and the second gap dotted line, which is used to mark the position of the double-color ribbon gap. The double-color ribbon gap refers to the printing area passed by the printer head when it moves from the first printing color area to another color printing area during the actual printing process. The printed label paper in this area has a carbon ribbon and cannot be used to display printing elements.
[0085] See also Figure 5 As shown, in the upper part of the editing template, there are two dotted lines, namely the first dotted gap line and the second dotted gap line, wherein the upper and lower heights of the first dotted gap line and the second dotted gap line are the same as the height of the print preview image, and the area formed by the two is the dotted gap line box, which is located in the middle of the print preview image and is used to identify the unprintable carbon ribbon in the print ribbon.
[0086] By adopting the above technical solution, the first gap dotted line and the second gap dotted line are automatically drawn in the print preview image based on the print preview image to obtain a gap dotted line frame, which is used to identify the area that cannot be printed during the printing process. The user can identify the unprintable area based on the visualized gap dotted line frame, which can effectively avoid the situation where the printed content is missing. Printing efficiency and print quality are improved.
[0087] In an optional implementation, determining the first gap dashed line and the second gap dashed line of the gap dashed line frame according to the print preview image includes:
[0088] Obtaining the gap size between the print preview image size and the gap dashed line frame;
[0089] Determine the center line of the print preview image according to the size of the print preview image;
[0090] According to the gap dotted line frame, the rated midpoint of the gap dotted line frame is calculated;
[0091] Determine the position information of the gap dashed line frame in the print preview image according to the midline of the print preview image and the midline of the gap dashed line frame;
[0092] The first gap dotted line position and the second gap dotted line position are determined according to the position information and the gap size.
[0093] After obtaining the print preview image and the corresponding gap dashed line frame, the size information of the print preview image and the gap size information of the gap dashed line frame will be obtained, wherein the information of the gap dashed line frame is confirmed by the carbon ribbon of the print belt. In this application, the gap dashed line frame adopts a gap width of 2mm. According to the size of the print preview image, the system automatically identifies and determines the center line of the print preview image. The center line of the gap dashed line frame is determined according to the size of the gap dashed line frame, and the position information of the gap dashed line frame in the preview image is determined based on the overlap of the center lines of the two, thereby confirming the specific positions of the first gap dashed line and the second gap dashed line in the gap dashed line frame in the print preview image.
[0094] For example, assuming that the width of the editing template is 50mm and the height is 20mm, the center line of the editing template is located at 25mm, and when the gap dotted line frame is 2mm, the corresponding center line of the gap dotted line is located at the corresponding 1mm. By fitting the centers of the two, the position of the first gap dotted line is at 24mm, and the position of the second gap dotted line is at 26mm, where the upper and lower heights of the first gap dotted line and the second gap dotted line are the same as the height of the editing template.
[0095] Through the above steps, the system automatically identifies the size of the print preview image and the gap dotted line box, and determines the position of the gap dotted line box in the print preview image by aligning the center lines with each other. The position of the gap dotted line box in the print preview image and the positions of the first gap dotted line and the second gap dotted line therein can be determined with high accuracy, thereby realizing the identification and positioning of the double-color ribbon gap, allowing users to clearly understand the relationship between the dotted line position and the editing template, avoiding printing losses.
[0096] S15, determining first color printing information according to the first portion of information and the first gap dotted line.
[0097] After the cigarette name is split in detail and the first gap dotted line and the second gap dotted line are determined, the system will extract the printing information based on the split first part of the information and the first gap dotted line, that is, the first color printing information. For example, assuming that the first gap dotted line in the print preview image is determined to be 24mm of the print preview image. The first part of the information is "Yellow Crane Tower", that is, the first color printing information is "Yellow Crane Tower".
[0098] By adopting the above technical solution, the first part of the information and the position of the first gap dotted line can accurately extract the first color printing information, ensuring the accuracy of the print output, and the first color printing information determines the area that can be displayed in the print label, making the printing effect more accurate.
[0099] In an optional implementation, determining the first color printing information according to the first portion of information and the first gap dashed line includes:
[0100] When the first portion of information is on the left side of the first gap dashed line, determining that the first portion of information is the first color printing information;
[0101] When the first part of the information is tangent to the first gap dotted line, the tangent element tangent to the first gap dotted line is obtained, the first part of the information is wrapped according to the tangent element to obtain the first wrap partial information, and the first wrap partial information is determined to be the first color printing information.
[0102] When the system determines the first color printing information, the system first determines the positional relationship between the first portion of information and the first gap dotted line, ie, the left side or tangent.
[0103] When the first part of the information is on the left side of the first gap dotted line, it means that the first part of the information to be printed is not in the gap dotted line frame, that is, it belongs to the printable area, and the system directly determines it as the first color printing information.
[0104] When the first part of the information is tangent to the first gap dashed line, that is, the first part of the information is partially located in the gap dashed line frame, it means that part of the first part of the information is missing from printing. At this time, the system will obtain the element tangent to the first gap dashed line, and perform line break processing on the first part of the dashed line based on the tangent element, so that the first part of the information is displayed in two lines, that is, both lines are on the left side of the first gap dashed line, and there will be no missing printing when printing. In addition, in the entire editing template, there is no situation where the first part of the information is located on the right side of the first gap dashed line as a whole, which will not be explained in detail here.
[0105] Through the above technical solution, the positional relationship between the first part of the information and the first gap dotted line is determined, and the system can ensure that the first part of the printed information is completely displayed in the print preview. This avoids possible printing loss and ensures the integrity of the print output. When the first part of the information is tangent to the first gap dotted line, the system can automatically perform line break processing to ensure that the information is located on the left side of the dotted box when printing, thereby avoiding the situation where part of the information is cut off. The user's operating burden is reduced through automated processing and the printing quality is improved.
[0106] S16: Determine second color printing information according to the second portion of information and the second gap dotted line.
[0107] After the cigarette name is split in detail and the first gap dotted line and the second gap dotted line are determined, the system will extract the printing information based on the split second part of the information and the second gap dotted line, that is, the second color printing information, as in the technical solution of S15. For example, assuming that the second gap dotted line in the print preview image is determined to be 26 mm in the print preview image. The second part of the information is "(soft blue)", that is, the second color printing information is "(soft blue)".
[0108] By adopting the above technical solution, the second part of the information and the position of the second gap dotted line can accurately extract the second color printing information, ensuring the accuracy of the printout, and the second color printing information determines the area that can be displayed in the print label, making the printing effect more accurate.
[0109] In an optional implementation, obtaining the second color printing information according to the second portion of information and the second gap dotted line includes:
[0110] When the second portion of information is on the right side of the second gap dashed line, the second portion of information is shifted leftward based on the first element of the second portion of information, and when the first element is tangent to the second gap dashed line, the second portion of information is determined to be the second color printing information;
[0111] When the second portion of information is tangent to the second gap dashed line, the second portion of information is shifted rightward based on the first element of the second portion of information, and when the first element is tangent to the second gap dashed line, the second portion of information is determined to be the second color printing information.
[0112] When the second part of the information is located on the right side of the second gap dashed line, in order to ensure the visual quality of the print, the corresponding second detailed part will be translated to the left based on the first element until the first element is tangent to the second gap dashed line to obtain the second color print information. Figure 5 As shown, the first color printing information "Yellow Crane Tower" is located on the left side of the first gap dotted line, and the second color printing information is located on the right side of the second gap dotted line and is close to the second gap dotted line, making the print preview image more intuitive.
[0113] When the second part of the information is tangent to the second gap dotted line, it means that part of the second part of the information is in the gap dotted line frame, and printing will cause part of the printed content to be lost. The system will shift the second part of the information to the right based on the first element of the second part of the information. When the first element is tangent to the second gap dotted line, it reaches Figure 5 The display effect in the image is ensured to print the second color printing part completely. Figure 6 The printed effect is shown.
[0114] Through the above technical solution, the positional relationship between the second part of the information and the second gap dotted line is determined, and the system can ensure that the printed second part of the information is completely displayed in the print preview. This avoids possible printing loss and ensures the integrity of the print output. When the second part of the information is tangent to the second gap dotted line, the system can automatically perform a rightward translation process to ensure that the information is located on the right side of the dotted line frame when printing, thereby avoiding the situation where part of the information is cut off and causing information loss, thereby improving the printing quality.
[0115] S17, obtaining a target print preview image according to the first color print information and the second color print information.
[0116] The target print preview image refers to a preview image to be finally printed, and the target print preview image is obtained according to the corresponding information and position of the first color printing information and the second color printing information.
[0117] See also Figure 3 As shown in the figure, it is a schematic diagram of an existing two-color ribbon printing software editing interface shown in an embodiment of the present application, wherein the existing two-color printing software editing interface does not distinguish between the first color printing information and the second color printing information, and does not set a gap dotted line frame to effectively avoid the unprintable area. Figure 4 The printing effect shown is that there is accurate information printed, and the corresponding brand name color is not consistent, which affects the intuitive quality of the label.
[0118] See also Figure 6 As shown, it is a printed physical image corresponding to the schematic diagram of the interface of the adaptive dual-color ribbon printing software editing template provided by this application, which is the corresponding entity effect image of the target print preview image, where "Yellow Crane Tower" is the first part of the information and "(soft blue)" is the second part of the information. Figure 5 As shown, in the editing template, "Yellow Crane Tower" is on the left side of the first gap dotted line, and "(soft blue)" is on the right side of the second gap dotted line. The target print preview image is obtained based on the first part of the information and the second part of the information.
[0119] By adopting the above technical solution, based on the first part of information and the second part of information that have been determined, the corresponding ribbon gap position during printing can be accurately and effectively identified and avoided, thereby avoiding the loss of key information or confusion in color matching during the printing process. By generating the corresponding target print preview image, the user can more intuitively observe the corresponding printing effect, which provides a better user experience and improves the print quality.
[0120] In an optional embodiment, the method further comprises:
[0121] Determine a first display area on the print preview image according to the first gap dotted line;
[0122] Determine a second display area on the print preview image according to the second gap dotted line;
[0123] Performing element editing on the first color printing information according to the first display area to obtain first target color printing information;
[0124] Performing element editing on the second color printing information according to the second display area to obtain second target color printing information;
[0125] The target printing preview image is updated according to the first target color printing information and the second target color printing information.
[0126] The first display area refers to the area on the left side of the first gap dashed line in the editing template, and similarly, the second display area refers to the area on the right side of the second gap dashed line in the editing template. According to the different positions of the dashed lines, the first display area and the second display area of the same size at different positions can be determined.
[0127] In the first display area, the determined first color printing information can be edited by elements, which may include adding, deleting or moving specific elements to meet the needs of users or design requirements, thereby obtaining the first target color printing information. Similarly, for the second display area, the second color printing information is edited by elements to obtain the second target color printing information. The target printing preview image is updated according to the first target color printing information and the second target color printing information.
[0128] By adopting the above technical solution, the user can edit the printing information for a specific area. After determining the first color printing information and the second color printing information for the first time, the editing is performed based on the user's needs. For example, the printing color is modified in the first color printing information, and the second printing information pointer is moved to the second gap dotted line in the second color printing information, etc., so that the user can modify the corresponding elements according to the needs, and based on the determined first display area and second display area, the ribbon gap is effectively avoided, and the loss of printing information due to modification of the corresponding information is avoided, thereby enhancing personalized editing and avoiding information loss, and improving the overall printing experience efficiency and convenience.
[0129] In an optional embodiment, the method further comprises:
[0130] When the two-color printing switch is turned off, the first part of information and the second part of information are combined, and the gap dotted frame is hidden to obtain single-color printing information;
[0131] The target print preview image is updated according to the single color print information.
[0132] In this application, based on the two-color printing of the printer, the monochrome printing function is still retained. When the two-color printing switch is turned off, the system will merge the first part of the information that has been determined with the second part of the information to obtain the single-color printing information. When printing in a single color, there is no corresponding ribbon gap, and the system will automatically hide the gap dotted box used to distinguish the two colors. Ensure that only the single-color print content is displayed on the preview image, and there will be no gap display required for two-color printing.
[0133] When the generation of single color printing information and the hiding of the gap dotted frame are completed, the system will update the target print preview image according to the new print information. And when the two-color printing switch is turned on again, the above steps will be executed again to generate the two-color print preview image.
[0134] By adopting the above technical solution, the conversion from the two-color printing mode to the single-color printing mode is realized when the two-color printing switch is turned off, including generating the merged printing information, hiding the gap dotted box and updating the preview image. It allows users to flexibly select the printing mode when needed to meet different printing needs.
[0135] In summary, the present application generates a print preview image by acquiring the editing information of different editing templates; in two-color printing, the cigarette name information in the editing information can be automatically split into the first part of information and the second part of information based on the preset splitting rules; and at the same time, according to the print preview image, the first gap dotted line and the second gap dotted line of the gap dotted line box are determined; the first color printing information is determined according to the first part of information and the first gap dotted line to avoid the first color printing information appearing in the ribbon gap; the second color printing information is determined according to the second part of information and the second gap dotted line to avoid the second color printing information appearing in the ribbon gap; finally, the target print preview image is generated according to the obtained first color printing information and the second color printing information, which solves the problem of the printer effectively identifying and avoiding the ribbon gap during the two-color ribbon printing process, effectively prevents the loss of key information in the printed label, and improves the quality of the label printed with two-color ribbons.
[0136] In addition, in order to better understand the above technical solution, Figure 2 For an overall description of the above technical solution, see Figure 2 As shown, a schematic diagram of an adaptive dual-color ribbon printing operation process is shown in an embodiment of the present application.
[0137] S21, loading data template;
[0138] That is, executing the step in S11 to obtain the editing information of the editing template;
[0139] S22, generating a preview image;
[0140] That is, the step in S12 is executed to generate a print preview image based on the cigarette name information, price information, and origin information.
[0141] S23, executing operation;
[0142] When S2311 is executed and the two-color printing switch is turned on, execute:
[0143] S2312, splits the name of a cigarette into two parts;
[0144] S2313, draw a gap dashed box;
[0145] S2314, showing the two parts of the cigarette name after it is split;
[0146] The cigarette name information is split by executing S13 and S14 to obtain the first part of information and the second part of information.
[0147] When S2321 is executed and the two-color printing switch is turned off, execute:
[0148] S2322, whole block display of cigarette name;
[0149] S2323, remove the dotted line frame in the middle gap;
[0150] After turning off two-color printing, perform monochrome printing.
[0151] S24, modify the element and refresh the preview image;
[0152] You can modify the elements according to user needs to get the required preview image.
[0153] S25, printing is performed according to the preview image.
[0154] To sum up, based on the above process steps, the printer solves the problem of effectively identifying and avoiding the ribbon gap during dual-ribbon printing, effectively prevents the loss of key information in the printed label, and improves the quality of dual-ribbon printed labels.
[0155] Also, see Figure 7 As shown, an adaptive dual-color ribbon printing device 70 provided in an embodiment of the present application includes: a data loading module 701, a graphics generation module 702, an information splitting module 703, a gap generation module 704, an information confirmation module 705, a graphics update module 706, an element editing module 707 and a mode switching module 708.
[0156] The data loading module 701 is used to obtain the editing information of the editing template, and the editing information includes cigarette name information, price information and origin information.
[0157] The graphic generation module 702 is used to generate a print preview image according to the cigarette name information, the price information and the origin information.
[0158] The information splitting module 703 is used to split the cigarette name information into a first part of information and a second part of information according to a preset splitting rule when the two-color printing switch is turned on.
[0159] Furthermore, based on the alleged information splitting module 703, a preset splitting symbol in the preset splitting rule is obtained; the cigarette name information is detected, and when the preset splitting symbol is detected for the first time, the first splitting position of the preset splitting symbol is obtained, and the cigarette name information is split into the first part of information and the second part of information based on the first splitting position; when the preset splitting symbol is not detected during the traversal detection of the cigarette name information, it is determined that the cigarette name information is the first part of information, and the second part of information is determined to be empty.
[0160] The gap generating module 704 is used to determine a first gap dotted line and a second gap dotted line of a gap dotted line frame according to the print preview image.
[0161] Further, based on the gap generation module 704, the gap size between the print preview image size and the gap dashed line frame is obtained; the middle line of the print preview image is determined according to the print preview image size; the middle line of the gap dashed line frame is calculated according to the gap dashed line frame; the position information of the gap dashed line frame in the print preview image is determined according to the middle line of the print preview image and the middle line of the gap dashed line frame; the first gap dashed line position and the second gap dashed line position are determined according to the position information and the gap size.
[0162] The information confirmation module 705 is used to determine the first color printing information according to the first part of information and the first gap dotted line.
[0163] Further, based on the information confirmation module 705, when the first portion of information is on the left side of the first gap dotted line, it is determined that the first portion of information is the first color printing information; when the first portion of information is tangent to the first gap dotted line, the tangent element tangent to the first gap dotted line is obtained, and the first portion of information is wrapped according to the tangent element to obtain the first line break partial information, and the first line break partial information is determined to be the first color printing information.
[0164] Furthermore, the information confirmation module 705 is further configured to determine the second color printing information according to the second portion of information and the second gap dotted line.
[0165] Further, based on the information confirmation module 705, when the second portion of information is on the right side of the second gap dotted line, the second portion of information is shifted to the left based on the first element of the second portion of information, and when the first element is tangent to the second gap dotted line, the second portion of information is determined to be the second color printing information; when the second portion of information is tangent to the second gap dotted line, the second portion of information is shifted to the right based on the first element of the second portion of information, and when the first element is tangent to the second gap dotted line, the second portion of information is determined to be the second color printing information.
[0166] The graphic updating module 706 is used to obtain a target print preview image according to the first color printing information and the second color printing information.
[0167] The element editing module 707 is used to determine a first display area on the print preview image according to the first gap dotted line; determine a second display area on the print preview image according to the second gap dotted line; perform element editing on the first color printing information according to the first display area to obtain first target color printing information; perform element editing on the second color printing information according to the second display area to obtain second target color printing information; and obtain and update the target print preview image according to the first target color printing information and the second target color printing information.
[0168] The mode switching module 708 is used to merge the first part of information with the second part of information and hide the gap dotted frame to obtain single color printing information after turning off the two-color printing switch; and update the target print preview image according to the single color printing information.
[0169] Based on the above module, a print preview image is generated by obtaining the editing information of different editing templates; in two-color printing, the cigarette name information in the editing information can be automatically split into the first part of information and the second part of information based on the preset splitting rules; and at the same time, according to the print preview image, the first gap dotted line and the second gap dotted line of the gap dotted line box are determined; the first color printing information is determined according to the first part of the information and the first gap dotted line to avoid the first color printing information appearing in the ribbon gap; the second color printing information is determined according to the second part of the information and the second gap dotted line to avoid the second color printing information appearing in the ribbon gap; finally, a target print preview image is generated according to the obtained first color printing information and the second color printing information, which solves the problem of the printer effectively identifying and avoiding the ribbon gap during the two-color ribbon printing process, effectively prevents the loss of key information in the printed label, and improves the label quality of two-color ribbon printing.
[0170] See also Figure 8FIG. 8 is a schematic diagram of the structure of a printer according to an embodiment of the present application. In a preferred embodiment of the present application, the printer 8 includes a memory 81 , at least one processor 82 , and at least one communication bus 83 .
[0171] Those skilled in the art should understand that Figure 8 The structure of the printer shown does not constitute a limitation of the embodiments of the present application, and may be either a bus structure or a star structure. The printer may also include more or less other hardware or software than shown in the figure, or a different arrangement of components.
[0172] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium is, for example, a non-volatile memory, which is, for example: magnetic media (such as hard disks, floppy disks, and magnetic tapes), optical media (such as CDROM disks and DVDs), magneto-optical media (such as optical disks), and hardware devices specially constructed to store and execute computer-executable instructions (such as read-only memory (ROM), random access memory (RAM), flash memory, etc.). Computer-executable instructions are stored on the computer-readable storage medium. The computer-readable storage medium can be executed by one or more processors or processing devices to implement the adaptive dual-color ribbon printing method in the aforementioned embodiment.
[0173] In addition, it can be understood that the aforementioned embodiments are merely illustrative descriptions of the present application. On the premise that the technical features do not conflict, the structures do not contradict, and the purpose of the invention of the present application is not violated, the technical solutions of the various embodiments can be arbitrarily combined and used in combination.
[0174] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the system or device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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 system or unit can be electrical, mechanical or other forms.
[0175] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0176] In addition, each functional unit / module in each embodiment of the present application may be integrated into one processing unit / module, or each unit / module may exist physically separately, or two or more units / modules may be integrated into one unit / module. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of hardware plus software functional units / modules.
[0177] The above-mentioned integrated unit / module implemented in the form of a software functional unit / module can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for enabling one or more processors of a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An adaptive dual-color ribbon printing method, characterized in that: The method comprises: Acquire editing information of an editing template, wherein the editing information includes cigarette name information, price information and origin information; generate a print preview image according to the cigarette name information, the price information and the origin information; When the two-color printing switch is turned on, the cigarette name information is split into the first part of information and the second part of information according to the preset splitting rule; According to the print preview image, determine the first gap dotted line and the second gap dotted line of the gap dotted line frame, wherein the gap dotted line frame refers to a dotted line frame drawn on the system print preview interface, and the gap dotted line frame is a rectangular frame composed of the first gap dotted line and the second gap dotted line, and is used to mark the position of the dual-color ribbon gap. The dual-color ribbon gap refers to the printing area that the printer head passes through when it moves from a first printing color area to another color printing area during the actual printing process. The printed label paper in this area has a carbon ribbon and cannot be used to display printing elements; Determine first color printing information according to the first portion of information and the first gap dotted line; Determine second color printing information according to the second portion of information and the second gap dotted line; A target print preview image is obtained according to the first color print information and the second color print information.
2. The adaptive dual-color ribbon printing method according to claim 1, characterized in that: The step of splitting the cigarette name information into the first part of information and the second part of information according to the preset splitting rule includes: Obtaining a preset splitting symbol in the preset splitting rule; Detecting the cigarette name information, when the preset splitting symbol is detected for the first time, obtaining a first splitting position of the preset splitting symbol, and splitting the cigarette name information into the first part of information and the second part of information based on the first splitting position; When the preset splitting symbol is not detected during traversal detection of the cigarette name information, it is determined that the cigarette name information is the first part of information, and the second part of information is determined to be empty.
3. The adaptive dual-color ribbon printing method according to claim 2, characterized in that: Determining the first gap dotted line and the second gap dotted line of the gap dotted line frame according to the print preview image includes: Obtain the size of the gap between the print preview image and the gap dashed line frame; determine the midline of the print preview image according to the size of the print preview image; and calculate the midline of the gap dashed line frame according to the gap dashed line frame; Determine the position information of the gap dashed line frame in the print preview image according to the midline of the print preview image and the midline of the gap dashed line frame; The first gap dotted line position and the second gap dotted line position are determined according to the position information and the gap size.
4. The adaptive dual-color ribbon printing method according to claim 3, characterized in that: The determining of the first color printing information according to the first part of the information and the first gap dotted line comprises: When the first portion of information is on the left side of the first gap dashed line, determining that the first portion of information is the first color printing information; When the first part of the information is tangent to the first gap dotted line, a tangent element tangent to the first gap dotted line is obtained, the first part of the information is wrapped according to the tangent element to obtain first wrap partial information, and the first wrap partial information is determined to be the first color printing information.
5. The adaptive dual-color ribbon printing method according to claim 3, characterized in that: The obtaining of the second color printing information according to the second part of the information and the second gap dotted line comprises: When the second portion of information is on the right side of the second gap dashed line, the second portion of information is shifted leftward based on the first element of the second portion of information, and when the first element is tangent to the second gap dashed line, the second portion of information is determined to be the second color printing information; When the second portion of information is tangent to the second gap dashed line, the second portion of information is shifted rightward based on the first element of the second portion of information, and when the first element is tangent to the second gap dashed line, the second portion of information is determined to be the second color printing information.
6. An adaptive dual-color ribbon printing method according to any one of claims 1 to 5, characterized in that: The method further comprises: Determine a first display area on the print preview image according to the first gap dashed line; Determine a second display area on the print preview image according to the second gap dashed line; Performing element editing on the first color printing information according to the first display area to obtain first target color printing information; performing element editing on the second color printing information according to the second display area to obtain second target color printing information; obtaining an updated target printing preview image according to the first target color printing information and the second target color printing information.
7. The adaptive dual-color ribbon printing method according to any one of claims 1 to 5, further comprising: When the two-color printing switch is turned off, the first part of information and the second part of information are combined, and the gap dotted frame is hidden to obtain single-color printing information; The target print preview image is updated according to the single color print information.
8. An adaptive dual-color ribbon printing device, characterized in that: The device comprises: A data loading module, used to obtain editing information of the editing template, wherein the editing information includes cigarette name information, price information and origin information; a graphics generation module, used to generate a print preview image according to the cigarette name information, the price information and the origin information; an information splitting module, used to split the cigarette name information into a first part of information and a second part of information according to a preset splitting rule when the two-color printing switch is turned on; A gap generation module is used to determine a first gap dotted line and a second gap dotted line of a gap dotted line frame according to the print preview image, The gap dashed line frame refers to a dashed line frame drawn on the system print preview interface, and the gap dashed line frame is a rectangular frame composed of the first gap dashed line and the second gap dashed line, which is used to mark the position of the dual-color ribbon gap. The dual-color ribbon gap refers to the printing area that the printer head passes through when it moves from the first printing color area to another color printing area during the actual printing process. The printed label paper in this area has a carbon ribbon and cannot be used to display printing elements. An information confirmation module, used for determining first color printing information according to the first part of information and the first gap dotted line; The information confirmation module is further used to determine the second color printing information according to the second part of information and the second gap dotted line; the graphic updating module is used to obtain the target printing preview image according to the first color printing information and the second color printing information.
9. A printer, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements an adaptive dual-color ribbon printing method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of an adaptive dual-color ribbon printing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Intermittent type intelligent thermal transfer multi-head printer
CN102029804A
Label printer with double-color thermal transfer ribbon
CN215850343U