Watermarking configuration method and computing device

By adding a PPD Filter module to the CUPS system, watermarks are automatically added to documents to be printed, solving the problems of low efficiency and lack of flexibility in watermark addition in the existing technology, and realizing the automation, identification and security configuration of watermarks.

CN117648059BActive Publication Date: 2025-11-18XFUSION DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311413576.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2025-11-18
Estimated Expiration
2043-10-27

AI Technical Summary

Technical Problem

In existing technologies, adding watermarks during document printing is inefficient and lacks flexibility, making it difficult to achieve unified management and secure traceability.

Method used

A new PPD Filter module has been added to the CUPS system to automatically add watermarks to documents to be printed. It generates target printing instructions by receiving expanded document information and target watermark templates, and supports flexible configuration for different users and printers.

Benefits of technology

It enables automated watermark addition, improves the efficiency and flexibility of watermark configuration, ensures the identifiability and security of watermarks, and supports rich information inclusion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117648059B_ABST
    Figure CN117648059B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a watermark configuration method and a computing device. The watermark configuration method comprises the following steps: receiving a printing request, wherein the printing request comprises a to-be-printed file and first information, and the first information is related to the to-be-printed file; determining a target watermark based on a target watermark template and the first information, wherein the target watermark template is used for indicating a generation rule of the target watermark; generating a target printing instruction based on the to-be-printed file and the target watermark; and sending the target printing instruction to a target printer, wherein the target printing instruction is used for instructing the target printer to print the to-be-printed file with the target watermark. According to the embodiment of the application, the generation rule of the target watermark can be configured through the target watermark template, and the flexibility and efficiency of watermark configuration can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of server technology, and in particular to a watermark configuration method and computing device. Background Technology

[0002] In our daily work and life, we often print documents. For some important documents, such as those involving intellectual property, business secrets, or technical secrets, watermarks are usually added during printing for protection.

[0003] Meanwhile, how to conveniently add watermarks to documents to be printed and improve the efficiency of watermark addition is a concern for technical personnel. Summary of the Invention

[0004] This application discloses a watermark configuration method and computing device, which can automatically add watermarks and improve the flexibility and efficiency of watermark configuration.

[0005] The first aspect discloses a watermark configuration method, which can be applied to a computing device, a module within the computing device (e.g., a processor), or a logic module or software (such as a printing system) capable of implementing all or part of the functions of the computing device. The following description, using an application to a computing device as an example, includes the following steps: receiving a print request, the print request including a file to be printed and first information related to the file to be printed; determining a target watermark based on a target watermark template and the first information; the target watermark template indicating the generation rules for the target watermark; generating a target print instruction based on the file to be printed and the target watermark; sending the target print instruction to a target printer; and the target print instruction instructing the target printer to print the file to be printed with the target watermark.

[0006] In this embodiment, the print request can carry first information, and the computing device can determine the target watermark based on the first information and the target watermark template. Then, it can generate a corresponding target print instruction based on the file to be printed and the target watermark. The target printer can print the file to be printed with the target watermark using the target print instruction. Therefore, this method can achieve automatic watermark addition and improve the efficiency of watermark configuration. Furthermore, configuring the target watermark generation rules through the target watermark template can improve the flexibility of watermark configuration and ensure that the printed watermarks are uniform, facilitating watermark management. In addition, the computing device obtaining the target watermark based on the first information can make the watermark more distinctive and contain richer information.

[0007] In conjunction with the first aspect, in one possible implementation, generating a target print instruction based on the document to be printed and the target watermark includes: generating first format data based on the document to be printed; and generating the target print instruction based on the first format data and the target watermark.

[0008] In this embodiment, the computing device can first generate first format data based on the file to be printed, and then combine it with the target watermark to generate the target print instruction. For example, the first format data can be obtained by processing with the first filter described below, such as data converted from the file to be printed into PostScript format. This approach can preserve the original processing flow of the CUPS printing system as much as possible, reduce the impact on the CUPS system, and also reduce development costs and difficulty.

[0009] In conjunction with the first aspect, in one possible implementation, the print request further includes a target printer identifier; prior to determining the target watermark based on the target watermark template and the first information, the method further includes: determining the target watermark template from a preset watermark template based on the target printer identifier.

[0010] In this embodiment, one or more watermark templates can be preset, including a target watermark template corresponding to the target printer. Therefore, the computing device can determine the target watermark template from the preset watermark templates based on the identifier of the target printer. In this way, different watermark templates can be preset for different printers, or the same template can be preset for a group of printers, which can improve the flexibility of watermark template configuration and make the added watermark more distinctive.

[0011] In conjunction with the first aspect, in one possible implementation, the first information includes user information; the user information includes one or more of the client's username, the IP address of the device where the client is located, and the MAC address of the device where the client is located; before determining the target watermark based on the target watermark template and the first information, the method further includes: determining the target watermark template from a preset watermark template based on the user information.

[0012] In this embodiment, different watermark templates can be preset for different user information. This makes the added watermarks more identifiable, more traceable, and more secure. For example, different watermark templates can be preset for different IP addresses, usernames, etc., or for different user groups, IP address ranges, etc. Then, the computing device can determine the corresponding watermark template based on the username and / or IP address information in the first information.

[0013] In conjunction with the first aspect, in one possible implementation, the rules indicated by the target watermark template include the content for generating the watermark.

