A method, apparatus, device and medium for printing variable data

By providing a variable data setting interface and overlay technology in printing technology, users can flexibly set the position and size of variable data and directly generate overlay data for printing, solving the problem of long printing time in traditional printing methods and improving printing efficiency.

CN120704623BActive Publication Date: 2026-05-05BEIJING BOYUAN HENGXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING BOYUAN HENGXIN TECH CO LTD
Filing Date
2025-08-20
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technologies, traditional printing methods require regenerating PRT format images when adding variable data, resulting in time-consuming data preprocessing and low printing efficiency.

Method used

A method for printing variable data is provided. The method displays a background image and an overlay image of variable data through a settings interface. Users can flexibly set the position and size of the variable data, and overlay the variable data onto the basic data through byte offset and bit offset to directly generate the overlay data for printing.

Benefits of technology

It improves the flexibility and efficiency of variable data printing, reduces the number of image format conversions, and shortens printing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704623B_ABST
    Figure CN120704623B_ABST
Patent Text Reader

Abstract

The application discloses a variable data printing method, device, equipment and medium, and relates to the field of planar printing.The variable data printing method comprises the following steps: in response to a selection operation on basic data, a setting interface of variable data is displayed, wherein the setting interface of variable data at least comprises a background image corresponding to the basic data; in response to a setting operation on the position and size of the basic data in the setting interface of variable data, a superimposed image corresponding to the basic data and the variable data is displayed; and in response to a printing trigger operation on the superimposed image, the variable data is superimposed on the basic data to obtain superimposed data, and printing is performed on the superimposed data. The method can improve the printing efficiency of superimposed data of the variable data and the basic data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of planar printing, and more particularly to a method, apparatus, device, and medium for printing variable data. Background Technology

[0002] In the modern printing industry, with the increasing market demand for personalization and customization, traditional printing technologies are struggling to meet these requirements. This is especially true when various variable data needs to be added to the background image. For example, before printing a sticker, the background image is white. Adding a colored sticker to this white background results in a sticker containing the sticker. During this process, the shape, size, and color of the sticker background remain unchanged, while the content of the sticker is variable. In this printing scenario, the traditional printing process acquires sticker image data in JPG, PNG, TIFF, etc. formats, and then merges the sticker image data and the sticker image data. Since JPG, PNG, and TIFF images use the RGB color space, while printers typically recognize PRT format images that include the CMYK color space, the merged JPG, PNG, and TIFF images need to be regenerated using a RIP operation to create a PRT / PRN format image that the printer can directly recognize. The printer then prints the complete sticker based on the PRT / PRN format image.

[0003] It is evident that in existing technologies, the method of regenerating the PRT format background image and the merged image of variable data before each sticker printing results in a long data preprocessing time and low printing efficiency.

[0004] Therefore, there is a technical problem in the existing technology of how to improve the printing efficiency of images obtained by stitching together variable data and background data. Summary of the Invention

[0005] The purpose of this invention is to provide a method, apparatus, device, and medium for printing variable data, so as to improve the flexibility of variable data printing.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] A method for printing variable data includes: in response to a selection operation on basic data, displaying a settings interface for variable data, wherein the settings interface for variable data includes at least a background image corresponding to the basic data; in response to a setting operation on the position and size of the basic data in the settings interface for variable data, displaying an overlay image corresponding to the basic data and the variable data; and in response to a print trigger operation on the overlay image, overlaying the variable data onto the basic data to obtain overlay data, and performing printing on the overlay data.

[0008] In one optional embodiment of this application, the step of overlaying the variable data onto the base data to obtain overlay data in response to a print trigger operation for the overlay image, and then performing printing of the overlay image, includes: associating the variable data and the base data in response to a print trigger operation for the overlay image, and determining the byte offset and bit offset of the variable data in the base data based on the position and size set for the variable data using an OR operation calculation function; overlaying the variable data onto the base data based on the byte offset and bit offset of the variable data in the base data to obtain the overlay data; and performing printing of the overlay data.

[0009] In one optional embodiment of this application, the step of superimposing the variable data onto the base data based on the byte offset and bit offset of the variable data in the base data to obtain the superimposed data includes: determining the base data bit in the base data corresponding to the variable data based on the byte offset and bit offset of the variable data in the base data; replacing the base data bit in the base data with the variable data bit corresponding to the variable data to obtain the superimposed data.

[0010] In one optional embodiment of this application, the method further includes: determining whether the basic information of the variable data matches the basic information of the basic data; and if the basic information of the variable data does not match the basic information of the basic data, replacing the basic information of the variable data with the basic information of the basic data.

[0011] In one optional embodiment of this application, the basic information of the variable data includes at least: color depth, number of colors, and resolution.

[0012] In one optional embodiment of this application, the step of displaying an overlay image corresponding to the base data and the variable data in response to setting operations for the position and size of the variable data in the setting interface of the variable data includes: obtaining position space information occupied by the variable data in the base data in response to position data input operations for the position setting control and size data input operations for the size setting control; displaying an overlay image corresponding to the base data and the variable data based on the position space information occupied by the variable data in the base data; wherein, the setting interface of the variable data includes position and size setting controls for the variable data; or, in response to a region selection operation for the background image corresponding to the base data, determining the position space occupied by the variable data in the background image; and in response to an addition operation for the variable data, adding the base data in the position space and displaying an overlay image corresponding to the base data and the variable data.

