CN113641312A - File printing method and device - Google Patents

File printing method and device Download PDF

Info

Publication number
CN113641312A
CN113641312A CN202110921164.8A CN202110921164A CN113641312A CN 113641312 A CN113641312 A CN 113641312A CN 202110921164 A CN202110921164 A CN 202110921164A CN 113641312 A CN113641312 A CN 113641312A
Authority
CN
China
Prior art keywords
content
printing
printed
instruction
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110921164.8A
Other languages
Chinese (zh)
Inventor
周小林
李仕毅
赵忠祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Skyguard Network Security Technology Co ltd
Original Assignee
Beijing Skyguard Network Security Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Skyguard Network Security Technology Co ltd filed Critical Beijing Skyguard Network Security Technology Co ltd
Priority to CN202110921164.8A priority Critical patent/CN113641312A/en
Publication of CN113641312A publication Critical patent/CN113641312A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1222Increasing security of the print job
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1238Secure printing, e.g. user identification, user rights for device usage, unallowed content, blanking portions or fields of a page, releasing held jobs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1259Print job monitoring, e.g. job status
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1285Remote printer device, e.g. being remote from client or server

Abstract

The invention discloses a file printing method and device, and relates to the technical field of computers. One embodiment of the method comprises: monitoring whether a printing instruction is received; under the condition of receiving a printing instruction, generating a primitive file drawing instruction according to the printing instruction, and replacing the printing instruction by using the primitive file drawing instruction; executing a graphics file drawing instruction to obtain the content to be printed; determining whether the content to be printed contains abnormal content; and under the condition that the content to be printed contains abnormal content, adding an identifier into the content to be printed, generating a target printing page, and printing the target printing page by using printing equipment. This embodiment realizes treating the effect of printing the content and analyzing and managing to when someone printed unusual content, can add the sign in treating the printed content, thereby kept the evidence of having printed unusual content, conveniently trace to the source afterwards.

Description

