The method of backup is printed under a kind of Windows environment
Technical field
The invention belongs to computer system security administrative skill field, in particular to printed under a kind of Windows environment standby
The method of part.
Background technique
Currently, printing device is widely used in working environment, secrecy is also improved while bringing convenience for people
The degree of risk of information leakage.Confidential information is revealed by printing, generally involves user's higher level even core stage
Secret, destructive power is big, and case-solving rate is low, greatly compromises personal, collective interests.Printing redundancy technique is met the tendency of in this context
And give birth to, for constituent parts by information leakage problem existing for printing approach, propose effective solution scheme.Currently, realizing
There are mainly two types of methods for printing backup: one is the installation agent programs on terminal computer, utilize printing cell monitoring api interface
Print data is obtained, the file specifically printed is analyzed from the print data of acquisition and is backed up;Another kind is deployment printing
Server.In mimeograph documents, file to be printed can only be uploaded on printing server and be printed, in printing server
Upper backup mimeograph documents.
The shortcomings that first method is cannot to back up all mimeograph documents.Because printing cell monitoring api interface can only obtain
The file name of mimeograph documents obtains file full path diameter by file name and relies on specific application program realization, not can guarantee
Correct file full path diameter is got, thus all mimeograph documents can not be backed up.
Second method can back up all mimeograph documents, but disadvantage is also apparent from.Mainly there is following problem, the
One: this method needs to change the use habit of user, and file must be uploaded on printing server and be printed by user, nothing
Method locally completes printing.Second: all user's printings must be lined up progress on printing server, reduce work effect
Rate, while also increasing the management cost to printing server.
In conclusion in the prior art, in the case where not changing user's use habit, cannot achieve and back up all beat
Printed text part.
Summary of the invention
The present invention solves the technical problem of: a kind of method that backup is printed under Windows environment, this method are provided
In the case where not changing user's use habit, all mimeograph documents are backed up.
In order to solve the above technical problems, the present invention adopts the following technical scheme:
The method of backup is printed under a kind of Windows environment comprising the steps of:
A., virtual printer is installed: XPS virtual printer being installed on the terminal device, is arrived for content storage will be printed
In disk file;
B., API HOOK is installed: API HOOK is installed on the terminal device, for capturing the printing behaviour of application program initiation
Make;
C. it obtains Printer Information: obtaining the Printer Information of terminal device connection, comprising: printer name;
Only obtain the actual printer being directly connected to the machine and the actual printer by network connection;
D. it stores Printer Information: the printer name obtained in step c is stored in memory;
E. capture printing: the api function that capture application program initiates printing calls, and obtains printer name;
F. printing is analyzed: the printer name that will be stored in the printer name obtained in step e and the step d
Title is compared.If successful match, step g is executed;If matching is unsuccessful, end operation;
G. printing cheat: the printer name obtained in the step e is replaced with installed in step a virtually beat
The printer name of print machine.The printer name obtained in the step e is saved into memory;
H. it generates backup file: waiting virtual printer printing to complete, the file that standby virtual printer generates;
I. mimeograph documents are generated: using the printer name saved in the step g, printing the backup in the step h
File completes printing.
The beneficial effects of the present invention are: the method that backup is printed under a kind of windows environment of the invention, it can be for not
Same network size is realized in the case where not changing user's use habit and backs up all mimeograph documents, be effectively prevented secret
Information is leaked and is spread by printing type.
Detailed description of the invention
Fig. 1 is the flow chart of the method for printing backup of the invention;
Fig. 2 is the structural schematic diagram of the printing standby system of the embodiment of the present invention.
Specific embodiment:
Below in conjunction with attached drawing and example, the invention will be described in further detail.
The present invention provides a kind of method for printing backup under Windows environment, application scenarios are LAN environment, such as
Shown in Fig. 2, which includes console computer 201, client computer 202, public printing device and printing server
204, which is a common printer 203, and the operating system of client computer is Windows operation system
System is realized in the case where not changing user's use habit and backs up all mimeograph documents.
For example, the computer name of client computer is known as APC, IP address 192.168.0.85, printer name is known as
HP P2055D, IP address 192.168.0.88, user open one by client computer, using Word application program
File path be C: user Administrator desktop, file name be " leading to soft company introduction ", file type .doc,
The file that size is 200k, number of pages is page 3.The entire text of printing is executed to the file that file name is " leading to soft company introduction .doc "
The operation of shelves, setting printing number is 1 part.
As shown in Figure 1, the specific work steps of the method for printing backup of the invention is as follows:
A., virtual printer 101 is installed: virtual printer, title being installed on client computers are as follows: XPS
Document Writer.Purpose be used to by file name be " leading to soft company introduction ", file type .doc, size 200k,
The file that number of pages is page 3 is stored into client computer disk file;
B., API HOOK102 is installed: API HOOK is installed on client computers, purpose is used to capture WORD application journey
The printing that sequence is initiated
C. it obtains Printer Information 103: obtaining the Printer Information that client computer is connected, Printer Information includes
Printer name HP P2055D;
D. it stores Printer Information 104: printer name HP P2055D is stored into client computer memory;
E. the api function that capture printing 105:API HOOK capture WORD application program initiates printing calls,
Function name is StartDoc, obtains the parameter in function call, and parameter includes printer name HP P2055D;
F. printing 106: the printer name HP P2055D that will acquire and the progress of the printer name of storage is analyzed
Match;
Execution step 107 will acquire printer name HP P2055D and the printer name of storage is matched, such as consistent
Then successful match then continues to execute step 108, such as inconsistent, then end operation;
G. printing deception 109: the printer name HP P2055D that will acquire replaces with virtual printer name XPS
Document Writer.And the printer name HP P2055D that will acquire is saved in client computer memory;
H. it generates backup file 110: waiting virtual XPS Document Writer printer printing to terminate, virtual printing
Machine generates file, and title: APC_2015-02-20-13-15-40- leads to soft company introduction .xps;Back up this file;
I. mimeograph documents 111 are generated: printing APC_2015-02-20-13-15-40- using printer name HP P2055D
Lead to soft company introduction .xps, printing is completed.
Method of the invention can also back up the texts such as the mimeograph documents of extended formatting, such as EXCEL, PPT, PDF, TXT, JNT
This document and JPG, TIF, PNG picture format file and CAD, CAXA graphical format file.