[0013] In one optional embodiment of this application, the basic data and the variable data are in PRT format.

[0014] Compared with the prior art, the variable data printing method provided by the present invention provides a variable data setting interface, which allows users to reasonably set the position and size of the variable data in the background image displayed in the variable data setting interface, and then superimpose the variable data onto the basic data to obtain superimposed data, and perform printing on the superimposed data, which helps to improve the flexibility of variable data printing.

[0015] The present invention also provides a variable data printing apparatus, comprising: a basic data display unit, configured to display a variable data setting interface in response to a selection operation on the basic data, wherein the variable data setting interface includes at least a background image corresponding to the basic data; a variable data setting unit, configured to display an overlay image corresponding to the basic data and the variable data in response to a setting operation on the position and size of the basic data in the variable data setting interface; and a data overlay printing unit, configured to overlay the variable data onto the basic data in response to a print trigger operation on the overlay image to obtain overlay data, and perform printing on the overlay data.

[0016] Compared with the prior art, the beneficial effects of the variable data printing device provided by the present invention are the same as those of the variable data printing method described in the above technical solutions, and will not be repeated here.

[0017] The present invention also provides an electronic device, comprising: a processor; a memory for storing processor-executable instructions; the processor being configured to execute the above-described method for printing variable data by running the instructions in the memory.

[0018] Compared with the prior art, the beneficial effects of the electronic device provided by the present invention are the same as those of the variable data printing method described in the above technical solution, and will not be repeated here.

[0019] The present invention also provides a computer storage medium storing instructions that, when executed, implement the above-described method for printing variable data.

[0020] Compared with the prior art, the beneficial effects of the computer storage medium provided by the present invention are the same as those of the variable data printing method described in the above technical solutions, and will not be repeated here. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0022] Figure 1 This is a flowchart illustrating a method for printing variable data, as provided in an embodiment of this application.

[0023] Figure 2 A schematic diagram of the basic data selection operation interface provided in the embodiments of this application.

[0024] Figure 3 This is a schematic diagram of the variable data setting interface provided in an embodiment of this application.

[0025] Figure 4 This is a schematic diagram of the printing settings interface provided in an embodiment of this application.

[0026] Figure 5 This is a structural diagram of a variable data printing device provided in an embodiment of this application.

[0027] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of this application.

[0028] Figure label:

[0029] 201 - Background image selection module; 202 - First background image display module;

[0030] 203 - Background Image Introduction Module; 301 - Variable Data Setting Module;

[0031] 302 - Second background image display module; 303 - Position setting control;

[0032] 304 - Color adjustment control; 305 - Font setting control;

[0033] 306 - Text settings control; 307 - Add method selection control;

[0034] 401 - Print Copies Control; 402 - Variable Data Addition Control;

[0035] 501 - Basic Data Display Unit; 502 - Variable Data Setting Unit;

[0036] 503 - Data overlay printing unit; 400 - Electronic equipment;

[0037] 410 - Processor, 4101 - First processor;

[0038] 4102 - Second processor; 420 - Communication interface;

[0039] 430 - Memory, 440 - Communication line. Detailed Implementation

[0040] To facilitate a clear description of the technical solutions in the embodiments of the present invention, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. For example, the first threshold and the second threshold are merely used to distinguish different thresholds and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" are not necessarily different.

[0041] It should be noted that in this invention, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0042] In this invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a combination of a and b, a combination of a and c, a combination of b and c, or a, b, and c, where a, b, and c can be single or multiple.

[0043] In the modern printing industry, as the market demands for printing efficiency of spliced ​​images continue to increase, traditional printing technologies are finding it increasingly difficult to meet these requirements. This is especially true in scenarios where variable data needs to be added to a background image. Current technologies typically involve adding variable data in JPG, PNG, or TIFF formats to a specified location within the background image, and then regenerating a printer-readable PRT format. However, this method requires regenerating the entire PRT format image's data content when the variable data changes, resulting in low printing efficiency.

[0044] Therefore, how to improve the printing efficiency in scenarios where variable data and background data are superimposed has become a technical problem that urgently needs to be solved by those skilled in the art.

[0045] To address the aforementioned technical problems, this application provides a method, apparatus, device, and medium for printing variable data, which will be described in detail in the following embodiments.

[0046] This application first provides a method for printing variable data. Please refer to... Figure 1 , Figure 1 This is a flowchart illustrating a method for printing variable data, as provided in an embodiment of this application.

[0047] like Figure 1 As shown, the method for printing variable data includes the following steps S101 to S103.

[0048] S101, in response to the selection operation for basic data, display the settings interface for variable data, wherein the settings interface for variable data includes at least the background image corresponding to the basic data.

[0049] The basic data can be understood as the basic data of the background image of the variable data to be printed. Specifically, the basic data includes the constituent elements and attributes of the background image. The constituent elements include the pixels and resolution of the image, and the attributes of the background image include information such as the image size, format, and color space.

[0050] The variable data is also a type of variable data, specifically the basic data of images such as QR codes and barcodes that need to be printed on the background image. For example, when a user creates a promotional poster, they need to add payment codes, business card codes, etc., to the background image of the poster so that users can scan the codes with their mobile phones to learn more about the content advertised on the poster. In this case, the basic data of the payment code and business card code is the variable data.