[0014] In conjunction with the first aspect, in one possible implementation, the content of the generated watermark includes a first watermark content and a second watermark content; wherein the first watermark content originates from the first information; and the second watermark content is a preset watermark content.

[0015] In this embodiment, the content of the target watermark can be flexibly configured using a watermark template. For example, the target watermark may include preset watermark content, as well as part or all of the content in the first information.

[0016] In conjunction with the first aspect, in one possible implementation, the rules indicated by the target watermark template further include a watermark format; wherein the watermark format includes one or more of a watermark font, a watermark font size, and a watermark color.

[0017] In this embodiment of the application, the watermark format of the target watermark can be flexibly configured through the watermark template, such as the watermark font, watermark font size, watermark color, etc.

[0018] In conjunction with the first aspect, in one possible implementation, the print request further includes print configuration information; wherein the print configuration information includes one or more of the following: paper size, paper orientation, whether to print double-sided, font, font size, font color, and print quality; before determining the target watermark based on the target watermark template and the first information, the method further includes: adjusting the watermark format in the target watermark template based on the print configuration information.

[0019] In this embodiment, the watermark format in the target watermark template can be adjusted based on the printing configuration information, so that the watermark printed later is clearer, simpler and more beautiful.

[0020] In conjunction with the first aspect, in one possible implementation, the first information further includes file information; the file information includes one or more of the following: file name, file size, file author, file creation time, last modification time, last access time, and file path.

[0021] In conjunction with the first aspect, in one possible implementation, the print request further includes an identifier of the target printer, and sending the target print instruction to the target printer includes: sending the target print instruction to the target printer based on the identifier of the target printer.

[0022] In conjunction with the first aspect, in one possible implementation, the print request includes multiple files to be printed, and the first information includes first information for each file to be printed.

[0023] The second aspect discloses a printing system, which can be a CUPS system, and the printing system can implement the watermark configuration method provided in the first aspect and any possible implementation thereof.

[0024] The third aspect discloses a computing device that includes the printing system disclosed in the second aspect above.

[0025] The fourth aspect discloses a computing device including a processor and a memory, wherein the processor calls a computer program stored in the memory to implement the watermark configuration method provided in the first aspect and any possible implementation thereof.

[0026] The fifth aspect discloses a computer-readable storage medium storing a computer program or computer instructions, which, when executed, implements the watermark configuration method disclosed in the above aspects.

[0027] The sixth aspect discloses a chip including a processor for executing a program stored in a memory, wherein when the program is executed, the chip performs the watermark configuration method disclosed in the above aspects.

[0028] As one possible implementation, the memory is located outside the chip.

[0029] The seventh aspect discloses a computer program product comprising computer program code, which, when executed, causes the watermark configuration methods disclosed in the above aspects to be performed.

[0030] It should be understood that the implementation and beneficial effects of the above-mentioned aspects or any possible implementation methods of this application can be referred to each other. Attached Figure Description

[0031] The accompanying drawings are provided to more clearly illustrate the technical solutions of the embodiments of this application. The drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a schematic diagram of a process for adding a watermark, as disclosed in an embodiment of this application;

[0033] Figure 2 This is a schematic diagram of the architecture of a CUPS system disclosed in an embodiment of this application;

[0034] Figure 3This is a schematic diagram of another CUPS system architecture disclosed in the embodiments of this application;

[0035] Figure 4 This is a flowchart illustrating a watermark configuration method disclosed in an embodiment of this application;

[0036] Figure 5 This is a flowchart illustrating another watermark configuration method disclosed in an embodiment of this application;

[0037] Figure 6 This is a schematic diagram of an information flow disclosed in an embodiment of this application;

[0038] Figure 7 This is a schematic diagram of the structure of a computing device disclosed in an embodiment of this application. Detailed Implementation

[0039] This application discloses a watermark configuration method that can improve the flexibility and efficiency of watermark configuration. The technical solutions in this application will be clearly and completely described below with reference to the accompanying drawings.

[0040] To better understand the embodiments of this application, the relevant terms and technologies of the embodiments of this application will be described below.

[0041] Hooking is a common software development technique that can "hijack" the original execution flow of a program and add custom processing logic. In other words, hooking allows you to insert and execute custom logic code into an existing program, thereby altering its behavior.

[0042] The Common Unix Printing System (CUPS) can be implemented using the Internet Printing Protocol (IPP), which allows for the management of print jobs and queues. Furthermore, the CUPS system also supports communication protocols such as the Line Printer Daemon (LPD) protocol, the Server Message Block (SMB) protocol, and the AppSocket protocol.

[0043] Watermarks can be text, graphics, or a combination of both. They can be used to track document origins and prevent unauthorized distribution of documents.

[0044] In related technologies, there are three main ways to add watermarks to documents (such as PDF, Word, etc.). The first is to use the watermark function of word processing software (such as Word software) to add watermarks. The second is to use the enhanced function of printers to add watermarks. The third is to add watermarks to the documents to be printed through hooks.

[0045] The first method described above typically involves adding a watermark to a document using the watermarking function of a word processing software before printing. The watermarked document is then sent to the printing system, which converts it into a format directly recognizable by the printer and sends it to the printer, which then prints the watermarked document. However, this method requires the user to manually add the watermark each time, resulting in low efficiency. Furthermore, different employees may add different watermark styles, leading to confusion and hindering unified management of watermarks and documents.

[0046] The second method described above involves configuring the watermark and its style through the printer's management interface or driver. Once configured, this method automatically adds the configured watermark to printed documents, allowing the printer to print watermarked paper documents. However, the watermark configured this way is fixed; changing it requires reconfiguration. Furthermore, this method typically supports fewer watermark formats, resulting in less flexibility in watermark configuration. Additionally, not all printers support this feature; some printers lack this functionality in their management interface or driver, and printers that support this feature are more expensive.

[0047] The following is combined Figure 1 The third method described above primarily uses hooking to intercept the CUPS service's processing steps to add watermarks to documents to be printed. Specifically, a hook library can be used to monitor the system's `rename` function. When it's detected that the CUPS service calls the `rename` function to process a file, and the renamed path of the processed file belongs to the CUPS directory, it can be determined that the corresponding file is a document to be printed. At this point, the hook library can intercept the document to be printed, add a watermark, and then release the interception, allowing the watermarked document to be handed over to the CUPS service for further processing, ultimately enabling the printer to print the watermarked document. While this method can automatically add watermarks by intercepting the CUPS's `rename` function, the hooking method requires system-wide support, which may lead to other security risks and reduce system security.

[0048] To address the aforementioned issues, this embodiment improves the relevant processing flow of the CUPS system by adding a watermark addition function to the CUPS system's PPD Filter (PostScript Printer Description Filter) module. This allows the PPD Filter module to add watermarks to documents to be printed. The watermark added by the PPD Filter module can be preset or generated based on specific information (such as user information, time information, etc.). This method automatically adds watermarks and is implemented directly based on the native functions of the CUPS system, exhibiting good compatibility and high efficiency. Furthermore, this method allows for flexible generation of corresponding watermarks based on specific information, making the watermarks more distinctive and containing richer information.

[0049] To better understand the embodiments of this application, the architecture of a traditional CUPS system will be described below.

[0050] Please see Figure 2 , Figure 2 This is a schematic diagram of the architecture of a CUPS system disclosed in an embodiment of this application. Figure 2 As shown, the CUPS system can include three parts: client, scheduling system, and printer-related modules.

[0051] The client is primarily used to receive user input and interact with the scheduling system based on that input. Users can use the client to send print requests, manage printers, manage print queues, and view printer status. Clients can be command-line clients such as Berkeley Commands, CUPS Commands, and System V Commands; LPD Support (cups-lpd) based on the LPD (Line Printer Daemon) protocol; or web-based Web Interface (CGI), i.e., the web interface client for the printer.

[0052] The scheduling system is primarily used to manage the overall printing-related process, including receiving and processing print requests. The scheduling system may include Scheduler (cupsd) 201, which is the scheduler of the CUPS system, responsible for interaction with clients and receiving print requests from them. Scheduler (cupsd) 201 can generate corresponding Job Files (202) based on the print requests from clients. Job Files (202) are print job files in the CUPS system, containing the content to be printed, relevant print settings (such as font, paper size, etc.), and other relevant information. Then, Job Files can be processed by Filter 203, converting them to a specific format, such as PostScript or other Page Description Language (PDL). After processing by Filter 203, the processing results (such as PostScript results) can be passed to the corresponding printer module for further processing before printing by the appropriate printer. The scheduling system may also include Log Files, Config Files, etc. The Log Files mainly record relevant log information of the CUPS system, such as system errors or system alarms, while the Config Files are mainly used to set printers, print queues, system parameters, etc.

[0053] As the name suggests, printer-related modules correspond to specific printers, and their functions may differ for different printers. The PPD Filter (204) functions similarly to the Filter (203) in the scheduling system, except that the Filter (203) in the scheduling system does not distinguish between printers, while the PPD Filter (204) is printer-specific. In other words, any Job File (202) can be processed through the Filter in the scheduling system, while further processing for a specific printer requires the PPD Filter (204). Essentially, for Job Files (202), they can first be processed by Filter 203, and after processing by Filter 203, they can be further processed by the PPD Filter (204) associated with the corresponding printer, ultimately yielding the corresponding print command. The printer can then print based on the print command. The print command is data represented in a format that the printer can understand / parse (such as data represented by PostScript), and the printer can print based on the print command.

[0054] The Port Monitor (205) is a port monitor for CUPS systems, which can be used to monitor the status of ports.

[0055] Backend(206) is the backend program of CUPS, which can be used to communicate with the printer, such as serial communication, network communication, etc. The data output by PPD Filter(204) can be sent to the corresponding Printer(207) through Port Monitor(205) and Backend(206), and Printer(207) can print the corresponding paper document based on the data.

[0056] Understandably, a filter can generally be a specific program that performs corresponding processing based on the input data, such as data format conversion, paper size adjustment, and font color adjustment. For example, a filter can convert Portable Document Format (PDF) files and text files (such as Word documents) into PostScript files. It is also understandable that the raw data (such as a Word document) sent from the client may pass through multiple filters sequentially before reaching the data that the printer can recognize. That is, both the aforementioned Filter (203) and PPD Filter (204) can include multiple filters. For example, different Filters (203) and PPD Filters (204) have different functions; therefore, the CUPS system can select one or more filters from multiple Filters (203) for processing, and can select one or more filters from multiple PPD Filters (204) for processing, to obtain the print instructions corresponding to the document to be printed.

[0057] In this embodiment, an improvement has been made to the traditional CUPS system, enabling it to automatically add watermarks to documents. Please see [link / reference]. Figure 3 , Figure 3 The paper presents the improvements made to the CUPS system in this application, mainly involving three modifications.

[0058] The first point concerns modifications to the client, enabling print requests sent by the client to Scheduler (cupsd) 201 to include extended file information. This extended file information can include details of the file to be printed, user information, time information, network address information, etc., and can be used to configure watermarks for the corresponding files to be printed.

[0059] The second point is the modification to Scheduler(cupsd)201, which enables Scheduler(cupsd)201 to support the pass-through of extended file information, that is, it enables Scheduler(cupsd)201 to pass-through the extended file information received from the client to PPD Filter(204).

[0060] The third point concerns the modification of PPD Filter (204), which allows PPD Filter (204) to add watermarks to the document to be printed based on expanded document information, enabling the printer to print watermarked paper documents. In one possible implementation, a filter for watermark configuration (hereinafter referred to as the watermark configuration module) can be added to PPD Filter (204), such as a filter named watermark.filter. This filter can be used to add watermarks to the document to be printed, such as adding the corresponding watermark printing instruction to the print command corresponding to the document.

[0061] It is understandable that the CUPS system can be integrated into an operating system, meaning it can be part of an operating system, such as Linux or Fusion OS. In some possible implementations, only the client-side portion of the CUPS system can be integrated into the operating system.

[0062] It is also understandable that the client in a CUPS system and other components of the CUPS system can be deployed on the same device (such as a server) or on different devices. For example, the client and other components of the CUPS system can both be deployed on the first device. As another example, the client in the CUPS system can be deployed on the first device, while the other components can be deployed on the second device.

[0063] It should be noted that, Figure 3 The system architecture shown is merely illustrative and does not constitute a limitation thereof. In other embodiments of this application, Figure 3 The system architecture shown may include more or fewer software modules than illustrated, or some modules may be merged, or some modules may be split, or different module settings may be used, etc., without any restrictions.

[0064] The execution flow of the watermark configuration method provided in this application will be described in general below.

[0065] Based on the above system architecture, please refer to Figure 4 , Figure 4 This is a flowchart illustrating a watermark configuration method disclosed in an embodiment of this application. Figure 4The process shown can be executed by a computing device; specifically, the process method is run by a processor in the computing device.

[0066] like Figure 4 As shown, the watermark configuration method may include, but is not limited to, the following steps:

[0067] 401. Receive a print request, which includes a document to be printed and first information related to the document to be printed.

[0068] Specifically, the computing device can receive print requests, which may be generated by the computing device based on the user's print operation or sent by other devices.

[0069] The first information may be information related to the document to be printed. For example, the first information may include user information, which may include one or more of the following: the client's username, the IP address of the client's device, and the MAC address of the client's device. The first information may also include file information, which may include one or more of the following: filename, file size, file author, file creation time, last modification time, last access time, and file path. The first information may also include time information (such as the current time), and other relevant information, but this embodiment does not limit these details.

[0070] In some possible implementations, the print request may also include print configuration information. Print configuration information may include one or more of the following: printer identifier, number of copies to be printed, paper size, paper orientation (landscape / portrait), whether duplex printing is required, font, font size, font color, and print quality (such as print resolution).

[0071] 402. Determine the target watermark based on the target watermark template and the first information, wherein the target watermark template is used to indicate the generation rules of the target watermark.

[0072] After receiving a print request, the computing device can determine the target watermark based on the target watermark template and the first information. The target watermark template is used to indicate the generation rules of the target watermark.

[0073] Specifically, the rules indicated by the target watermark template may include the content for generating the watermark, that is, the target watermark template can indicate what specific content can be included in the target watermark. For example, the content for generating the watermark (the content of the target watermark) may include the first watermark content. For another example, the content for generating the watermark may include the second watermark content. For yet another example, the content for generating the watermark includes the first watermark content and the second watermark content. Among them, the first watermark content may be derived from the first information, and the second watermark content may be preset watermark content. The preset watermark content is some custom watermark content, such as "Confidential", "Prohibited from copying", "XX business secret, prohibited from spreading", etc.

[0074] Exemplarily, the target watermark template may indicate that the watermark content includes the username and IP address in the first information, and the preset watermark content "Prohibited from copying", that is, the target watermark only uses two pieces of information, namely the IP address and username in the first information, and the preset watermark content "Prohibited from copying".

[0075] The rules indicated by the target watermark template may also include the watermark format. Among them, the watermark format may include one or more of the watermark font, watermark font size, and watermark color.

[0076] In some possible implementation manners, the rules indicated by the target watermark template may also include typesetting rules, page range (the page range to apply the watermark, such as all pages, partial pages), etc. The typesetting rules may include one or more of the display order, display position (such as the center of the page, the lower right corner of the page, the lower left corner of the page, etc.), and display style (such as slanted, horizontal, etc.) of each watermark content.

[0077] The computing device can determine the target watermark based on the target watermark template and the first information. Exemplarily, assume that the watermark content indicated by the target watermark template includes the username "Zhang San", IP address "175.23.14.21" in the first information, and the preset watermark content "Prohibited from copying", the indicated watermark color is light gray, the watermark font is regular script, the watermark font size is 40 points, and the indicated typesetting rules are {display order: username, custom watermark content, IP address, watermark display position: the center of the page, display style: slanted}. Based on this target watermark template and the username and IP address in the first information, the computing device can determine the target watermark, that is, it can determine that the content of the target watermark is "Zhang San Prohibited from copying 175.23.14.21", the watermark color is light gray, the watermark font is regular script, the watermark font size is 40 points, the watermark display position is the center of the page, and the display style is slanted. <​​​It should be noted that in some possible implementations, one or more watermark templates can be preset, and these one or more watermark templates may include a target watermark template. In this case, the computing device can first obtain the target watermark template from these one or more watermark templates.

