Variable data printing method and device, equipment and medium
By setting the position and size of variable data on the printing interface and superimposing the variable data on the basic data using byte offset and bit offset, the problem of low printing efficiency in traditional printing methods is solved, and fast and efficient variable data printing is achieved.
Patent Information
- Application Number
- CN202511166217.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-08-20
AI Technical Summary
In the prior art, traditional printing methods require regenerating images in PRT format when adding variable data, resulting in a time-consuming data preprocessing process and low printing efficiency.
A method for printing variable data is provided. The superimposed image of basic data and variable data is displayed through a setting interface. The user can set the position and size of the variable data on the interface, and superimpose the variable data on the basic data through byte offset and bit offset to achieve fast printing.
It improves the flexibility and efficiency of variable data printing, reduces the number of image format conversions, and increases the processing speed of the printer.
Smart Images

Figure CN120704623A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of plane printing, and in particular to a method, device, equipment and medium for printing variable data. Background Art
[0002] In the modern printing industry, with the market demand for personalization and customization constantly increasing, traditional printing technologies are struggling to meet these requirements. This is especially true when adding variable data to a background image. For example, before printing a sticker, the background image is white. A colorful sticker is then added to the white background to create 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 and sticker image data in formats such as JPG, PNG, and TIFF, then merges the sticker image data with the background image data. Since images in formats such as JPG, PNG, and TIFF are in the RGB color space, while printers typically recognize PRT images in the CMYK color space, the merged JPG, PNG, and TIFF images must be regenerated through a RIP process into a PRT / PRN format that the printer can directly recognize. The printer then prints the complete sticker based on the PRT / PRN image.
[0003] It can be seen that in the prior art, the method of regenerating the background image in PRT format and the merged image of variable data before each sticker printing makes the data preprocessing process time-consuming and the printing efficiency low.
[0004] Therefore, there is a technical problem in the prior art of how to improve the printing efficiency of an image obtained by splicing variable data and background data. Summary of the Invention
[0005] The object of the present invention is to provide a variable data printing method, apparatus, device and medium to improve the flexibility of variable data printing.
[0006] In order to achieve the above object, the present invention provides the following technical solutions: A method for printing variable data, comprising: in response to a selection operation on basic data, displaying a setting interface for variable data, wherein the setting interface for variable data at least includes a background image corresponding to the basic data; in response to a setting operation on the position and size of the basic data on the setting interface for variable data, displaying an overlay image corresponding to the basic data and the variable data; in response to a print trigger operation on the overlay image, overlaying the variable data onto the basic data to obtain overlay data, and executing printing for the overlay data.
[0007] In an optional embodiment of the present application, in response to a print trigger operation for the overlay image, the variable data is superimposed on the basic data to obtain the overlay data, and printing of the overlay image is performed, including: in response to a print trigger operation for the overlay image, the variable data and the basic data are associated, and a function is calculated through an OR operation to determine the byte offset and bit offset of the variable data in the basic data according to the position and size set for the variable data; based on the byte offset and bit offset of the variable data in the basic data, the variable data is superimposed on the basic data to obtain the overlay data; and printing of the overlay data is performed.
[0008] In an optional embodiment of the present application, the variable data is superimposed on the basic data based on the byte offset and bit offset of the variable data in the basic data to obtain the superimposed data, which includes: determining the basic data bits in the basic data corresponding to the variable data based on the byte offset and bit offset of the variable data in the basic data; and replacing the basic data bits in the basic data with the variable data bits corresponding to the variable data to obtain the superimposed data.
[0009] In an optional implementation of the present application, it also includes: judging whether the basic information of the variable data matches the basic information of the basic data; 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.
[0010] In an optional implementation manner of the present application, the basic information of the variable data includes at least: color depth, number of colors, and resolution.
[0011] In an optional embodiment of the present application, the display of the superimposed image corresponding to the basic data and the variable data in response to the setting operation of the position and size of the variable data in the setting interface of the variable data includes: in response to the position data input operation for the position setting control and the size data input operation for the size setting control, obtaining the position space information occupied by the variable data in the basic data; based on the position space information occupied by the variable data in the basic data, displaying the superimposed image corresponding to the basic data and the variable data; wherein the setting interface of the variable data includes position and size setting controls for the variable data; or, in response to the area selection operation for the background image corresponding to the basic data, determining the position space occupied by the variable data in the background image; in response to the addition operation for the variable data, adding the basic data in the position space, and displaying the superimposed image corresponding to the basic data and the variable data.
[0012] In an optional implementation manner of the present application, the basic data and the variable data are in PRT format.
[0013] Compared with the prior art, the variable data printing method provided by the present invention provides a variable data setting interface, so that the user can reasonably set the position and size of the variable data in the background image based on the background image displayed in the variable data setting interface, and then superimpose the variable data on the basic data to obtain superimposed data, and execute printing for the superimposed data, which is conducive to improving the flexibility of variable data printing.
[0014] The present invention also provides a variable data printing device, comprising: a basic data display unit, for displaying a setting interface of variable data in response to a selection operation on basic data, wherein the setting interface of variable data at least includes a background image corresponding to the basic data; a variable data setting unit, for displaying an overlaid 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 setting interface of the variable data; a data overlay printing unit, for superimposing the variable data on the basic data in response to a print trigger operation on the overlaid image to obtain overlaid data and execute printing of the overlaid data.
[0015] Compared with the prior art, the beneficial effects of the variable data printing device provided by the present invention are the same as the beneficial effects of the variable data printing method described in the above technical solution, and are not described in detail here.
[0016] The present invention also provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; the processor is configured to execute the above-mentioned variable data printing method by running the instructions in the memory.
[0017] Compared with the prior art, the beneficial effects of the electronic device provided by the present invention are the same as the beneficial effects of the variable data printing method described in the above technical solution, and will not be described in detail here.
[0018] The present invention also provides a computer storage medium, wherein instructions are stored in the computer storage medium. When the instructions are executed, the above-mentioned variable data printing method is implemented.
[0019] Compared with the prior art, the beneficial effects of the computer storage medium provided by the present invention are the same as the beneficial effects of the variable data printing method described in the above technical solution, and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 A flow chart of a variable data printing method provided in an embodiment of the present application.
[0021] Figure 2 Schematic diagram of the basic data selection operation interface provided in the embodiment of this application.
[0022] Figure 3 Schematic diagram of the variable data setting interface provided in an embodiment of the present application.
[0023] Figure 4 Schematic diagram of the print settings interface provided in an embodiment of the present application.
[0024] Figure 5 A structural diagram of a variable data printing device provided in an embodiment of the present application.
[0025] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present application.
[0026] Reference numerals: 201-background image selection module, 202-first background image display module; 203-background image introduction module, 301-variable data setting module; 302-second background image display module, 303-position setting control; 304-color adjustment control, 305-font setting control; 306-text setting control, 307-adding method selection control; 401-print number control, 402-variable data addition control; 501-basic data display unit, 502-variable data setting unit; 503-data overlay printing unit, 400-electronic equipment; 410-processor, 4101-first processor; 4102 - second processor, 420 - communication interface; 430-Memory, 440-Communication line. DETAILED DESCRIPTION
[0027] To facilitate a clear description of the technical solutions of the embodiments of the present invention, the words "first" and "second" are used in the embodiments of the present invention to distinguish between identical or similar items with substantially the same functions and effects. For example, the first threshold and the second threshold are merely used to distinguish between different thresholds and do not limit their order. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean different.
[0028] It should be noted that, in the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present invention should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0029] In the present invention, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers 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 mean: a, b, c, the combination of a and b, the combination of a and c, the combination of b and c, or the combination of a, b and c, where a, b, c can be single or plural.
[0030] In the modern printing industry, with market demands for increasingly efficient printing of spliced images, traditional printing technologies are struggling to meet these demands. This is particularly true when adding variable data to a background image. Existing techniques typically append variable data in formats like JPG, PNG, and TIFF to a specified location within the background image, then regenerate the image in a printer-readable PRT format. However, this approach requires regenerating the entire PRT-formatted merged image whenever the variable data changes, resulting in low printing efficiency.
[0031] Therefore, how to improve the printing efficiency in the scenario where variable data and background data are superimposed becomes a technical problem that those skilled in the art urgently need to solve.
[0032] In order to solve the above technical problems, the present application provides a variable data printing method, device, equipment and medium, which are described in detail one by one in the following embodiments.
[0033] The present application embodiment first provides a method for printing variable data, please refer to Figure 1 , Figure 1 A flow chart of a variable data printing method provided in an embodiment of the present application.
[0034] like Figure 1 As shown, the variable data printing method includes the following S101 to S103.
[0035] S101 , in response to a selection operation on basic data, displaying a setting interface for variable data, wherein the setting interface for variable data at least includes a background image corresponding to the basic data.
[0036] 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 components and attributes of the background image, wherein the components include the pixels and resolution of the image, and the attributes of the background image include information such as the image size, format, color space, etc.
[0037] Variable data is also a type of variable data, specifically the underlying data for images such as QR codes and barcodes that need to be printed on the background image. For example, when creating a promotional poster, a user might need to add a payment code or business card code to the background image so that users can scan the code with their mobile phone to learn more about the content. In this case, the underlying data for the payment code and business card code constitutes the variable data.
[0038] In the actual application process, the above S101 is implemented based on the selection operation interface of basic data, please refer to Figure 2 , Figure 2 Schematic diagram of the basic data selection operation interface provided in the embodiment of this application.
[0039] 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.
[0040] Among them, the background image selection module 201 includes multiple pre-input selectable background images. The user can click on any one 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 corresponding basic data of the background image and the printing status of the printer, such as resolution, number of colors, number of ink dots, width, height, whether the printer is ready and other related information.
[0041] In the basic data selection operation interface, the user can select the name of each background image provided in the background image selection module 201, click and browse the display effects of each background image in turn, and select a suitable background image from them.
[0042] In an optional embodiment of the present application, the basic data and the variable data can be files in PRT format to avoid converting image data in formats such as JPG, PNG, TIFF, etc. into PRT format, thereby saving the time required for printing.
[0043] S102 : In response to a setting operation on the position and size of the basic data on the variable data setting interface, displaying a superimposed image corresponding to the basic data and the variable data.
[0044] Furthermore, the user can select a suitable background image by double-clicking to confirm and enter the variable data setting interface.
[0045] Please refer to Figure 3 , Figure 3 Schematic diagram of the variable data setting interface provided in an embodiment of the present application.
[0046] 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.
[0047] In an embodiment of the present 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 adding method selection control 307.
[0048] In actual application, the user can select the position of the variable data in the background image through the position setting control 303, such as adding the x-axis and y-axis coordinates of the variable data in the position setting control 303, thereby completing the position setting for the variable data.
[0049] When the user needs to adjust the size of the variable data, the user can also adjust the width and height of the variable data in the position setting control 303, such as by adjusting W (Width) and H (Height) in the position setting control 303, thereby achieving the size setting for the variable data.
[0050] In another optional embodiment of the present application, the setting of the size and position of the image corresponding to the variable data can be implemented based on the user's area 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 area selection operation on the background image.
[0051] 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, or the color of the QR code can be adjusted to a color that matches the background image so that the display of the QR code does not affect the display effect of the background image.
[0052] Furthermore, the text setting control 306 is used to add text data to the variable data. For example, when the image corresponding to the variable data is a barcode, the user can add a numeric string corresponding to the barcode in the text setting control 306 .
[0053] Furthermore, the font setting control 305 is used to adjust the text format added by the user in the text setting control 306, such as text size, font, etc.
[0054] After the user completes the setting for the variable data, the image corresponding to the variable data can be superimposed on the background image, so that the user can view the display effect of the superimposed image.
[0055] The adding mode selection control 307 is used for the user to select a fusion mode or an 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 adding work.
[0056] Specifically, when the user selects the fusion mode, the variable data will be superimposed on the background image for display 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 or calculates the calculation function to obtain the superimposed data, and then completes the printing of the superimposed data.
[0057] 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 calculation function to replace the pixel values of the background image in the specified area with the pixel values of the variable data.
[0058] In another optional implementation manner of the present application, before entering the variable data setting interface from the basic data selection operation interface, the selection operation interface further includes: a print setting interface.
[0059] Please refer to Figure 4 , Figure 4 Schematic diagram of the print settings interface provided in an embodiment of the present application.
[0060] like Figure 4 As shown, the print setting interface includes: a print quantity control 401 and a variable data adding control 402.
[0061] The user can adjust the number of copies of the content to be printed by editing the print number control 401, and enter the variable data setting interface by triggering the variable data adding control 402.
[0062] S103 , in response to a print triggering operation for the overlay image, overlaying the variable data onto the basic data to obtain overlay data, and performing printing for the overlay data.
[0063] It should be noted that since ordinary users generally do not have RIP software installed, when assigning print tasks, the image files provided by users are typically in RGB color space, such as JPG, PNG, TIFF, and other formats. Printer manufacturers install RIP software, which can be used to convert user-provided images in JPG, PNG, TIFF, and other formats into PRT or PRN formats that the printer can directly recognize. The RIP software's conversion of JPG, PNG, TIFF, and other formats into PRN or PRT formats is time-consuming. Consequently, when variable data changes, the RIP software must re-overlay the base data in JPG, PNG, TIFF, and other formats with the variable data in JPG, PNG, TIFF, and other formats, generating the overlay data in JPG, PNG, TIFF, and other formats. This process also takes a long time to convert into PRN or PRT format. The variable data repeatedly changes and is thus repeatedly regenerated, requiring repeated format conversion of the entire image data, resulting in low printing efficiency.
[0064] In an optional embodiment, for example, in a scenario where a user needs to print a sticker, the sticker background is a fixed image, which can be a solid color image or a patterned image. In other words, the sticker background data is unchanging. Therefore, the sticker background data can be used as the basic data, and RIP software can be used to convert the basic data in JPG, PNG, TIFF, etc. format into background data in PRT format. For the image of the sticker on the sticker background, which is usually a changing image with a pattern, the data corresponding to the sticker is used as variable data. When the sticker data in JPG, PNG, TIFF, etc. format changes, the variable data in PRT format can be regenerated based on the variable data in JPG, PNG, TIFF, etc. format. In this embodiment, since the sticker on the sticker is a changing pattern, the prior art process of regenerating superimposed data in PRT format from superimposed data in JPG, PNG, TIFF, etc., obtained by merging basic data in JPG, PNG, TIFF, etc. formats with variable data in JPG, PNG, TIFF, etc. formats, can be optimized to generate basic data in PRT format from basic data in JPG, PNG, TIFF, etc. formats, which are then stored in a preset storage space. When the variable data in JPG, PNG, TIFF, etc. formats changes, variable data in PRT format is generated based on the variable data in JPG, PNG, TIFF, etc. formats. In other words, the basic data only needs to be converted into an image format once, and only the variable data that has changed is converted into multiple formats. The variable data converted into PRT format is then merged with the basic data in PRT format to obtain superimposed data in PRT format. Compared with the solutions in the prior art, the solution in this embodiment requires much less image data to be format converted. There is no need to convert all the superimposed data obtained by merging the basic data in the JPG, PNG, TIFF and other formats and the variable data in the JPG, PNG, TIFF and other formats. It is only necessary to convert the basic data in the JPG, PNG, TIFF and other formats once, and convert the variable data in the JPG, PNG, TIFF and other formats that has changed a preset number of times for a preset number of times. This greatly reduces the amount of data that needs to be format converted and improves printing efficiency.
[0065] In an optional embodiment, software can be designed for merging variable data and base data and viewing the merged results. A coordinate system, i.e., the base 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 a resolution input by a relevant user. Subsequent coordinate systems can be established based on a preset resolution, which can also be set based on historical usage data. The preset resolution can be obtained by calculating the average resolution of all print tasks in the past print task data, removing print tasks with resolutions greater than a first multiple of the average resolution and removing print tasks with resolutions less than a second multiple of the average resolution, to obtain a first set of print tasks, where the first multiple is greater than 1 and the second multiple is less than 1 and 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 the relevant user. The resolutions of the first set of print tasks are sorted from high to low, and the resolution of the job corresponding to the 30th percentile is used as the preset resolution. After establishing the coordinate system based on the preset resolution, the resolution of the coordinate system can be adjusted based on the resolution input by the user. After obtaining past print tasks, this embodiment first removes print task samples with too large or too small resolutions, reduces the impact of special print tasks on the acquisition of preset resolutions, sorts all the first print tasks after removing special data by resolution from high to low, and establishes a coordinate system based on the resolution corresponding to the 30% print tasks in the sorting. The coordinate system established in this way can not only meet the requirements of most print tasks for the print display effect on the display interface, but also avoid the coordinate system from containing too many pixel position coordinates, thereby ensuring the high versatility and low complexity of the coordinate system. After the coordinate system is established, the coordinate system resolution can also be adjusted according to user input, which is highly flexible. Compared with the prior art of establishing a coordinate system in real time based on the data to be printed, the coordinate system can be established in advance before the data to be printed is transmitted to the system, and the display is more real-time.
[0066] After the user completes the setting for the variable data, the overlay image is displayed. In this case, what is displayed in the image is only the overlay effect. In the actual printing process, the variable data needs to be further superimposed on the basic data to obtain overlay data, so that the printer can complete printing based on the overlay data. In order to directly add the overlay image to the background image corresponding to the basic data, rather than 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 variable data is superimposed on the basic data to obtain the overlay data, including: in response to a print trigger operation for the overlay image, the variable data and the basic data are associated, and through an OR operation calculation function or an AND operation calculation function, the byte offset and bit offset of the variable data in the basic data are determined according to the position and size set for the variable data; based on the byte offset and bit offset of the variable data in the basic data, the variable data is superimposed on the basic data to obtain the overlay data.
[0067] That is, based on the position and size of the variable data, the byte offset corresponding to the variable data in the base data is determined. When the byte offset of the variable data in the base 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 achieve alignment of the base data and the variable data.
[0068] Furthermore, after completing the alignment of the basic data and the variable data, the basic data bits in the basic data corresponding to the variable data are determined based on the byte offset and bit offset of the variable data in the basic 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.
[0069] That is, when a certain bit of the variable data is 1, the corresponding bit of the basic data is also set to 1, thereby achieving superposition of the basic data and the variable data to obtain the superimposed data.
[0070] In this embodiment, the area where the variable data is located in the basic data needs to be determined. The area where the variable data is located in the basic data can be determined by determining the coordinates input by the user for the variable data, or by the area selected by the user using the mouse arrow.
[0071] The method for determining the area of variable data based on the coordinates input by the user is as follows: a variable data coordinate system is established based on the variable data in the PRT format, and the pixel corresponding to the smallest horizontal coordinate among the horizontal coordinates corresponding to the first pixel of each row of the variable data in the variable data coordinate system is used as the first pixel, and the pixel corresponding to the smallest vertical coordinate among the vertical coordinates corresponding to the first pixel of each column of the variable data in the variable coordinate system is used as the second pixel. The user can choose whether the input coordinate type is horizontal coordinate or vertical coordinate. When the user selects to input the horizontal coordinate, in response to the user input of the horizontal coordinate, the basic data and the variable data are merged according to the second pixel corresponding to the user input horizontal coordinate; when the user selects to input the vertical coordinate, in response to the user input of the vertical coordinate, the basic data and the variable data are merged according to the user input vertical coordinate corresponding to the first pixel, and the area corresponding to the merged variable data is used as the area of the variable data in the basic data.
[0072] The method for determining the area 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 area determination function, the center of mass of the variable data is calculated, the center of mass of the variable data and the position selected by the mouse are merged accordingly, and the area corresponding to the merged variable data is used as the area of the variable data in the basic data.
[0073] After obtaining the area of the variable data in the base data, obtain the horizontal coordinate of the first pixel of the variable data in the base data coordinate system row by row, divide the horizontal coordinate by 8 to obtain the byte offset corresponding to the row, and the remainder is the bit offset corresponding to the row. Repeat the above calculation process to calculate the byte offset and bit offset of each pixel in the base data coordinate system of the variable data. According to 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 in units of bytes, avoiding the inefficiency caused by pasting pixels one by one according to coordinate values.
[0074] In an optional embodiment of the present application, in the process of superimposing basic data and variable data, the data matching between the basic data and the superimposed data also needs to be considered. For example, when the image resolution reflected by the basic data is 3840×2160 pixels and the resolution of the image reflected by the variable data is 2048×1080 pixels, it is relatively difficult to superimpose the two data in the field of printing technology. Therefore, it is necessary to make appropriate adjustments to the two data.
[0075] Specifically, the variable data printing method also includes: determining whether the basic information of the variable data matches the basic information of the basic data; 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.
[0076] The basic information of the variable data and the basic data includes at least: color depth, number of colors, resolution, etc.
[0077] That is, in an embodiment of the present application, when 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, thereby solving the problem of difficulty in superimposing different types of data.
[0078] Specifically, please refer to the following content as an example. The basic information can be reflected in the file information of the variable data and the basic data in the following manner.
[0079] int nImagewidth; / / RIP Image pixel width int nImagewidth; / / RIP Image pixel height int nImageColorNum; / / RIP image Color number indude 4 (YMCK) / / 6 YMCKWV / / See the following comment for Ricoh 8Color Printer. int nImageColorDeep; / / 1,2 RIP image output bitper color int nImageResolutionX; / / RIP image X resolution,300,600 int nImageResolutionY; / / RIP image X resolution ,300,600,900,1200 Among them, "nImageWidth; / / RIP Image pixel width" is used to indicate the pixel width of the image. This variable stores the number of pixels in the image horizontally. For example, if an image is 800 pixels wide, the value of nImageWidth is 800. "nImageHeight; / / RIP Image pixel height" is used to indicate the pixel height of the image. This variable stores the number of pixels in the image vertically. For example, if an image is 600 pixels high, the value of nImageHeight is 600. "nImageColorNum" indicates the number of color channels in the image. "YMCK" indicates the four colors: Yellow, Magenta, Cyan, and Key / Black. "YMCKWV" indicates that in addition to YMCK, it also includes White and Varnish. "Ricoh 8Color Printer" indicates an 8-color printer. "nImageColorDeep" indicates the chromaticity of each color channel. If each color channel uses 1 bit, the value of "nImageColorDeep" is 1. If 2 bits are used per color channel, the value of "nImageColorDeep" is 2. "nImageResolutionX" indicates the horizontal resolution of the image. This variable stores the image's horizontal dots per inch (DPI). Common values are 300 DPI and 600 DPI. If the image's horizontal resolution is 300 DPI, the value of "nImageResolutionX" is 300. If the image's horizontal resolution is 600 DPI, the value of "nImageResolutionX" is 600. "nImageResolutionY" indicates the image's vertical resolution. This variable stores the image's vertical dots per inch (DPI). Common values are 300 DPI, 600 DPI, 900 DPI, and 1200 DPI. If the image's vertical resolution is 300 DPI, the value of "nImageResolutionY" is 300. If the image's vertical resolution is 600 DPI, the value of "nImageResolutionY" is 600. If the image's vertical resolution is 900 DPI, the value of "nImageResolutionY" is 900. If the image's vertical resolution is 1200 DPI, the value of "nImageResolutionY" is 1200.
[0080] Furthermore, when 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. For example, when the resolution of the variable data is inconsistent with the resolution of the basic data, the resolution of the variable data is adjusted to the resolution of the basic data; for example, when the color depth of the variable data is inconsistent with the color depth of the basic data, the color depth of the variable data is adjusted to the color depth of the basic data.
[0081] In an optional embodiment, for example, the sticker background is used as the base data, and the sticker is used as the variable data. The base data in a format such as JPG, PNG, or TIFF is obtained from the user. After converting the base data in the JPG, PNG, or TIFF format to PRT format, the data is displayed on the base data coordinate system of the printing software display interface. The area of the variable data in the base data is obtained based on the user's input, and the variable data and the base data are merged. In this embodiment, the size of the sticker in the sticker background can be adjusted at will, that is, the size of the variable data in the base data can be adjusted at will. For example, in the sticker printing scenario, the user can adjust the size of the variable data in real time according to the sticker design requirements. For example, a character face sticker has an eye component, a nose component, a mouth component, a hair component, and a cheek component. The user can copy and paste the eye component and adjust the size of the pasted eye component. The user can also copy and paste the mouth sticker and adjust the size of the pasted mouth component. This allows the player to combine and match different components of the character face after printing to meet the user's needs.
[0082] In an optional method, the size of the variable data needs to be adjusted in real time, and the resolution, number of colors, and color depth of the variable data need to be adjusted in real time to achieve matching and fusion of the variable data and the basic data. For example, in the scenario of printing business cards, there is a need to add a QR code of the user's social software to the business card. In this case, adding a traditional QR code composed of black and white lines will affect the overall look and feel of the business card. Therefore, in one embodiment of the present 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 to the image corresponding to the basic data without losing its function.
[0083] Therefore, each time a size adjustment instruction for variable data is received, the number of colors, color depth, and resolution of the base data are obtained, and the number of colors, color depth, and resolution of the variable data are adjusted based on the number of colors, color depth, and resolution of the base data. Specifically, the color depths of the base data and the variable data are obtained. When the color depths of the variable data and the base data are different, the color depth of the variable data is mapped to the color depth of the base data to complete the adjustment of the color depth of the variable data. There are two commonly used color depths in the printing process: 1 bit and 2 bits. When the color depth is 1 bit, 0 represents no ink droplets and 1 represents ink droplets. When the color depth is 2 bits, 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 color depth in the variable data is mapped from 2-bit color depth to 1-bit color depth, mapping the variable data 00 to 0 and 01, 10, and 11 to 1. When the basic data has a 2-bit color depth and the variable data has a 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 retain the details in the image and reduce mapping distortion.
[0084] Regarding the number of colors in the base data, two commonly used numbers of colors in the printing process are four and six. Four colors refer to C (cyan), M (magenta), Y (yellow), and K (black), while six colors refer to the CMYK four colors with the addition of Lc (light cyan) and Lm (light magenta). If the number of colors in the obtained base data and variable data is different, when the base data is six colors and the variable data is four colors, obtain the cyan conversion ratio and magenta conversion ratio entered by the user, multiply the cyan ink volume corresponding to the base data by the conversion ratio to obtain the light cyan ink volume, and multiply the magenta ink volume corresponding to the base data by the conversion ratio to obtain the light magenta ink volume. If the base data is four colors and the variable data is six colors, add the light cyan ink volume and cyan ink volume corresponding to the base data to obtain the converted cyan ink volume, and add the light magenta ink volume and magenta ink volume corresponding to the base data to obtain the converted magenta ink volume.
[0085] Regarding the resolution of the base data and variable data, if the resolution of the variable data and the base data are different based on the acquired base data and variable data, when the resolution of the base data is greater than that of the variable data, the resolution of the variable data is converted to the resolution of the base data by interpolation. When the resolutions of the base data and the variable data are not multiples, the image data of the variable data is corrected using a deformation algorithm after conversion. When 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 culling pixels at equal intervals. When the resolutions of the base data and the variable data are not multiples, the image data of the variable data is corrected using a deformation algorithm after conversion.
[0086] Furthermore, considering that different variable data are printed at the same position and in the same size on the same base data, the existing technology usually needs to add each variable data in sequence on the base data. Since the data volume of the variable data is small, but the data volume of the base data is large, the base data needs to be repeatedly operated and identified for each printing, resulting in a longer time to generate a new print file each time, which in turn leads to a longer printing time.
[0087] In another optional embodiment of the present application, in order to more conveniently add different variable data, when there is only one background image corresponding to the basic data, multiple different variable data can also be stored in the database, thereby realizing batch printing of the multiple variable data.
[0088] That is, in response to the print trigger operation for the superimposed image, the variable data is superimposed on the basic data to obtain the superimposed data, and printing of the superimposed data is performed, including: in response to the print trigger operation for the superimposed image, determining the number of repeated prints of multiple variable data in the database by the user; superimposing each of the variable data on the basic data in turn to obtain the superimposed data corresponding to each of the variable data; based on the number of repeated prints, repeated printing of each of the superimposed data is performed in turn.
[0089] For example, a user imports 10 different QR codes from the database. Figure 4 The print quantity control 401 in the print setting interface adds the print quantity, and Figure 3 After setting the position and size of the variable data in the variable data setting interface shown, the image corresponding to each variable data can be added to the background image in sequence through the printer, so that the printer can print the image corresponding to each variable data in the background image based on the number of prints.
[0090] To sum up, the variable data printing method provided by the present application, by providing a variable data setting interface, enables the user to reasonably set the position and size of the variable data in the background image based on the background image displayed in the variable data setting interface, and then superimpose the variable data on the basic data to obtain superimposed data, and execute printing for the superimposed data, which is conducive to improving the flexibility of variable data printing.
[0091] The present application also provides a variable data printing device, please refer to Figure 5 , Figure 5 A structural diagram of a variable data printing device provided in an embodiment of the present application.
[0092] like Figure 5As shown, the variable data printing device includes: The basic data display unit 501 is configured to display a setting interface for variable data in response to a selection operation on basic data, wherein the setting interface for variable data at least includes a background image corresponding to the basic data.
[0093] The variable data setting unit 502 is configured to display a superimposed 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 on the variable data setting interface.
[0094] The data overlay printing unit 503 is configured to, in response to a print triggering operation for the overlay image, overlay the variable data onto the basic data to obtain overlay data, and print the overlay data.
[0095] In an optional embodiment of the present application, in response to a print trigger operation for the overlay image, the variable data is superimposed on the basic data to obtain the overlay data, and printing of the overlay image is performed, including: in response to a print trigger operation for the overlay image, the variable data and the basic data are associated, and a function is calculated through an OR operation to determine the byte offset and bit offset of the variable data in the basic data according to the position and size set for the variable data; based on the byte offset and bit offset of the variable data in the basic data, the variable data is superimposed on the basic data to obtain the overlay data; and printing of the overlay data is performed.
[0096] In an optional embodiment of the present application, the variable data is superimposed on the basic data based on the byte offset and bit offset of the variable data in the basic data to obtain the superimposed data, which includes: determining the basic data bits in the basic data corresponding to the variable data based on the byte offset and bit offset of the variable data in the basic data; and replacing the basic data bits in the basic data with the variable data bits corresponding to the variable data to obtain the superimposed data.
[0097] In an optional embodiment of the present application, the device is also used to: determine whether the basic information of the variable data matches the basic information of the basic data; 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.
[0098] In an optional implementation manner of the present application, the basic information of the variable data includes at least: color depth, number of colors, and resolution.
[0099] In an optional embodiment of the present application, the display of the superimposed image corresponding to the basic data and the variable data in response to the setting operation of the position and size of the variable data in the setting interface of the variable data includes: in response to the position data input operation for the position setting control and the size data input operation for the size setting control, obtaining the position space information occupied by the variable data in the basic data; based on the position space information occupied by the variable data in the basic data, displaying the superimposed image corresponding to the basic data and the variable data; wherein the setting interface of the variable data includes position and size setting controls for the variable data; or, in response to the area selection operation for the background image corresponding to the basic data, determining the position space occupied by the variable data in the background image; in response to the addition operation for the variable data, adding the basic data in the position space, and displaying the superimposed image corresponding to the basic data and the variable data.
[0100] In an optional implementation manner of the present application, the basic data and the variable data are in PRT format.
[0101] The above-mentioned device embodiments provided in this embodiment and the method embodiments of this application are based on the same application concept and can execute the variable data printing method provided in any of the above-mentioned embodiments of this application, and have the corresponding functional modules and beneficial effects of executing the variable data printing method. For technical details not fully described in this embodiment, please refer to the specific processing content of the variable data printing method provided in the above-mentioned embodiments of this application, and will not be repeated here.
[0102] 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 the present application.
[0103] like Figure 6 As shown, the electronic device 400 includes a processor 410 .
[0104] like Figure 6 As shown, the processor 410 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention.
[0105] 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.
[0106] Optional, such as Figure 6 As shown, the 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 or other device for communicating with other devices or a communication network.
[0107] Optional, such as Figure 6 As shown, the electronic device may further include a memory 430. The memory 430 is used to store computer-executable instructions for executing the solution of the present invention, and is controlled by the processor to execute the computer-executable instructions stored in the memory, thereby implementing the method provided by the embodiment of the present invention.
[0108] like Figure 6 As shown, memory 430 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, a random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, 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 is not limited thereto. Memory 430 may be independent and connected to processor 410 via communication line 440. Memory 430 may also be integrated with processor 410.
[0109] Optionally, the computer-executable instructions in the embodiment of the present invention may also be referred to as application program codes, which is not specifically limited in the embodiment of the present invention.
[0110] In a specific implementation, as an embodiment, Figure 6 As shown, the processor 410 may include one or more CPUs, such as Figure 6 CPU0 and CPU1 in.
[0111] In a specific implementation, as an embodiment, Figure 6 As shown, the terminal device may include multiple processors, such as Figure 6 The first processor 4101 and the second processor 4102 in the embodiment of the present invention are shown in FIG. Each of these processors can be a single-core processor or a multi-core processor.
[0112] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or by software instructions. The above processor may be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The methods, steps, and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor or by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The storage medium is located in a memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0113] The present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed, the functions performed by the terminal device in the above embodiment are implemented.
[0114] The above embodiments can be implemented in whole or in part through software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are fully or partially executed. 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 accessible by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media, such as floppy disks, hard disks, or magnetic tapes; optical media, such as digital video discs (DVDs); or semiconductor media, such as solid-state drives (SSDs).
[0115] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. 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 may implement several functions listed in the claims. The fact that certain measures are recorded in mutually different dependent claims does not mean that these measures cannot be combined to produce good results.
[0116] Although the present invention has been described with reference to specific features and embodiments thereof, it will be apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the invention. Accordingly, this specification and drawings are merely illustrative of the invention as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the invention. It will be apparent that various modifications and variations may be made to the present invention by those skilled in the art without departing from the spirit and scope of the invention. Thus, the present invention is intended to include such modifications and variations as fall within the scope of the claims of the present invention and their equivalents.
Claims
1. A method for printing variable data, characterized in that: include: In response to a selection operation on basic data, displaying a setting interface for variable data, wherein the setting interface for variable data at least includes a background image corresponding to the basic data; In response to a setting operation on the position and size of the basic data on the setting interface of the variable data, displaying a superimposed image corresponding to the basic data and the variable data; In response to a print trigger operation for the overlay image, the variable data is overlaid on the basic data to obtain overlay data, and printing of the overlay data is performed.
2. The variable data printing method according to claim 1, characterized in that: In response to a print triggering operation for the overlay image, the variable data is overlaid onto the basic data to obtain overlay data, and printing of the overlay image is performed, comprising: In response to a print trigger operation for the overlay image, the variable data is associated with the base data, and a byte offset and a bit offset of the variable data in the base data are determined according to a position and a size set for the variable data by using an OR operation calculation function; superimposing the variable data onto the base data based on a byte offset and a bit offset of the variable data in the base data to obtain the superimposed data; Printing of the overlay data is performed.
3. The variable data printing method according to claim 2, characterized in that: The step of superimposing the variable data onto the basic data based on the byte offset and the bit offset of the variable data in the basic data to obtain the superimposed data comprises: Determining a base data bit in the base data corresponding to the variable data based on a byte offset and a bit offset of the variable data in the base 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.
4. The variable data printing method according to claim 1, wherein: Also includes: Determining whether the basic information of the variable data matches the basic information of the basic data; In a 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.
5. The variable data printing method according to claim 4, characterized in that: The basic information of the variable data includes at least: color depth, number of colors, and resolution.
6. The variable data printing method according to claim 1, characterized in that: The displaying of the superimposed image corresponding to the basic data and the variable data in response to the setting operation of the position and size of the variable data on the setting interface of the variable data includes: In response to a position data input operation for a position setting control and a size data input operation for a size setting control, obtaining positional spatial information occupied by the variable data in the base data; and displaying a superimposed image corresponding to the base data and the variable data based on the positional spatial information occupied by the variable data in the base data; wherein the variable data setting interface includes position and size setting controls for the variable data; Alternatively, in response to an area selection operation on 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 on the variable data, the basic data is added in the position space, and a superimposed image corresponding to the basic data and the variable data is displayed.
7. The variable data printing method according to claim 1, characterized in that: The basic data and the variable data are in PRT format.
8. A variable data printing device, characterized in that: include: A basic data display unit, configured to display a setting interface for variable data in response to a selection operation on the basic data, wherein the setting interface for the variable data at least includes a background image corresponding to the basic data; a variable data setting unit, configured to display a superimposed 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 on the variable data setting interface; The data overlay printing unit is configured to, in response to a print triggering operation for the overlay image, overlay the variable data onto the basic data to obtain overlay data, and print the overlay data.
9. An electronic device, characterized in that: include: a memory for storing processor-executable instructions; The processor is configured to execute the variable data printing method according to any one of claims 1 to 7 by running instructions in the memory.
10. A computer storage medium, characterized in that The computer storage medium stores instructions, and when the instructions are executed by the processor, the variable data printing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Printing method for inkjet printer
CN108009613A
Intelligent generation method of printing production data image, storage medium and data processing equipment
CN111930286A
Variable two-dimensional code image real-time printing method and device, equipment and medium
CN113377309A
Data processing method and device for variable image printing, equipment and storage medium
CN116339649A
Image generation method and device and electronic equipment
CN116363260A