[0051] In practical applications, the above S101 is implemented based on the selection operation interface of basic data. Please refer to [link / reference]. Figure 2 , Figure 2 A schematic diagram of the basic data selection operation interface provided in the embodiments of this application.

[0052] like Figure 2 As shown, the basic data selection operation interface includes: a background image selection module 201, a first background image display module 202, and a background image introduction module 203.

[0053] The background image selection module 201 includes multiple pre-input selectable background images. Users can click on any of the background images to display the corresponding background image in the first background image display module 202. At the same time, the background image introduction module 203 will display the basic data of the background image and the printer's printing status, such as resolution, number of colors, number of ink dots, width, height, and whether the printer is ready.

[0054] In the basic data selection interface, users can select a suitable background image by clicking on the names of the various background images provided in the background image selection module 201 and browsing the display effects of each background image.

[0055] In one optional embodiment of this application, the basic data and the variable data can be PRT format files to avoid converting image data in formats such as JPG, PNG, and TIFF back to PRT format, thereby saving printing time.

[0056] S102, in response to the setting operation of the position and size of the basic data in the setting interface of the variable data, display the superimposed image corresponding to the basic data and the variable data.

[0057] Furthermore, users can select a suitable background image by double-clicking to confirm and enter the variable data settings interface.

[0058] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the variable data setting interface provided in an embodiment of this application.

[0059] like Figure 3 As shown, the variable data setting interface includes: a variable data setting module 301 and a second background image display module 302.

[0060] In this embodiment of the application, in order to facilitate users to flexibly adjust the data format of variable data and improve the flexibility of variable data settings, the variable data setting module 301 includes a variable data position setting control 303, a color adjustment control 304, a font setting control 305, a text setting control 306, and an addition method selection control 307.

[0061] In practical applications, users can use the position setting control 303 to select the position of the variable data in the background image, such as adding the x-axis and y-axis coordinates of the variable data to the position setting control 303, thereby completing the position setting of the variable data.

[0062] When the user needs to adjust the size of the variable data, the width and height of the variable data can also be adjusted in the position setting control 303, such as by adjusting W (Width) and H (Height) in the position setting control 303, thereby realizing the size setting of the variable data.

[0063] In another optional embodiment of this application, the setting of the size and position of the image corresponding to the variable data can be based on the user's region selection operation on the background image, thereby determining the spatial position occupied by the variable data in the background image. In this case, the position and size corresponding to the variable data will be directly reflected in the position setting control 303 after the user completes the region selection operation on the background image.

[0064] The color adjustment control 304 is used to adjust the color information of the variable data. For example, when the image corresponding to the variable data is a QR code, the color of the QR code can be adjusted to black and white so that relevant personnel can find the QR code in time. Alternatively, the color of the QR code can be adjusted to match the background image so that the display of the QR code does not affect the display effect of the background image.

[0065] Furthermore, the text setting control 306 is used to add text data to the variable data. For example, if the image corresponding to the variable data is a barcode, the user can add the number string corresponding to the barcode to the text setting control 306.

[0066] Furthermore, the font settings control 305 is used to adjust the text format, such as text size and font, added by the user in the text settings control 306.

[0067] After the user completes the settings for the variable data, the image corresponding to the variable data can be overlaid on the background image so that the user can view the display effect of the overlaid image.

[0068] The addition method selection control 307 is used for users to select either the blending mode or the overlay mode (not shown in the figure). In actual application, the printer will execute the corresponding algorithm according to the mode selected by the user, and then complete the corresponding variable data addition work.

[0069] Specifically, when the user selects the blending mode, the variable data, such as the position, color, and size selected by the user, is overlaid onto the background image. After the user confirms that the display effect is correct, the printer executes an OR operation calculation function to obtain the overlaid data, and then completes the printing of the overlaid data.

[0070] When the user selects the overlay mode, the printer overlays the variable data onto the background image according to the position, color, size, and other information of the variable data selected by the user. After the user confirms that the display effect is correct, the printer executes the AND operation calculation function to replace the pixel values ​​of the background image in the specified area with the pixel values ​​of the variable data.

[0071] In another optional embodiment of this application, before entering the setting interface of the variable data from the basic data selection operation interface, the selection operation interface further includes a print setting interface.

[0072] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the printing settings interface provided in an embodiment of this application.

[0073] like Figure 4 As shown, the print settings interface includes: a print count control 401 and a variable data addition control 402.

[0074] Users can adjust the number of copies of the content to be printed by editing the print count control 401, and enter the settings interface of the variable data by triggering the control 402 added to the variable data.

[0075] S103, in response to a print trigger operation for the overlay image, the variable data is overlaid onto the base data to obtain overlay data, and printing of the overlay data is performed.

[0076] It's important to note that since most users don't have RIP software installed, the image files they provide when assigning print jobs are typically in RGB color space formats such as JPG, PNG, and TIFF. Printer manufacturers have RIP software installed, which can convert user-provided JPG, PNG, and TIFF images into PRT or PRN formats that the printer can directly recognize. However, the process of converting JPG, PNG, and TIFF images to PRN or PRT formats using RIP software is time-consuming. This leads to a situation where, if variable data changes, the underlying data and variable data of the original JPG, PNG, or TIFF format are overlaid, resulting in a stacked JPG, PNG, or TIFF image. Converting this stacked data to PRN or PRT formats using RIP software is also time-consuming. This repeated change of variable data and regeneration, along with repeated format conversions of the entire image data, results in low printing efficiency.

[0077] In an optional embodiment, for example, in a scenario where a user needs to print stickers, the background of the sticker is a fixed image, which can be a solid color image or an image with a pattern. That is, the background data of the sticker is unchanging. Therefore, the background data of the sticker can be used as the basic data, and RIP software can be used to convert the basic data in formats such as JPG, PNG, and TIFF into PRT format background data. For the image of the sticker background, which is usually a patterned image, the data corresponding to the sticker is used as variable data. When the sticker data in formats such as JPG, PNG, and TIFF changes, the variable data in PRT format can be regenerated based on the variable data in formats such as JPG, PNG, and TIFF. In this embodiment, since the sticker on the sticker is a changing pattern, the existing process of merging basic data and variable data in formats such as JPG, PNG, and TIFF to regenerate PRT-formatted overlay data can be optimized. Instead, the process involves generating PRT-formatted basic data from the basic data in JPG, PNG, and TIFF formats, storing it in a preset storage space, and then generating PRT-formatted variable data based on the variable data when the JPG, PNG, and TIFF formats change. In other words, the basic data only needs one image format conversion, while the changing variable data undergoes multiple format conversions. Finally, the PRT-formatted variable data and the PRT-formatted basic data are merged to obtain the PRT-formatted overlay data. Compared to existing solutions, the solution in this embodiment requires significantly less image data to be converted. It eliminates the need to convert all the overlay data obtained by merging basic data in JPG, PNG, TIFF, and other formats with variable data in these formats. Only the basic data in JPG, PNG, TIFF, and other formats needs to be converted once, while the variable data in these formats that have changed a preset number of times needs to be converted a preset number of times. This greatly reduces the amount of data that needs to be converted and improves printing efficiency.

[0078] In an optional embodiment, software can be designed to merge variable data and basic data and view the merging effect. A coordinate system, i.e., a basic data coordinate system, can be pre-established corresponding to the software's display interface. The initial establishment of this coordinate system can be based on the resolution input by relevant personnel. Subsequent coordinate systems can be established based on a preset resolution, which can also be set based on past usage data. The preset resolution can be obtained through the following steps: calculate the average resolution of all print jobs in the past print job data, remove print jobs with resolutions greater than a first multiple of the average resolution, and print jobs with resolutions less than a second multiple of the average resolution, to obtain the first set of all print jobs. Here, the first multiple is greater than 1, and the second multiple is less than 1 but greater than 0. Optionally, the first multiple can be 3, and the second multiple can be 0.3. The first and second multiples can be set by relevant personnel. Sort the resolutions of the first set of all print jobs from high to low, and use the resolution of the job corresponding to the 30th percentile as the preset resolution. After establishing the coordinate system based on the preset resolution, the resolution of the coordinate system can also be adjusted according to the resolution input by the user. In this embodiment, after acquiring past print jobs, print job samples with excessively large or small resolutions are first removed to reduce the impact of special print jobs on the acquisition of the preset resolution. The first batch of all print jobs, after removing special data, are sorted from highest to lowest resolution. A coordinate system is established based on the resolution corresponding to the 30% of print jobs in the sorted list. This coordinate system satisfies the display requirements of most print jobs while avoiding excessive pixel position coordinates, ensuring high versatility and low complexity. The coordinate system resolution can be adjusted based on user input after its establishment, offering high flexibility. Compared to existing technologies that establish the coordinate system in real-time based on the data to be printed, this method establishes the coordinate system before the data is transmitted to the system, resulting in stronger real-time display.

[0079] After the user completes the settings for the variable data, the overlay image is displayed. In this case, the image only shows the overlay effect. In the actual printing process, the variable data needs to be further overlaid onto the base data to obtain the overlay data, so that the printer can complete the printing based on the overlay data. In order to directly add the overlay image to the background image corresponding to the base data, instead of removing a part of the background image and then adding the overlay image to the removed blank part as in the prior art, thereby improving printing efficiency, the process of overlaying the variable data onto the base data to obtain the overlay data includes: in response to a print trigger operation for the overlay image, associating the variable data and the base data, and determining the byte offset and bit offset of the variable data in the base data according to the position and size set for the variable data using an OR operation calculation function or an AND operation calculation function; and overlaying the variable data onto the base data based on the byte offset and bit offset of the variable data in the base data to obtain the overlay data.

[0080] That is, by combining the position and size of the variable data, the byte offset of the variable data in the basic data is determined. If the byte offset of the variable data in the basic data is less than one byte, the bit offset of the variable data is further calculated to complete the positioning of the variable data and realize the alignment of the basic data and the variable data.

[0081] Furthermore, after aligning the basic data and the variable data, based on the byte offset and bit offset of the variable data in the basic data, the basic data bits in the basic data corresponding to the variable data are determined; the basic data bits in the basic data are replaced with the variable data bits corresponding to the variable data to obtain the superimposed data.

[0082] That is, when a bit of the variable data is 1, the corresponding bit of the basic data is set to 1 at the same time, thereby realizing the superposition of the basic data and the variable data to obtain the superimposed data.

[0083] In this embodiment, it is necessary to determine the region where the variable data is located within the basic data. This can be achieved by determining the coordinates of the variable data input by the user, or by determining the region selected by the user using the mouse cursor.

[0084] The method for determining the region of variable data based on user-input coordinates is as follows: A variable data coordinate system is established based on the variable data in PRT format. The pixel with the smallest x-coordinate among the first pixel of each row in the variable data coordinate system is taken as the first pixel. The pixel with the smallest y-coordinate among the first pixel of each column in the variable data coordinate system is taken as the second pixel. The user can choose to input either x-coordinates or y-coordinates. When the user selects x-coordinates, the system merges the basic data and variable data based on the user-input x-coordinate of the second pixel. When the user selects y-coordinates, the system merges the basic data and variable data based on the user-input y-coordinate of the first pixel. The region corresponding to the merged variable data is taken as the region of variable data within the basic data.

[0085] The method for determining the region of variable data in the basic data based on the area selected by the user using the mouse arrow is as follows: The area selected by the user using the mouse arrow can be the position selected by the mouse on the display interface after the user selects the region. Calculate the centroid of the variable data, merge the centroid of the variable data with the position selected by the mouse, and take the region corresponding to the merged variable data as the region of the variable data in the basic data.

[0086] After obtaining the region of variable data within the base data, the x-coordinate of the first pixel of the variable data in the base data coordinate system is obtained row by row. The x-coordinate is divided by 8 to obtain the byte offset of that row, and the remainder is the bit offset. This calculation process is repeated to calculate the byte offset and bit offset of each pixel in each row of the variable data in the base data coordinate system. Based on the byte offset and bit offset, the pixel data in the variable data is pasted into the base data. Specifically, the pasting process can be performed byte by byte, avoiding the inefficiency of pasting pixels one by one according to coordinate values.

[0087] In one optional embodiment of this application, during the overlay of basic data and variable data, it is also necessary to consider the data matching between the basic data and the overlay data. For example, when the image resolution reflected by the basic data is 3840×2160 pixels and the image resolution reflected by the variable data is 2048×1080 pixels, it is quite difficult to achieve the overlay of the two types of data in the field of printing technology. Therefore, it is necessary to make appropriate adjustments to the two types of data.

[0088] Specifically, the method for printing variable data further includes: determining whether the basic information of the variable data matches the basic information of the basic data; and if the basic information of the variable data does not match the basic information of the basic data, replacing the basic information of the variable data with the basic information of the basic data.

[0089] The basic information of the variable data and the basic data includes at least: color depth, number of colors, resolution, etc.

[0090] That is, in the case where the basic information of the variable data does not match the basic information of the basic data, the basic information of the variable data is replaced with the basic information of the basic data so that the variable data is consistent in dimensions such as color depth, number of colors, and resolution, thus solving the problem of difficulty in superimposing different types of data.

[0091] Specifically, please refer to the following example. The basic information can be reflected in the file information of variable data and basic data in the following ways.

[0092] int nImagagewidth; / / RIP Image pixel width

[0093] int nImagewidth; / / RIP Image pixel height

[0094] int nImageColorNum; / / RIP image Color number indude 4 (YMCK)

[0095] / / 6 YMCKWV

[0096] / / See the following comment for Ricoh 8Color Printer.

[0097] int nImageColorDeep; / / 1,2 RIP image output bitper color

[0098] int nImageResolutionX; / / RIP image X resolution,300,600

[0099] int nImageResolutionY; / / RIP image X resolution ,300,600,900,1200

[0100] The following parameters are used: "nImageWidth; / / RIP Image pixel width" represents the pixel width of the image, storing the number of pixels in the horizontal direction. For example, if an image is 800 pixels wide, then the value of nImageWidth is 800; "nImageHeight; / / RIP Image pixel height" represents the pixel height of the image, storing the number of pixels in the vertical direction. For example, if an image is 600 pixels high, then the value of nImageHeight is 600; "nImageColorNum" represents the number of color channels in the image; "YMCK" represents the four colors: Yellow, Magenta, Cyan, and Key / Black; "YMCKWV" represents the colors White and Varnish in addition to YMCK; "Ricoh 8Color Printer" indicates an 8-color printer; "nImageColorDeep" represents the chromaticity of each color channel. If each color channel uses 1 bit, then the value of "nImageColorDeep" is 1. If each color channel uses 2 bits, then the value of "nImageColorDeep" is 2; "nImageResolutionX" represents the horizontal resolution of the image, storing the number of dots per inch (DPI) in the horizontal direction. Common values ​​are 300 DPI and 600 DPI. If the horizontal resolution of the image is 300 DPI, then the value of "nImageResolutionX" is 300; if the horizontal resolution of the image is 600 DPI, then the value of "nImageResolutionX" is 600. "nImageResolutionY" represents the vertical resolution of the image, storing the number of dots per inch (DPI) in the vertical direction. Common values ​​are 300 DPI, 600 DPI, 900 DPI, and 1200 DPI. If the vertical resolution of the image is 300 DPI, then the value of "nImageResolutionY" is 300; if the vertical resolution of the image is 600 DPI, then the value of "nImageResolutionY" is 600. If the vertical resolution of the image is 900 DPI, then the value of "nImageResolutionY" is 900. If the vertical resolution of the image is 1200 DPI, then the value of "nImageResolutionY" is 1200.

[0101] Furthermore, when the basic information of the variable data does not match the basic information of the base data, the basic information of the variable data is replaced with the basic information of the base data. For example, if the resolution of the variable data is inconsistent with the resolution of the base data, the resolution of the variable data is adjusted to the resolution of the base data; or, for example, if the color depth of the variable data is inconsistent with the color depth of the base data, the color depth of the variable data is adjusted to the color depth of the base data.

[0102] In an optional embodiment, for example, the sticker background is used as the basic data, and the sticker itself is used as the variable data. Basic data in formats such as JPG, PNG, and TIFF, input by the user, is obtained, converted to PRT format, and then displayed on the basic data coordinate system of the printing software's display interface. The area of ​​the variable data within the basic data is obtained based on the user's input, and the variable data and basic data are merged. In this embodiment, the size of the sticker within the sticker background can be adjusted arbitrarily, meaning the size of the variable data within the basic data can also be adjusted arbitrarily. For example, in a sticker printing scenario, the user can adjust the size of the variable data in real time according to the sticker design requirements. For instance, in a character face sticker, there are eye components, nose components, mouth components, hair components, and cheek components. The user can copy and paste the eye components and adjust their size after pasting. Similarly, the user can copy and paste the mouth sticker and adjust its size, thus allowing for the combination and arrangement of different facial components after printing to meet user needs.

[0103] In one alternative approach, the size, resolution, number of colors, and color depth of the variable data need to be adjusted in real time to achieve matching and fusion between the variable data and the basic data. For example, in a business card printing scenario, there is a need to add QR codes for users' social media applications. In this case, adding a traditional QR code composed of black and white lines would affect the overall appearance of the business card. Therefore, in one embodiment of this application, the basic information of the variable data can be adjusted so that the image corresponding to the variable data can be matched and fused into the image corresponding to the basic data without losing its functionality.

[0104] Therefore, upon receiving a size adjustment command for variable data, the system retrieves the number of colors, color depth, and resolution of the base data, and adjusts these parameters accordingly. Specifically, it retrieves the color depth of both the base and variable data. When the color depths differ, it maps the variable data's color depth back to the base data's color depth, thus adjusting the variable data's color depth. Printing commonly uses 1-bit and 2-bit color depths. With a 1-bit depth, 0 represents no ink droplets, and 1 represents ink droplets. With a 2-bit depth, 00 represents no ink droplets, 01 represents small ink droplets, 10 represents medium ink droplets, and 11 represents large ink droplets. When the base data has a 1-bit color depth and the variable data has a 2-bit color depth, the variable data's color depth is mapped from 2-bit to 1-bit, mapping 00 to 0 and 01, 10, and 11 to 1. When the base data is 2-bit color depth and the variable data is 1-bit color depth, the color depth in the variable data is mapped from 1-bit color depth to 2-bit color depth. In this embodiment, a dithering algorithm can be used for data mapping, which can preserve the details in the image and reduce mapping distortion.

[0105] Regarding the number of colors in the basic data, the commonly used number of colors in the printing process are four-color and six-color. Four-color refers to C (cyan), M (magenta), Y (yellow), and K (black), while six-color refers to adding Lc (light cyan) and Lm (light magenta) to the CMYK four-color system. If the number of colors in the acquired basic data and variable data differs from the number of colors in the basic data, when the basic data is six-color and the variable data is four-color, the user-inputted cyan and magenta conversion ratios are obtained. The cyan ink volume corresponding to the basic data is multiplied by the conversion ratio to obtain the light cyan ink volume, and the magenta ink volume corresponding to the basic data is multiplied by the conversion ratio to obtain the light magenta ink volume. When the basic data is four-color and the variable data is six-color, the light cyan ink volume and cyan ink volume corresponding to the basic data are added together to obtain the converted cyan ink volume, and the light magenta ink volume and magenta ink volume corresponding to the basic data are added together to obtain the converted magenta ink volume.

[0106] Regarding the resolution of basic and variable data, if it is determined that the resolutions of the variable and basic data are different based on the acquired basic and variable data, when the resolution of the basic data is greater than that of the variable data, interpolation is used to convert the resolution of the variable data to that of the basic data. When the resolutions of the basic and variable data are not multiples of each other, a deformation algorithm is used to correct the image data of the variable data after conversion. When the resolution of the basic data is less than that of the variable data, a method of equally spaced pixel removal is used to convert the resolution of the variable data to that of the basic data. When the resolutions of the basic and variable data are not multiples of each other, a deformation algorithm is used to correct the image data of the variable data after conversion.

[0107] Furthermore, considering that different variable data are printed at the same position and size of the same basic data, existing technologies usually need to add each variable data to the basic data sequentially. Since the amount of variable data is small, but the amount of basic data is large, the basic data needs to be repeatedly processed and identified for each print, which results in a long time to generate a new print file and thus a long printing time.

[0108] In another optional embodiment of this application, in order to more easily add different variable data, when there is only one background image corresponding to the basic data, multiple different variable data can be stored in the database, thereby realizing batch printing of the multiple variable data.

[0109] That is, the step of responding to a print trigger operation for the overlay image, overlaying the variable data onto the base data to obtain overlay data, and performing printing on the overlay data includes: responding to a print trigger operation for the overlay image, determining the number of times the user will repeatedly print multiple variable data in the database; sequentially overlaying each of the variable data onto the base data to obtain overlay data corresponding to each of the variable data; and sequentially performing repeated printing on each of the overlay data based on the number of repeated printings.

[0110] For example, a user imports 10 different QR codes from a database, and then... Figure 4 The print count control 401 in the print settings interface is used to add the print count, and in the following way... Figure 3 After setting the position and size of the variable data in the variable data settings interface shown, the printer can sequentially add the images corresponding to each variable data to the background image, so that the printer can print the images corresponding to each variable data on the background image according to the number of copies to be printed.

[0111] In summary, the variable data printing method provided in this application, by providing a variable data setting interface, allows users to reasonably set the position and size of the variable data in the background image displayed in the variable data setting interface, and then superimpose the variable data onto the basic data to obtain superimposed data, and perform printing on the superimposed data, which helps to improve the flexibility of variable data printing.

[0112] This application also provides a variable data printing device, please refer to... Figure 5 , Figure 5 This is a structural diagram of a variable data printing device provided in an embodiment of this application.

[0113] like Figure 5As shown, the variable data printing device includes:

[0114] The basic data display unit 501 is used to display the settings interface of variable data in response to the selection operation of basic data, wherein the settings interface of variable data includes at least the background image corresponding to the basic data.

[0115] The variable data setting unit 502 is used to display an overlay image corresponding to the basic data and the variable data in response to the setting operation of the position and size of the basic data in the variable data setting interface.

[0116] The data overlay printing unit 503 is configured to, in response to a print trigger operation for the overlay image, overlay the variable data onto the base data to obtain overlay data, and perform printing on the overlay data.

[0117] In one optional embodiment of this application, the step of overlaying the variable data onto the base data to obtain overlay data in response to a print trigger operation for the overlay image, and then performing printing of the overlay image, includes: associating the variable data and the base data in response to a print trigger operation for the overlay image, and determining the byte offset and bit offset of the variable data in the base data based on the position and size set for the variable data using an OR operation calculation function; overlaying the variable data onto the base data based on the byte offset and bit offset of the variable data in the base data to obtain the overlay data; and performing printing of the overlay data.

[0118] In one optional embodiment of this application, the step of superimposing the variable data onto the base data based on the byte offset and bit offset of the variable data in the base data to obtain the superimposed data includes: determining the base data bit in the base data corresponding to the variable data based on the byte offset and bit offset of the variable data in the base data; replacing the base data bit in the base data with the variable data bit corresponding to the variable data to obtain the superimposed data.

[0119] In an optional embodiment of this application, the device is further configured to: determine whether the basic information of the variable data matches the basic information of the basic data; and, if the basic information of the variable data does not match the basic information of the basic data, replace the basic information of the variable data with the basic information of the basic data.

[0120] In one optional embodiment of this application, the basic information of the variable data includes at least: color depth, number of colors, and resolution.

[0121] In one optional embodiment of this application, the step of displaying an overlay image corresponding to the base data and the variable data in response to setting operations for the position and size of the variable data in the setting interface of the variable data includes: obtaining position space information occupied by the variable data in the base data in response to position data input operations for the position setting control and size data input operations for the size setting control; displaying an overlay image corresponding to the base data and the variable data based on the position space information occupied by the variable data in the base data; wherein, the setting interface of the variable data includes position and size setting controls for the variable data; or, in response to a region selection operation for the background image corresponding to the base data, determining the position space occupied by the variable data in the background image; and in response to an addition operation for the variable data, adding the base data in the position space and displaying an overlay image corresponding to the base data and the variable data.

[0122] In one optional embodiment of this application, the basic data and the variable data are in PRT format.

[0123] The apparatus embodiments provided in this example belong to the same application concept as the method embodiments of this application. They can execute the variable data printing method provided in any of the above embodiments of this application, and have the corresponding functional modules and beneficial effects for executing the variable data printing method. Technical details not described in detail in this example can be found in the specific processing content of the variable data printing method provided in the above embodiments of this application, and will not be repeated here.

[0124] This application also provides an electronic device, please refer to... Figure 6 , Figure 6 This is a structural diagram of an electronic device provided in an embodiment of this application.

[0125] like Figure 6 As shown, the electronic device 400 includes a processor 410.

[0126] like Figure 6 As shown, the processor 410 described above can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention.

[0127] like Figure 6 As shown, the electronic device 400 may further include a communication line 440. The communication line 440 may include a path for transmitting information between the components.

[0128] Optional, such as Figure 6 As shown, the above-described electronic device may further include a communication interface 420. There may be one or more communication interfaces 420. The communication interface 420 may use any transceiver-like device for communicating with other devices or communication networks.

[0129] Optional, such as Figure 6 As shown, the electronic device may further include a memory 430. The memory 430 stores computer execution instructions for implementing the present invention, and its execution is controlled by a processor. The processor executes the computer execution instructions stored in the memory to implement the method provided in the embodiments of the present invention.

[0130] like Figure 6 As shown, memory 430 can be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 430 can exist independently and be connected to processor 410 via communication line 440. Memory 430 can also be integrated with processor 410.

[0131] Optionally, the computer execution instructions in the embodiments of the present invention may also be referred to as application code, and the embodiments of the present invention do not specifically limit this.

[0132] In a specific implementation, as one example, such as Figure 6 As shown, processor 410 may include one or more CPUs, such as Figure 6 CPU0 and CPU1 in the CPU.

[0133] In a specific implementation, as one example, such as Figure 6 As shown, the terminal device may include multiple processors, such as Figure 6 The first processor 4101 and the second processor 4102 are included. Each of these processors can be a single-core processor or a multi-core processor.