[0080] It is understandable that the preset one or more watermark templates may be preset for different printers or for different user information, etc. In different situations, the computing device may obtain the target watermark template from the one or more watermark templates in different ways. The following explains some situations.

[0081] In some possible implementations, one or more preset watermark templates are preset for different printers. For example, each printer installed on the computing device may have a preset watermark template, or printers may be categorized with a separate watermark template for each category, or all installed printers may use the same template. In this case, there may be a correspondence between printers and watermark templates, and the computing device can determine the target watermark template corresponding to the target printer based on this correspondence. For example, the computing device can determine the target watermark template from the preset watermark templates based on the target printer identifier.

[0082] In some possible implementations, one or more preset watermark templates are preset for different user information. For example, a watermark template can be preset for each different user, or users can be grouped, with each user group having its own preset watermark template. Another example is that a watermark template can be preset for each different IP address range. In this case, there can be a correspondence between user information and watermark templates, and the computing device can determine the target watermark template from the preset watermark templates based on the user information. For instance, suppose watermark template 1 is preset for "Zhang San," watermark template 2 is preset for "Li Si" and "Wang Wu," and watermark template 3 is preset for "Ma Qi." After receiving a print request, the computing device can determine the corresponding watermark template based on the username in the print request. For example, if the username is "Ma Qi," watermark template 3 can be determined as the target watermark template.

[0083] The above are merely two exemplary implementation methods. In practice, other watermark templates can be preset according to actual needs, such as preset based on the file information in the first information, or preset based on the printing configuration information (such as presetting different watermark templates for different page sizes). Alternatively, the watermark template can be preset by combining multiple elements from printer identification, user information, and file information.

[0084] It is understandable that in some cases, the watermark format in the target watermark template may not match the document to be printed. Therefore, in some possible implementations, the computing device can adjust or replace the watermark format in the target watermark template. In one specific implementation, the computing device can adjust the watermark format in the target watermark template based on print configuration information. For example, if the watermark font size indicated in the target watermark template is 30, while the page size in the print configuration information is A3, the watermark font may be too small relative to the page size. The computing device can adjust the watermark font size in the target watermark template to 50 to better fit the A3 page size, making the printed watermark clearer, simpler, and more aesthetically pleasing.

[0085] It should be noted that the aforementioned computing device determines the target watermark based on the target watermark template and the first information. In fact, it can determine the content, watermark format, layout rules, etc. of the target watermark.

[0086] 403. Generate target print instructions based on the file to be printed and the target watermark.

[0087] In some possible implementations, the computing device may first generate first-format data based on the document to be printed, and then generate the target printing instruction based on the first-format data and the target watermark. The first-format data may be in PostScript format; for more information on the first-format data, please refer to the following... Figure 5 The relevant descriptions in the illustrated embodiments.

[0088] Furthermore, the computing device can obtain a watermark printing instruction based on the target watermark, which is used to print the target watermark. Then, the computing device can obtain a target printing instruction based on the watermark printing instruction and data in a first format.

[0089] 404. Send a target print instruction to the target printer, which instructs the target printer to print the document to be printed with the target watermark.

[0090] After the computing device generates the target print instruction, it can send the target print instruction to the target printer. Correspondingly, the target printer can receive the target print instruction from the computing device and print the document with the target watermark based on the instruction.

[0091] The execution flow of the watermark configuration method provided in this application is described below from the perspective of each software module in the CUPS system.

[0092] Based on the above system architecture, please refer to Figure 5 , Figure 5 This is a flowchart illustrating a watermark configuration method disclosed in an embodiment of this application. Figure 5As shown, the watermark configuration method may include, but is not limited to, the following steps:

[0093] 501. The client receives user input and sends a print request to the Scheduler. The print request includes the file to be printed and initial information.

[0094] When a user needs to print a document, they can input relevant printing information through the client. This information can include the document to be printed (referred to as the file to be printed) or the filename of the document to be printed. In addition, the relevant printing information can also include print configuration information, such as printer identification, number of copies to be printed, paper size, paper orientation (landscape / portrait), whether to print double-sided, font, font size, font color, and print quality (such as print resolution). The printer identification can be the printer's name, serial number, or other information that identifies a printer and can be used to indicate which printer to use for printing.

[0095] After receiving the relevant printing information input by the user, the client can send a print request to the Scheduler. In this embodiment, to ensure that the printed document includes a watermark, the print request may carry first information in addition to the document to be printed and the print configuration information. The first information may be information about the document to be printed that is automatically obtained by the client. This first information may include file information, user information corresponding to the document (such as the username of the user using the client), time information (such as the current time), and address information (such as the IP address and MAC address of the client's device). Specifically, the file information may include the filename, file size, author of the document, file creation time, last modification time, last access time, and file path.

[0096] It is understandable that a user may have multiple files to print, and the print request may include multiple files to print simultaneously. In this case, each file to print may have corresponding primary information and corresponding print configuration information. This can greatly improve the flexibility of printing and watermark settings.

[0097] It should be understood that including print configuration information in a print request is optional. For example, if the user has entered print configuration information, the print request can include that information. If the user has not entered any print configuration information, the print request can omit it, in which case the default print configuration, such as the default printer and paper size, can be used.

[0098] In one possible implementation, the print request may also carry a task number, which may be pre-assigned by the Scheduler before the print request is received. This task number can be used to identify the print job (file) corresponding to the print request.

[0099] 502. The Scheduler generates print job files based on print requests.

[0100] After receiving a print request from a client, the Scheduler can generate a print job file based on the print request. Specifically, the Scheduler can generate a print job file based on the file to be printed and the corresponding print configuration information carried in the print request. The print job file can include the file to be printed, relevant print settings (such as font, paper size, etc.), and other relevant information.

[0101] In one possible implementation, print job files can be stored in the corresponding directory according to preset rules.

[0102] 503. The Scheduler sends the print job file to the first filter.

[0103] After the Scheduler generates the print job file, it can send the print job file to the first filter. The first filter is also the filter in the scheduling system.

[0104] 504. The first filter processes the print job file to obtain the first format data.

[0105] After receiving the print job file, the first filter can process it to obtain data in a first format. For example, the first filter can convert the print job file into data in the first format, such as converting it into PostScript format.

[0106] It should be noted that the first filter can include one or more filters. When multiple filters are included, they can be used in conjunction to process the print job file. The output of the last filter can be data in the first format. For example, assuming the first format is PostScript, and the file to be printed is in PDF format and named example.pdf, filter 1 can first convert example.pdf to example.typeA, that is, convert it to a file of type A. Then, filter 2 can convert example.typeA to example.typeB, that is, convert it to a file of type B. Finally, filter 3 can convert example.typeB to example.ps, that is, convert it to a PostScript file.

[0107] 505. The first filter sends data in the first format to the second filter.

[0108] After the first filter processes the data to obtain the first format data, it can send the first format data to the second filter so that the second filter can continue processing based on the first format data.

[0109] 506. The Scheduler sends the first message to the second filter.

[0110] In order for the second filter to configure the corresponding watermark for the file to be printed based on the first information, the Scheduler can send the first information to the second filter.

[0111] 507. The second filter obtains the target printing instruction based on the first information and the first format data, the target printing instruction including the watermark printing instruction.

[0112] In this embodiment, the second filter can generate a corresponding watermark printing instruction based on the first information, and then obtain a target printing instruction based on the watermark printing instruction and the first format data. The watermark printing instruction is used to print the target watermark. For example, the first format data can be a printer-recognizable format, i.e., it can be considered an executable printing instruction. In this case, the second filter can directly add the watermark printing instruction to the first format data without processing the first format data, thus obtaining the target printing instruction. Alternatively, the second filter can process the first format data (e.g., perform format conversion, adjust font size, etc.) to obtain second format data, and then add the watermark printing instruction to the second format data to obtain the target printing instruction. It should be understood that the first format data and the second format data can have the same format (e.g., both are PostScript format) or different formats.

[0113] In one possible implementation, to generate a corresponding watermark printing instruction based on the first information, a watermark template can be preset. The second filter can generate the corresponding watermark printing instruction based on the first information and the preset watermark template. Specifically, the watermark template can define which information in the first information needs to be displayed, the custom watermark content to be displayed (such as "Confidential," "Copying Prohibited," "XX Trade Secret, Dissemination Prohibited," etc.), and can also define the layout rules, watermark format, and page range (the page range to which the watermark is applied, such as all pages or part of the page). The layout rules can include the display order, display position (such as the center of the page, the lower right corner of the page, etc.), and display style (such as italic, horizontal, etc.) of the information to be displayed. The watermark format can include the watermark font, watermark font size, and watermark color. Based on the watermark template, the second filter can determine the watermark text to be printed, the layout rules, and the watermark format. Then, the second filter can generate the corresponding watermark printing instruction based on the watermark text to be printed, the layout rules, and the watermark format.

[0114] For example, suppose the watermark template only uses the IP address and username from the first set of information, along with the custom watermark content "Copying is strictly prohibited." Furthermore, this information needs to be organized in the order of username, custom watermark content, and IP address, such as "Zhang San, copying is strictly prohibited 175.23.14.21." Additionally, the watermark can be centered on the page, displayed at an angle, painted light gray, use a KaiTi font, and be 40pt in size. Based on this information, the second filter can generate the corresponding watermark printing instructions.

[0115] It should be noted that the watermark template can be preset by the administrator, and the administrator can make dynamic adjustments according to the actual situation, which is highly flexible.

[0116] Furthermore, in some cases, to make the printed watermark clearer, simpler, and more aesthetically pleasing, the watermark printing instruction can be generated by combining print configuration information or print configurations (such as page size, font color, etc.) from the first format data. In other words, the second filter can adjust the preset watermark template based on the print configuration information, as described above. Figure 4 The relevant descriptions in the illustrated embodiments.

[0117] In some possible implementations, different watermark templates can be preset for each printing configuration. For example, since the page size of the document to be printed has various formats, such as A3, A4, A5, etc., the watermark font size can also be different for different page sizes. Therefore, corresponding watermark templates can be preset for different page sizes. For example, for the watermark template corresponding to A3, the watermark font size can be 50; for the watermark template corresponding to A4, the watermark font size can be 40; and for the watermark template corresponding to A5, the watermark font size can be 30.

[0118] Furthermore, in some cases, to make the printed watermark more distinctive and secure, different watermark templates can be preset for different IP addresses, usernames, etc., or for different user groups, IP address ranges, etc. In this way, the second filter can determine the corresponding watermark template based on the username and / or IP address information in the first information, and then generate a watermark printing instruction based on the corresponding watermark template and the first information. This makes the printed watermark more traceable and secure.

[0119] It should be noted that the second filter may include one or more filters. When multiple filters are included, they can work together to process the first information and the first format data. The output of the last filter can be the target print instruction. It should also be noted that the second filter is specific to the target printer. That is, different printers may use different second filters and different preset watermark templates, allowing for different watermark printing configurations for different printers.

[0120] It should be understood that when a print job file includes multiple files to be printed, the first format data can include print instructions corresponding to multiple files to be printed. Furthermore, the second filter can generate corresponding watermark print instructions based on the first information of each file to be printed, and then obtain the target print instruction based on the watermark print instructions and print instructions corresponding to each file. This ensures that the watermark for each file to be printed is generated based on its own corresponding first information, allowing for flexible setting of different watermarks for different files to be printed.

[0121] In the above implementation, the corresponding watermark printing instruction is generated based on the first information carried in the print request. However, in another possible implementation of this application, the print request may not carry the first information. In this case, the second filter can directly obtain the target print instruction based on the preset watermark template and the first format data.

[0122] It should be noted that in this embodiment, the watermark configuration can be an option, which the user can choose to enable or disable. When disabled, the second filter will not obtain the target printing instruction based on the first information and the first format data; it can directly obtain the target printing instruction based on the first format data. In this case, the target printing instruction may not include the watermark printing instruction. When enabled, the second filter will obtain the target printing instruction based on the first information and the first format data.

[0123] 508. The second filter sends the target print command to the backend.

[0124] After the second filter generates the target print command, it can send the target print command to the backend.

[0125] 509. Backend sends the target print command to the target printer.

[0126] After receiving the target print instruction from the second filter, the backend can send the target print instruction to the target printer. Specifically, the target printer can be the printer corresponding to the printer identifier carried in the print request. If the print request does not carry a printer identifier, the target printer can be the default printer.

[0127] 510. The target printer prints a paper document with the target watermark based on the target print command.

[0128] After receiving the target print command from the backend, the target printer can print a paper document with the target watermark based on the target print command.

[0129] It should be noted that the execution order of steps 501-509 in this embodiment is not limited, as long as it conforms to logic. Furthermore, some steps in steps 501-509 do not have a specific relationship and can be executed in parallel. For example, any step in steps 502-505 and step 506 can be executed in parallel with step 506.

[0130] In the above processing flow, the client can automatically obtain the first information corresponding to the document to be printed. Then, it can include this first information in the print request. Based on this information, a corresponding watermark printing instruction can be generated for the document and embedded into the print instruction, causing the printer to print a paper document with the target watermark. This implementation is seamless for the user, reducing user interaction. Furthermore, administrators can flexibly configure different watermark templates, improving the flexibility and consistency of the watermark.

[0131] The following is combined Figure 6 The above watermark configuration method is illustrated by example. Please refer to [link / reference]. Figure 6 , Figure 6 This is a schematic diagram of an information flow disclosed in an embodiment of this application.

[0132] like Figure 6As shown, the user can input information 1 through the client, which is the file to be printed or its document byte stream. In addition, the client can obtain first information, including the document information of the file to be printed and relevant user information (such as username, IP address, etc.). Then, the client can send a print request to the Scheduler, which can carry information 2. Information 2 can include information 1, the first information, the task number, etc. After receiving information 2, the Scheduler can perform relevant processing and convert the document byte stream of the file to be printed into the corresponding print instruction 1 through a Filter. Print instruction 1 can be considered as the first format data mentioned above. Then, information 3 can be sent to the PPD Filter. Information 3 can include the print instruction 1 corresponding to the file to be printed and the first information. The PPD Filter can generate watermark printing instructions through a Template module (such as the watermark.filter mentioned above). For example, the PPD Filter can send information 4 to the Template module. Information 4 can include the print instruction 2 corresponding to the file to be printed and the first information. The print command 2 corresponding to the file to be printed included in information 4 and the print command 1 corresponding to the file to be printed included in information 3 can be different or the same. That is, the PPD Filter can process based on print command 1 (such as adjusting page size, font color, etc.) or directly pass through print command 1. The Template module can generate the corresponding watermark print command based on the first information in information 4, and then send information 5 to the PPD Filter. Information 5 can include print command 3 and watermark print command corresponding to the file to be printed. The print command 3 corresponding to the file to be printed included in information 5 and the print command 2 corresponding to the file to be printed included in information 4 can be different or the same. That is, the Template module can process based on print command 2 (such as adjusting page size, font color, etc.) or directly pass through print command 2. Afterwards, the PPD Filter can generate a watermarked print command based on print command 3 and watermark print command, such as adding the watermark print command to print command 3. Finally, the PPD Filter can send information 6 to the printer through the backend program. Information 6 can include the watermarked print command. After receiving information 6, the printer can print a watermarked paper document based on the print instructions in information 6. It should be understood that the aforementioned Template module can be part of the PPD Filter. It is also understood that print instructions 1, 2, and 3 can be data of the same or different formats; this is not limited here.

[0133] visible, Figure 6In this process, more information (such as user information, document information, etc.) can be carried during the flow of printed information, and then more flexible and richer watermark configurations can be made based on this information.

[0134] It should be noted that the relevant information (i.e., the same or similar information) and related descriptions in the different embodiments described above can be referenced from each other.

[0135] It should be understood that the above Figure 4 The above processing flow is illustrated using a computing device as the executing entity in the interaction illustration, but this application does not limit the executing entity of this interaction illustration. For example, Figure 4 The computing device mentioned can also be a chip, chip system, or processor that supports the implementation of the method on the computing device, or it can be a logic module or software that can implement all or part of the functions of the computing device. Similarly, Figure 5 The above processing flow is illustrated using a module of a computing device (such as a client, scheduler module, backend module, etc.) as the execution entity for the interaction illustration, but this application does not limit the execution entity of this interaction illustration. In fact, Figure 5 The operations performed by each functional module can be executed by the corresponding chip, chip system, or processor (such as CPU).

[0136] Based on the above system architecture, please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of a computing device disclosed in an embodiment of this application. The computing device 700 may include a processor 701, a communication interface 702, and a memory 703. The processor 701, communication interface 702, and memory 703 may be interconnected or interconnected via a bus 704.

[0137] For example, memory 703 is used to store computer programs and data of computing device 700. Memory 703 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM). Communication interface 702 is used to support computing device 700 in communication, such as receiving or sending data.