File printing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a file printing method and device.
Background
With the popularization of computer-related technologies, printing apparatuses have been widely used in office environments. However, in an enterprise office scene, since the prior art cannot monitor and manage the files printed by the employees by using the printing equipment, confidential files and the like of the enterprise are easily leaked, and the information security of the enterprise cannot be guaranteed.
Disclosure of Invention
In view of this, embodiments of the present invention provide a file printing method and apparatus, which can determine whether a content to be printed includes abnormal content when a print instruction is received, and can add an identifier to the content to be printed to generate a target print page when it is determined that the content to be printed includes the abnormal content, and print the target print page by using a printing device, so as to achieve an effect of analyzing and managing the content to be printed.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a document printing method.
The file printing method of the embodiment of the invention comprises the following steps:
monitoring whether a printing instruction is received;
under the condition of receiving a printing instruction, generating a primitive file drawing instruction according to the printing instruction, and replacing the printing instruction by using the primitive file drawing instruction;
executing a graphics file drawing instruction to obtain the content to be printed;
determining whether the content to be printed contains abnormal content;
and under the condition that the content to be printed contains abnormal content, adding an identifier into the content to be printed, generating a target printing page, and printing the target printing page by using printing equipment.
Alternatively,
generating a graphic element file drawing instruction according to the printing instruction, wherein the generating of the graphic element file drawing instruction comprises the following steps:
creating a graphic element file;
and taking the printing instruction as an input parameter, taking the address of the primitive file as an output parameter, and generating a primitive file drawing instruction according to the input parameter and the output parameter.
Alternatively,
executing a primitive file drawing instruction to acquire content to be printed, including:
executing the primitive file drawing instruction to acquire the content to be printed according to one or more pieces of calling interface information corresponding to the printing instruction;
and caching the content to be printed into the primitive file.
Alternatively,
in the case where it is determined that the content to be printed contains abnormal content,
when the content to be printed has a plurality of pages, the following steps are executed for each page of the content to be printed:
calling a first drawing function according to the content to be printed to generate a page to be printed corresponding to the content to be printed;
calling a second drawing function, adding a watermark on the page to be printed, and generating a target printing page, wherein the second drawing function indicates the adding position of the watermark;
printing the target print page with the printing device.
Alternatively,
determining whether the content to be printed contains abnormal content or not, wherein the determining step comprises the following steps:
matching the content to be printed with preset abnormal keywords, and determining whether the content to be printed contains the abnormal keywords so as to determine whether the content to be printed contains the abnormal content; or the like, or, alternatively,
and determining whether the content to be printed contains abnormal content or not by using a regular expression matching algorithm.
Alternatively,
when the content to be printed is determined to contain abnormal content, the method further comprises the following steps:
acquiring time for sending a printing instruction and client information;
generating an abnormal printing log according to the time, the client information and the target printing page;
and uploading the abnormal printing log to a server for storage.
Alternatively,
when the content to be printed is determined to contain abnormal content, the method further comprises the following steps:
increasing the number of abnormal printing times corresponding to the client information which sends the printing instruction;
and determining whether the abnormal printing times is greater than a preset threshold value, and if so, sending early warning information to an administrator.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a document printing apparatus.
The file printing device comprises an instruction monitoring module, an instruction generating module, an instruction executing module, a content analyzing module and a printing module; wherein:
the instruction monitoring module is used for monitoring whether a printing instruction is received or not;
the instruction generating module is used for generating a primitive file drawing instruction according to the printing instruction under the condition of receiving the printing instruction, and replacing the printing instruction with the primitive file drawing instruction;
the instruction execution module is used for executing the primitive file drawing instruction so as to obtain the content to be printed;
the content analysis module is used for determining whether the content to be printed contains abnormal content;
and the printing module is used for adding an identifier into the content to be printed under the condition that the content to be printed contains abnormal content, generating a target printing page and printing the target printing page by using the printing equipment.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a document printing electronic apparatus.
An electronic device for printing a file according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement a method of printing a document according to an embodiment of the present invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of an embodiment of the present invention has stored thereon a computer program that, when executed by a processor, implements a file printing method of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: can be under the condition of receiving the print order, whether contain unusual content in the definite content of waiting to print, and under the condition of confirming to wait to contain unusual content in the content of printing, can add the sign in waiting to print the content, generate the target and print the page, reuse printing apparatus and print this target and print the page, thereby realize treating the effect of printing content and carrying out analysis and management, and when someone printed unusual content, can add the sign in waiting to print the content, thereby the evidence of having printed unusual content has been kept, the convenience traces to the source after the fact.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a document printing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a process for generating primitive file drawing instructions based on printing instructions;
fig. 3 is a schematic diagram of a process for executing step S105;
FIG. 4 is a schematic diagram of the main modules of a document printing apparatus according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
Fig. 1 is a schematic diagram of main steps of a document printing method according to an embodiment of the present invention.
As shown in fig. 1, a document printing method according to an embodiment of the present invention mainly includes the following steps:
step S101: and monitoring whether a printing instruction is received.
In the embodiment of the invention, the printing instruction initiated by the application program can be intercepted and captured through the API HOOK. Specifically, an API function call for creating equipment context initiated by an application program is monitored and captured through API HOOK, and the function is a CreateDC function; because the CreateDC function supports the creation of device contexts for various graphic output devices, such as a computer screen, a printing device, a plotter, and the like, the present solution only needs to control the printing device, and therefore, it needs to determine whether the corresponding graphic output device is the printing device according to the parameter in the CreateDC function, determine that a print instruction is received if the parameter in the CreateDC function indicates the printing device, and determine that the print instruction is not received if the parameter in the CreateDC function does not indicate the printing device.
For example, the API function call for creating device context initiated by the API HOOK listening and capturing application is:
HDC printerDC=CreateDC("HP LaserJet 4P/4MP","HPPCL5E","LPT1",NULL);
as is known from the parameter of the CreateDC function, "HP LaserJet 4P/4MP" indicates the printing apparatus, and thus it is determined that the print instruction is received.
Step S102: and under the condition of receiving the printing instruction, generating a primitive file drawing instruction according to the printing instruction, and replacing the printing instruction by using the primitive file drawing instruction.
In the embodiment of the invention, the printing instruction is not immediately executed when the printing instruction is received, because once the printing instruction is executed, the printing device prints the content to be printed, and the content to be printed cannot be acquired and analyzed. Therefore, a primitive file drawing instruction needs to be generated according to the printing instruction, and the printing instruction is replaced by the primitive file drawing instruction, so that the content to be printed can be acquired and analyzed in the subsequent steps.
In the embodiment of the present invention, a process of generating a metafile drawing instruction according to a printing instruction is shown in fig. 2, and mainly includes the following steps:
step S201: creating a graphic element file;
step S202: and taking the printing instruction as an input parameter, taking the address of the primitive file as an output parameter, and generating a primitive file drawing instruction according to the input parameter and the output parameter.
Specifically, a metafile (emf format) may be created first at a certain address, and the address may be preset or customized. For example, the address of a metafile is: "c: \ \ users \ \ test \ \ temp \ \123. emf". And then using the CreateEnhMetaFile function, using the printing instruction as an input parameter of the CreateEnhMetaFile function, and using the address of the metafile as an output parameter of the CreateEnhMetaFile function to generate a metafile drawing instruction. Generating a metafile drawing instruction example:
HDC emfDC=CreateEnhMetaFile(printerDC,"c:\\users\\test\\temp\\123.emf",&rect,NULL);
step S103: and executing the primitive file drawing instruction to acquire the content to be printed.
In the embodiment of the present invention, the process of executing step S103 mainly includes: executing the primitive file drawing instruction to acquire the content to be printed according to one or more pieces of calling interface information corresponding to the printing instruction; and caching the content to be printed into the primitive file.
Specifically, after replacing the printing instruction with the metafile drawing instruction, the metafile drawing instruction is executed, so that the printing instruction (i.e., a CreateDC function called by the application) initiated by the application can be responded, drawing operation contents such as one or more GDI (Graphics Device Interface) functions called by the application can be redirected to the metafile, and then the contents to be printed are obtained according to the one or more GDI functions, and the contents to be printed are also cached in the metafile.
In the embodiment of the invention, after the printing process is completed, the application program initiates a delete device context API function call, that is, a DeleteDC function is called. The DeleteDC function called by the application can thus be listened to and captured through the API HOOK. When the DeleteDC function is determined to be captured, which indicates that the content to be printed is completely cached in the metafile, a content analysis module can be called to determine whether the content to be printed cached in the metafile contains abnormal content.
Step S104: and determining whether the content to be printed contains abnormal content.
In the embodiment of the invention, the abnormal content is content which may relate to enterprise confidential information, business information, sensitive information or enterprise obligations to be kept confidential according to laws or contracts. Since these contents are printed out with a risk of leakage, it is necessary to determine whether the contents to be printed contain abnormal contents at the time of printing, and if so, to retain the evidence in a certain manner, which will be described in detail later.
In the embodiment of the invention, the content to be printed can be matched with the preset abnormal keywords, and whether the content to be printed contains the abnormal keywords or not is determined so as to determine whether the content to be printed contains the abnormal content or not; or determining whether the content to be printed contains abnormal content by using a regular expression matching algorithm; whether the content to be printed contains abnormal content can be determined according to the storage address of the content to be printed (files containing abnormal content such as sensitive information, confidential information and the like can be preset to be stored under one or more specific addresses).
Step S105: and under the condition that the content to be printed contains abnormal content, adding an identifier into the content to be printed, generating a target printing page, and printing the target printing page by using printing equipment.
In the embodiment of the present invention, when it is determined that the content to be printed includes abnormal content, and there are a plurality of pages of the content to be printed, the following steps are performed for each page of the content to be printed (the execution process is shown in fig. 3):
step S301: calling a first drawing function according to the content to be printed to generate a page to be printed corresponding to the content to be printed;
step S302: calling a second drawing function, adding a watermark on the page to be printed, and generating a target printing page, wherein the second drawing function indicates the adding position of the watermark;
step S303: printing the target print page with the printing device.
In the same way, under the condition that the content to be printed contains abnormal content, when the content to be printed only has one page, the first drawing function is directly called to generate a page to be printed corresponding to the page of the content to be printed; calling a second drawing function, adding a watermark on the page to be printed, and generating a target printing page, wherein the second drawing function indicates the adding position of the watermark; and printing the target print page by using the printing device.
In the embodiment of the invention, the page to be printed is a page that can be identified by the printing device, and besides adding the watermark to the page to be printed, a timestamp and/or a mark such as client information for sending a printing instruction can be added to generate the target printing page. The scheme is not particularly limited with respect to the types of the marks added to the page to be printed.
In the embodiment of the present invention, in a case where it is determined that the content to be printed includes an abnormal content, the following may be further performed: acquiring time for sending a printing instruction and client information; generating an abnormal printing log according to the time, the client information and the target printing page; and uploading the abnormal printing log to a server for storage, thereby backing up relevant evidence of the printing process aiming at the abnormal content at the server side.
In the embodiment of the present invention, in a case where it is determined that the content to be printed includes an abnormal content, the following may be further performed: increasing the number of abnormal printing times corresponding to the client information which sends the printing instruction; and determining whether the abnormal printing times is greater than a preset threshold value, and if so, sending early warning information to an administrator, thereby helping the administrator to find that someone prints abnormal contents for many times in time.
According to the file printing method provided by the embodiment of the invention, whether the content to be printed contains abnormal content or not can be determined under the condition that the printing instruction is received, the mark can be added into the content to be printed under the condition that the content to be printed contains the abnormal content, a target printing page is generated, and then the target printing page is printed by utilizing the printing equipment, so that the effect of analyzing and managing the content to be printed is realized, and the mark can be added into the content to be printed when the abnormal content is printed by someone, so that the evidence of the printed abnormal content is reserved, and the tracing is convenient to be carried out afterwards.
Fig. 4 is a schematic diagram of main blocks of a document printing apparatus according to an embodiment of the present invention.
As shown in fig. 4, a document printing apparatus 400 according to an embodiment of the present invention includes an instruction monitoring module 401, an instruction generating module 402, an instruction executing module 403, a content analyzing module 404, and a printing module 405; wherein:
an instruction monitoring module 401, configured to monitor whether a print instruction is received;
an instruction generating module 402, configured to generate a primitive file drawing instruction according to a printing instruction when the printing instruction is received, and replace the printing instruction with the primitive file drawing instruction;
an instruction executing module 403, configured to execute a primitive file drawing instruction to obtain content to be printed;
a content analysis module 404, configured to determine whether the content to be printed includes abnormal content;
the printing module 405 is configured to add an identifier to the content to be printed, generate a target print page, and print the target print page by using a printing device, when it is determined that the content to be printed includes abnormal content.
In this embodiment of the present invention, the instruction generating module 402 is further configured to: creating a graphic element file; and taking the printing instruction as an input parameter, taking the address of the primitive file as an output parameter, and generating a primitive file drawing instruction according to the input parameter and the output parameter.
In this embodiment of the present invention, the instruction generating module 402 is further configured to: executing the primitive file drawing instruction to acquire the content to be printed according to one or more pieces of calling interface information corresponding to the printing instruction; and caching the content to be printed into the primitive file.
In this embodiment of the present invention, in a case that it is determined that the content to be printed includes an abnormal content, the printing module 405 is further configured to: when the content to be printed has a plurality of pages, the following steps are executed for each page of the content to be printed: calling a first drawing function according to the content to be printed to generate a page to be printed corresponding to the content to be printed; calling a second drawing function, adding a watermark on the page to be printed, and generating a target printing page, wherein the second drawing function indicates the adding position of the watermark; printing the target print page with the printing device.
In an embodiment of the present invention, the content analysis module 404 is further configured to: and matching the content to be printed with a preset abnormal keyword, and determining whether the content to be printed contains the abnormal keyword so as to determine whether the content to be printed contains the abnormal content.
In an embodiment of the present invention, the content analysis module 404 is further configured to: and determining whether the content to be printed contains abnormal content or not by using a regular expression matching algorithm.
In this embodiment of the present invention, in a case that it is determined that the content to be printed includes an abnormal content, the printing module 405 is further configured to: acquiring time for sending a printing instruction and client information; generating an abnormal printing log according to the time, the client information and the target printing page; and uploading the abnormal printing log to a server for storage.
In this embodiment of the present invention, in a case that it is determined that the content to be printed includes an abnormal content, the printing module 405 is further configured to: increasing the number of abnormal printing times corresponding to the client information which sends the printing instruction; and determining whether the abnormal printing times is greater than a preset threshold value, and if so, sending early warning information to an administrator.
According to the file printing device provided by the embodiment of the invention, whether the content to be printed contains abnormal content or not can be determined under the condition that the printing instruction is received, the mark can be added into the content to be printed under the condition that the content to be printed contains the abnormal content, a target printing page is generated, and then the target printing page is printed by utilizing the printing equipment, so that the effect of analyzing and managing the content to be printed is realized, and the mark can be added into the content to be printed when the abnormal content is printed by someone, so that the evidence of the printed abnormal content is reserved, and the tracing is convenient to be carried out afterwards.
Fig. 5 illustrates an exemplary system architecture 500 of a document printing method or a document printing apparatus to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and an electronic device 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the electronic device 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 501, 502, 503 to interact with the electronic device 505 over the network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various communication client applications installed thereon, such as a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The electronic device 505 may be a server providing various services, such as a background management server providing support for search-type applications browsed by a user using the terminal devices 501, 502, 503. The background management server may analyze and perform other processing on the received data such as the query request, and feed back a processing result (e.g., the target push information) to the terminal device.
It should be noted that a file printing method provided by the embodiment of the present invention is generally executed by the electronic device 505, and accordingly, a file printing apparatus is generally disposed in the electronic device 505.
It should be understood that the number of terminal devices, networks, and electronic devices in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and electronic devices, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an instruction monitoring module, an instruction generating module, an instruction executing module, a content analyzing module, and a printing module. The names of these modules do not constitute a limitation to the module itself in some cases, and for example, the instruction listening module may also be described as a "module for listening whether a print instruction is received".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: monitoring whether a printing instruction is received; under the condition of receiving a printing instruction, generating a primitive file drawing instruction according to the printing instruction, and replacing the printing instruction by using the primitive file drawing instruction; executing a graphics file drawing instruction to obtain the content to be printed; determining whether the content to be printed contains abnormal content; and under the condition that the content to be printed contains abnormal content, adding an identifier into the content to be printed, generating a target printing page, and printing the target printing page by using printing equipment.
According to the technical scheme of the embodiment of the invention, whether the content to be printed contains abnormal content or not can be determined under the condition that the printing instruction is received, the mark can be added into the content to be printed under the condition that the content to be printed contains the abnormal content, the target printing page is generated, and the printing equipment is utilized to print the target printing page, so that the effect of analyzing and managing the content to be printed is realized, and the mark can be added into the content to be printed when the abnormal content is printed by someone, so that the evidence of the printed abnormal content is kept, and the tracing is convenient after the fact.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of printing a document, comprising:
monitoring whether a printing instruction is received;
under the condition that the printing instruction is received, generating a primitive file drawing instruction according to the printing instruction, and replacing the printing instruction with the primitive file drawing instruction;
executing the graphic element file drawing instruction to obtain the content to be printed;
determining whether the content to be printed contains abnormal content;
and under the condition that the content to be printed contains the abnormal content, adding an identifier into the content to be printed, generating a target printing page, and printing the target printing page by using printing equipment.
2. The method of claim 1, wherein generating metafile drawing instructions based on the printing instructions comprises:
creating a graphic element file;
and taking the printing instruction as an input parameter, taking the address of the metafile as an output parameter, and generating the metafile drawing instruction according to the input parameter and the output parameter.
3. The method of claim 2, wherein executing the metafile rendering instructions to obtain content to be printed comprises:
executing the graphic element file drawing instruction to acquire the content to be printed according to one or more pieces of calling interface information corresponding to the printing instruction;
and caching the content to be printed into the primitive file.
4. The method according to any one of claims 1 to 3, wherein, in a case where it is determined that the content to be printed includes the abnormal content,
when the content to be printed has a plurality of pages, the following steps are executed for each page of the content to be printed:
calling a first drawing function according to the content to be printed to generate a page to be printed corresponding to the content to be printed;
calling a second drawing function, adding a watermark on the page to be printed, and generating a target printing page, wherein the second drawing function indicates the adding position of the watermark;
and printing the target printing page by using the printing device.
5. The method according to claim 1 or 3, wherein determining whether the content to be printed contains abnormal content comprises:
matching the content to be printed with a preset abnormal keyword, and determining whether the content to be printed contains the abnormal keyword so as to determine whether the content to be printed contains the abnormal content; or the like, or, alternatively,
and determining whether the content to be printed contains abnormal content or not by using a regular expression matching algorithm.
6. The method according to claim 5, wherein in a case where it is determined that the content to be printed includes the abnormal content, the method further comprises:
acquiring the time for sending the printing instruction and client information;
generating an abnormal printing log according to the time, the client information and the target printing page;
and uploading the abnormal printing log to a server for storage.
7. The method according to claim 5, wherein in a case where it is determined that the content to be printed includes the abnormal content, the method further comprises:
increasing the number of abnormal printing times corresponding to the client information which sends the printing instruction;
and determining whether the abnormal printing times is greater than a preset threshold value, and if so, sending early warning information to an administrator.
8. A file printing device is characterized by comprising an instruction monitoring module, an instruction generating module, an instruction executing module, a content analyzing module and a printing module; wherein:
the instruction monitoring module is used for monitoring whether a printing instruction is received;
the instruction generating module is used for generating a primitive file drawing instruction according to the printing instruction under the condition of receiving the printing instruction, and replacing the printing instruction with the primitive file drawing instruction;
the instruction execution module is used for executing the graphic element file drawing instruction so as to obtain the content to be printed;
the content analysis module is used for determining whether the content to be printed contains abnormal content;
and the printing module is used for adding an identifier into the content to be printed under the condition that the content to be printed contains the abnormal content, generating a target printing page and printing the target printing page by using printing equipment.
9. An electronic device for printing a document, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110921164.8A 2021-08-11 2021-08-11 File printing method and device Pending CN113641312A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110921164.8A CN113641312A (en) 2021-08-11 2021-08-11 File printing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110921164.8A CN113641312A (en) 2021-08-11 2021-08-11 File printing method and device