[0134] The methods disclosed in the above embodiments of the present invention can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0135] This application also provides a computer-readable storage medium storing instructions that, when executed, implement the functions performed by the terminal device in the above embodiments.

[0136] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are performed entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a terminal, a user equipment, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as a solid-state drive (SSD).

[0137] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings, the disclosure, and the appended claims in carrying out the claimed invention. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0138] Although the invention has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made therein without departing from the spirit and scope of the invention. Accordingly, this specification and drawings are merely exemplary descriptions of the invention as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if such modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include such modifications and modifications.

Claims

1. A method for printing variable data, characterized in that, include: In response to a selection operation on the basic data, a settings interface for the variable data is displayed, wherein the settings interface for the variable data includes at least a background image corresponding to the basic data; the basic data and the variable data are in PRT format; Determine whether the basic information of the variable data matches the basic information of the base data; wherein, the basic information of the variable data includes at least: the number of color depth bits of the ink droplets when the printer prints the image, the number of ink colors, and the resolution; If the basic information of the variable data does not match the basic information of the base data, the basic information of the variable data is replaced with the basic information of the base data. If the resolution of the variable data is inconsistent with the resolution of the base data, the resolution of the variable data is adjusted to the resolution of the base data. When the resolution of the base data is greater than that of the variable data, interpolation is used to convert the resolution of the variable data to the resolution of the base data. When the resolutions of the base data and the variable data are not multiples of each other, a deformation algorithm is used to correct the image data of the variable data after conversion. If the resolution of the base data is less than that of the variable data, the resolution of the variable data is converted to the resolution of the base data by removing pixels at equal intervals. When the resolutions of the base data and the variable data are not multiples of each other, a deformation algorithm is used to correct the image data of the variable data after conversion. If the color depth of the variable data is inconsistent with that of the base data, the color depth of the variable data is adjusted to the color depth of the base data. In response to the setting operation of the position and size of the variable data in the setting interface of the variable data, an overlay image corresponding to the base data and the variable data is displayed; in response to the print trigger operation of the overlay image, the variable data and the base data are associated, and the byte offset and bit offset of the variable data in the base data are determined according to the position and size of the variable data set by the OR operation calculation function or the AND operation calculation function. Based on the byte offset and bit offset of the variable data in the base data, the variable data is superimposed on the base data to obtain superimposed data. The superposition process is performed in units of bytes. That is, by combining the position and size of the variable data, the byte offset of the variable data in the base data is determined. If the byte offset of the variable data in the base data is less than one byte, the displacement offset of the variable data is further calculated to complete the positioning of the variable data and achieve the alignment of the base data and the variable data. Perform printing of the overlay data; The method of displaying an overlay image corresponding to the base data and the variable data in response to setting operations for the position and size of the variable data in the settings interface of the variable data includes: In response to position data input operations for the position setting control and size data input operations for the size setting control, the position space information occupied by the variable data in the basic data is obtained; based on the position space information occupied by the variable data in the basic data, an overlay image corresponding to the basic data and the variable data is displayed; wherein, the setting interface of the variable data includes position and size setting controls for the variable data; Alternatively, in response to a region selection operation for the background image corresponding to the basic data, the position space occupied by the variable data in the background image is determined; in response to an addition operation for the variable data, the basic data is added to the position space, and an overlay image corresponding to the basic data and the variable data is displayed.

2. The method for printing variable data according to claim 1, characterized in that, The variable data is superimposed onto the base data based on the byte offset and bit offset of the variable data in the base data to obtain the superimposed data, which includes: Based on the byte offset and bit offset of the variable data in the basic data, determine the basic data bit in the basic data that corresponds to the variable data; The basic data bits in the basic data are replaced with the variable data bits corresponding to the variable data to obtain the superimposed data.

3. A variable data printing device, characterized in that, include: The basic data display unit is used to display the settings interface for variable data in response to the selection operation of basic data, wherein the settings interface for variable data includes at least the background image corresponding to the basic data. A variable data setting unit is used to display an overlay image of the basic data and the variable data in response to setting operations for the position and size of the variable data in the variable data setting interface. A data overlay printing unit is configured to, in response to a print trigger operation for the overlay image, associate the variable data with the base data, and determine the byte offset and bit offset of the variable data in the base data based on the position and size set for the variable data using an OR operation calculation function or an AND operation calculation function; overlay the variable data onto the base data based on the byte offset and bit offset of the variable data in the base data to obtain overlay data, wherein the overlay process is performed byte by byte; and execute the printing of the overlay data. The variable data printing device is further configured to determine whether the basic information of the variable data matches the basic information of the basic data; wherein, the basic information of the variable data includes at least: the number of color depth bits of the ink droplets when the printer prints the image, the number of ink colors, and the resolution; if the basic information of the variable data does not match the basic information of the basic data, the basic information of the variable data is replaced with the basic information of the basic data.

4. An electronic device, characterized in that, include: Memory used to store processor-executable instructions; The processor is configured to execute the variable data printing method according to any one of claims 1 to 2 by running instructions in the memory.

5. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed by a processor, implement the variable data printing method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Variable two-dimensional code image real-time printing method and device, equipment and medium

    CN113377309A

  • Method for generating two-dimensional code poster based on Canvas dragging

    CN119376602A