[0138] For example, processor 701 may be a central processing unit (CPU), a complex programmable logic device, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, etc.

[0139] In one embodiment, processor 701 can be used to read the program stored in memory 703 and execute it. Figure 4 or Figure 5 The operations performed by the computing device or modules in the computing device in the method embodiments shown can be referred to the above-mentioned descriptions, and will not be repeated in detail here.

[0140] It should be noted that, Figure 7 The computing device 700 shown is merely one implementation of the embodiments of this application. In actual applications, the computing device 700 may include more or fewer components, which is not limited here.

[0141] This application also discloses a computer-readable storage medium storing instructions thereon, which, when executed, perform the methods described in the above method embodiments.

[0142] This application also discloses a computer program product including instructions that, when executed, perform the methods described in the above method embodiments.

[0143] Obviously, the embodiments described above are only some embodiments of this application, and not all embodiments. The term "embodiment" as used herein means that a specific feature, structure, or characteristic described in connection with an embodiment can be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily indicate the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will understand, explicitly and implicitly, that the embodiments described herein can be combined with other embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application. The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects and are not used to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, it may include a series of steps or units, or optionally, steps or units not listed, or optionally other steps or units inherent to these processes, methods, products, or devices. It is understandable that the equal sign in the above conditional judgment can be either greater than or less than one side. For example, the above conditional judgment of a threshold being greater than, less than, or equal to can also be changed to a conditional judgment of the threshold being greater than or equal to, or less than. This is not limited here.