Publications (1)

Publication Number Publication Date
CN113641312A true CN113641312A (en) 2021-11-12

Family

ID=78420873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110921164.8A Pending CN113641312A (en) 2021-08-11 2021-08-11 File printing method and device

Country Status (1)

Country Link
CN (1) CN113641312A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999299A (en) * 2011-09-13 2013-03-27 北京路模思科技有限公司 System and method for monitoring print data in Windows print process
CN103605487A (en) * 2013-11-18 2014-02-26 江苏敏捷科技股份有限公司 Method for transparently capturing print data
CN108646988A (en) * 2018-03-20 2018-10-12 北京明朝万达科技股份有限公司 Document printing method and system
CN109254739A (en) * 2018-08-23 2019-01-22 北京京东尚科信息技术有限公司 file printing method, device and system
CN111880755A (en) * 2020-08-07 2020-11-03 北京速票通科技有限公司 Printing method, printing device, electronic equipment and computer readable storage medium
CN112230867A (en) * 2020-10-16 2021-01-15 无锡鹦鹉螺软件有限公司 Method for monitoring printing content of physical printer
CN112698797A (en) * 2020-12-30 2021-04-23 北京明朝万达科技股份有限公司 File printing control method and system, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999299A (en) * 2011-09-13 2013-03-27 北京路模思科技有限公司 System and method for monitoring print data in Windows print process
CN103605487A (en) * 2013-11-18 2014-02-26 江苏敏捷科技股份有限公司 Method for transparently capturing print data
CN108646988A (en) * 2018-03-20 2018-10-12 北京明朝万达科技股份有限公司 Document printing method and system
CN109254739A (en) * 2018-08-23 2019-01-22 北京京东尚科信息技术有限公司 file printing method, device and system
CN111880755A (en) * 2020-08-07 2020-11-03 北京速票通科技有限公司 Printing method, printing device, electronic equipment and computer readable storage medium
CN112230867A (en) * 2020-10-16 2021-01-15 无锡鹦鹉螺软件有限公司 Method for monitoring printing content of physical printer
CN112698797A (en) * 2020-12-30 2021-04-23 北京明朝万达科技股份有限公司 File printing control method and system, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RONGYONG: "C++连接打印机(windows API)", Retrieved from the Internet <URL:https://blog.csdn.net/rongyong/article/details/46007717> *