[0144] It is understood that the accompanying drawings show only the parts relevant to this application and not all of them. It should be understood that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0145] The terms “component,” “module,” “system,” “unit,” etc., used in this specification are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, a thread of execution, a program, and / or distributed between two or more computers. Furthermore, these units can be executed from various computer-readable media on which various data structures are stored. For example, a unit can communicate via local and / or remote processes based on signals having one or more data packets (e.g., data from a second unit interacting with another unit between a local system, a distributed system, and / or a network; for example, the Internet interacting with other systems via signals).

[0146] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.

Claims

1. A watermark configuration method based on the general-purpose Unix printing system CUPS, characterized in that, include: Receive a print request, the print request including a file to be printed and first information, the first information being related to the file to be printed, the first information including user information and file information; The target watermark is determined based on the target watermark template and the first information; The rules indicated by the target watermark template include the content for generating the watermark; wherein, the target watermark template is determined from a preset watermark template; the preset watermark template is preset based on printer identification, user information, and file information; First format data is generated based on the file to be printed using the first filter; The second filter generates a target printing instruction based on the first format data and the target watermark. Send the target print instruction to the target printer; the target print instruction is used to instruct the target printer to print the document to be printed with the target watermark.

2. The method according to claim 1, characterized in that, The print request also includes the target printer identifier; Before determining the target watermark based on the target watermark template and the first information, the method further includes: The target watermark template is determined from the preset watermark templates based on the target printer identifier.

3. The method according to claim 1, characterized in that, The user information includes one or more of the client's username, the IP address of the client's device, and the MAC address of the client's device. Before determining the target watermark based on the target watermark template and the first information, the method further includes: The target watermark template is determined from the preset watermark templates based on the user information.

4. The method according to claim 1, characterized in that, The generated watermark content includes a first watermark content and a second watermark content; wherein, the first watermark content originates from the first information; and the second watermark content is a preset watermark content.

5. The method according to claim 1, characterized in that, The rules indicated by the target watermark template also include the watermark format; wherein the watermark format includes one or more of the following: watermark font, watermark font size, and watermark color.

6. The method according to claim 5, characterized in that, The print request also includes print configuration information; wherein, the print configuration information includes one or more of the following: paper size, paper orientation, whether to print double-sided, font, font size, font color, and print quality; Before determining the target watermark based on the target watermark template and the first information, the method further includes: Adjust the watermark format in the target watermark template based on the print configuration information.

7. The method according to any one of claims 3-6, characterized in that, The file information includes one or more of the following: file name, file size, file author, file creation time, last modification time, last access time, and file path.

8. A computing device, characterized in that, The computing device includes a memory and a processor; the memory is used to store program instructions; the processor is used to invoke the program instructions to enable the computing device to implement the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device of embedding watermark information into printing content

    CN103164830A

  • Method and device of printing watermark in self-adaptive manner

    CN107423006A