Similar Documents

Publication Publication Date Title
CN107302597B (en) Message file pushing method and device
CN107491382B (en) Log output method and device
US8661502B2 (en) Determining a sensitivity label of document information in real time
CN109522751B (en) Access right control method and device, electronic equipment and computer readable medium
CN109582873A (en) Method and apparatus for pushed information
CN110795315A (en) Method and device for monitoring service
CN110046000B (en) Applet running method and device
CN114443905A (en) Interface document updating method and device, electronic equipment and readable storage medium
CN109901934B (en) Method and device for generating interface help document
CN110705271A (en) System and method for providing natural language processing service
CN113641312A (en) File printing method and device
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN112835609B (en) Method and device for modifying download address of dependent packet
CN110287087B (en) Method and device for detecting application
CN109087097B (en) Method and device for updating same identifier of chain code
CN113742617A (en) Cache updating method and device
CN111163156A (en) Data processing method, device and storage medium based on block chain
CN112965946B (en) Method, device, equipment and computer readable medium for processing document
CN113434098B (en) Printing function realization method, device, electronic equipment, system and storage medium
CN110874302A (en) Method and device for determining buried point configuration information
CN112817603B (en) Application processing method, device, electronic equipment, system and storage medium
US20220253467A1 (en) Method, device and program product for generating configuration information of storage system
CN114721609A (en) Method and device for printing file, electronic equipment and computer readable medium
CN113094332A (en) File management method and device
CN117689523A (en) Method for processing collaborative file, file processing server and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination