Summary of the invention
The present invention has overcome shortcoming of the prior art, provides a kind of and can draw the device of seal on the perforation and the method for drawing seal on the perforation in electronic document.
In order to solve the problems of the technologies described above, be achieved through the following technical solutions:
A kind of device of in electronic document, drawing seal on the perforation, it comprises control module, drafting module, authority module, electronic document page info module and seal information module;
The position that this control module can notify drafting module to draw seal image and determine to wait to draw seal;
This drafting module can be drawn out seal image in electronic document;
Preserve corresponding authority information in the authority module, and the control drafting module shows different display modes with this information;
Electronic document page info module memory contains coordinate system information, coordinate information and the number of documents information of each document file page in the document window zone in coordinate system in the document window zone, described coordinate system is to be the coordinate system that true origin is set up with a specified point in the document window zone, and each document file page all has fixing coordinate position; Electronic document page info module is used to help control module to determine the seal display position;
The seal information module includes the various image informations of seal, and drafting module obtains image information when drawing seal from the seal information module.
A kind of method of using said apparatus to draw seal on the perforation, it comprises that following process: A. obtains E-seal view data, picture display size from the seal information module; B. obtain the displaying ratio of current document, adjust the seal image display size according to the document displaying ratio; C. obtain the document page number N at current mouse place, the viewing area coordinate and the mouse coordinates of this page document, if current mouse position not in document, the page number that then obtains should be the page number of the documentation page that showing of screen; D. be the arbitrfary point on seal image center or the predefined seal with the mouse coordinates, promptly can determine the position of seal, calculate the seal image area coordinate by this point; E. judge whether above-mentioned seal image area coordinate exceeds N page or leaf zone and in which direction exceed; If the seal image zone does not exceed in the N page or leaf zone, then enter F, otherwise enter the G process; F. obtain the window handle of document, seal image is plotted in the seal image zone that obtains; If G. seal image zone some exceeded N page or leaf zone at directions X, judge further then whether the X side of N page or leaf also has other document file pages; If N page or leaf X side has not had document file page, then enter the H process, otherwise enter the I process; H. adjust the seal image zone to the opposite direction of X, be close to N page or leaf X till the edge up to adjusted seal zone, and do not allow the seal zone exceed N page or leaf viewing area; I. show junction of the edges of two sheets of paper seal effect, and need further judgement to carry out several pages of junction of the edges of two sheets of paper effects, judged result is a t page or leaf junction of the edges of two sheets of paper effect; J. draw seal at N page or leaf area part, the remainder of seal is divided into t-1 part, and be plotted in each page corresponding edge according to the size of the coordinate of each page margin edge, every part of seal respectively.
The mode that among the said process J seal beyond the N page or leaf area part partly is divided into t-1 part can be that to divide at random also can be average mark.
Compared with prior art, apparatus and method of the present invention can realize the seal on the perforation effect in electronic document, perfect electronic seal system.The core scheme that realizes this effect among the present invention is to have set up a fixing coordinate system, the coordinate of each page document is fixed, determine the position of desire drafting seal again by the coordinate position of determining mouse, can conveniently draw out seal on the perforation position in each page document by these coordinate datas.
Embodiment
A kind of device of in electronic document, drawing seal on the perforation, it comprises control module, drafting module, authority module, electronic document page info module and seal information module; The position that this control module can notify drafting module to draw seal image and determine to wait to draw seal; This drafting module can be drawn out seal image in electronic document; Preserve corresponding authority information in the authority module, and the control drawing apparatus shows different display modes with this information; Electronic document page info module memory contains the coordinate system information in the document window zone, each document file page coordinate information and the number of documents information in the document window zone; The seal information module includes the various image informations of seal.Described coordinate system information is meant, is the coordinate system that true origin is set up with a specified point in the document window zone, and each document file page all has fixing coordinate position.
Embodiment one:
Specifically describe a kind of method for drafting of pair of pages junction of the edges of two sheets of paper E-seal below.
1. obtain the E-seal view data, picture display size.
2. obtain the displaying ratio of current document.
3. adjust the seal image display size according to the document displaying ratio, the seal image original size is to be the size that showed on screen in 100% o'clock at the document displaying ratio, if current document has convergent-divergent, such as zooming to 50%, then the size of seal also should zoom to original 50% equally.
4. obtain the document page number (page number of supposing this page is N) at current mouse place, the viewing area coordinate and the mouse coordinates of this page document, if current mouse position is (for example in the mouse focus Another application program) not in document, the page number that then obtains should be the page number of the documentation page that showing of screen, here the used coordinate system of the viewing area coordinate of mouse coordinates and N page or leaf all is aforesaid coordinate system, the initial point of their used coordinate system is the coordinate in the upper left corner, document window zone, rather than screen coordinate, its coordinate figure all immobilizes no matter document one page is under any circumstance like this (for example roll window or change size).
5. be the seal image center with the mouse coordinates, calculate the viewing area coordinate of seal image, this coordinate system should be identical with the coordinate system of mouse coordinates.
6. judge that the seal image zone obtain is whether in N page or leaf zone.
7. if the seal image zone is in N page or leaf zone, show that then this moment, seal should be shown as one piece of common seal, can obtain the window handle of document this moment, seal image is plotted in the seal image zone that obtains, with user's viewpoint of measures, just show as on N page or leaf document mouse position and added a cover one piece of E-seal.
If seal image zone some exceeded N page or leaf zone (for example mouse be at the right hand edge of N page or leaf, some is understood not in N page or leaf viewing area in the right, seal image zone that then calculates), just need judge again that seal image is that part of exceeding, if the right-hand component that is seal exceeds N page or leaf viewing area, judge then whether N page or leaf the right also has other document file pages (same if the left side of seal, top or bottom have exceeded N page or leaf viewing area, determination methods is similar).
9. if N page or leaf the right has not had document file page, then can only adjust the seal image zone left, till N page or leaf right hand edge is close in adjusted seal zone, and do not allow the seal zone exceed N page or leaf viewing area.After preventing that like this document is printed, only show a part of seal image (when printing because of document the document cut out areas can be set all generally is page viewing area, and the zone beyond the page can not be printed).
10. if N page or leaf the right also has document file page, then need to show junction of the edges of two sheets of paper seal effect, show that promptly junction of the edges of two sheets of paper seal has two kinds of methods, is described below respectively:
A. the cutting seal image is two parts, draws a part of image at the different pages at every turn, and after two pages of images were all completed, junction of the edges of two sheets of paper seal was also just completed.
A) the cutting seal image is two parts, and a part is the part (called after Part1) of seal in N page or leaf viewing area, and another part is the part (called after Part2) that exceeds in the N page or leaf viewing area.
B) obtain the entire document window handle, draw the Part1 parts of images that mouse position is drawn seal at the N page or leaf then.
C) page number of supposing N page or leaf the right is Y, obtains the difference (being assumed to be Z) of Y page or leaf left hand edge coordinate and N page or leaf right hand edge coordinate, and the seal viewing area that moves right, and displacement is Z.
D) move horizontally the Part2 part of seal, displacement is Z, obtains the positional information of Part2 parts of images, like this seal Part2 part just in the viewing area of Y page or leaf, and the left hand edge or the right hand edge of close Y page or leaf.
E) the Part2 part of drafting seal in the Y page or leaf, junction of the edges of two sheets of paper seal is just completed like this, is exactly that a part of seal is presented at the N page or leaf In the view of the user, and another part seal is presented at the Y page or leaf, thereby reaches the effect that shows junction of the edges of two sheets of paper seal.
B. same piece of complete seal image of twice drafting of the different pages in document, when drawing at every turn by setting different cut out areas reaching the different piece of drawing seal image, when two pages complete after junction of the edges of two sheets of paper seal also just complete.
A) page number of hypothesis the right page or leaf is Y, at first obtain the entire document window handle, cut out areas that seal draws be set then be N page or leaf viewing area (data outside cut out areas will can be not drawn), in the seal zone, draw one piece of complete seal image at last, on the N page, just only can demonstrate a part of seal image like this, be presented on the Y page or leaf exceeding the segment seal image then.
B) obtain the difference (being assumed to be Z) of Y page or leaf left hand edge coordinate and N page or leaf right hand edge coordinate, and the seal viewing area that moves right, displacement is Z.
C) obtain the viewing area of Y page or leaf, and the drafting cut out areas that mobile back seal is set is the viewing area of Y page or leaf, and then draw another complete seal image on new seal zone, because the restriction of cut out areas is just on the Y page or leaf, so drawn out another part seal image.In the view of the user is exactly that the part of seal is presented at the N page or leaf, and another part is presented at the Y page or leaf, has finally formed the effect of junction of the edges of two sheets of paper seal.
11. preserve position, page number and the seal image data message of seal image, so that draw required next time.
Embodiment two:
Specifically describe a kind of method for drafting of multipage junction of the edges of two sheets of paper E-seal below.
1. three steps of front are identical with first three step of drawing pair of pages junction of the edges of two sheets of paper E-seal.
2. obtain and to add a cover junction of the edges of two sheets of paper E-seal documentation page scope, if need from one to ten page add a cover junction of the edges of two sheets of paper E-seal.
3. the junction of the edges of two sheets of paper E-seal implementation method with pair of pages is similar, and two kinds of methods are also arranged
A. the E-seal image averaging is cut into ten equal portions,, has just formed junction of the edges of two sheets of paper E-seal effect after all are completed one to ten page of every page of part of all drawing seal respectively.
A) drawing junction of the edges of two sheets of paper E-seal with horizontal direction is example, the seal image level is divided into ten equal portions, if every part of sequence number is from Part1 to Patr10 respectively.
B) get the X-axis coordinate of right hand edge of the 1st page of document and the Y-axis coordinate of mouse position, the coordinate points that obtains is used as the central point of Part1 parts of images right hand edge, just can calculate the viewing area of part1 part.
C) the Part1 part of drafting seal in the viewing area of first page of Part1.
D) in like manner get the X-axis coordinate of right hand edge of the 2nd page of document and the Y-axis coordinate of mouse position, the coordinate points that obtains is used as the central point of Part2 parts of images right hand edge, calculate the viewing area of part2 part.
E) the Part2 part of drafting seal in the viewing area of second page of Part2.
F) seal Part3 partly arrives Part10 method for drafting and Part2 and draws similar, till all seal images are completed, stride the junction of the edges of two sheets of paper E-seal of ten pages of documents like this and just complete, draw the junction of the edges of two sheets of paper E-seal of vertical direction and draw the similar of horizontal direction.
B. draw ten complete seal images at one to ten page diverse location, reach the parts of images information of drawing seal by setting different cut out areas at every turn, completing when all has just formed the effect of junction of the edges of two sheets of paper E-seal.
A) drawing junction of the edges of two sheets of paper E-seal with horizontal direction is example, and the seal image size is become 10 equal portions, is assumed to be Rect1 to Rect10.
B) get the X-axis coordinate of right hand edge of the 1st page of document and the Y-axis coordinate of mouse position, the coordinate points that obtains is used as Rect1 rectangle right hand edge central point, move one piece of seal rectangle and move to this position, equally it is divided into ten equal portions, and make its first part to coincide with Rect1.
C) cut out areas that seal draws being set is the zone of Rect1, draws first piece of seal image, finally like this will draw out first's seal image.
D) in like manner get the X-axis coordinate of right hand edge of the 1st page of document and the Y-axis coordinate of mouse position, the coordinate points that obtains is used as Rect2 rectangle right hand edge central point, move one piece of seal rectangle to this position, it is divided into ten parts this rectangle, and makes its second part to coincide with Rect2.
E) cut out areas that the second portion seal draws being set is the zone of Rect2, draws second piece of seal image.
F) seal image of third part to the ten parts and drafting second portion images category are seemingly, behind ten parts of the complete seal images of completing through the setting cut out areas, just formed one piece of junction of the edges of two sheets of paper E-seal, the junction of the edges of two sheets of paper E-seal of drafting vertical direction similarly.
4. preserve position, page number and the seal image data message of seal image, so that draw required next time.
It is that the vertical coordinate of each several part seal image is identical that the seal on the perforation of drawing according to this method is arranged horizontally, the horizontal coordinate of each several part seal image is identical when being arranged vertically, the horizontal coordinate at the seal on the perforation center just between the page or leaf is identical, and the vertical coordinate at the seal on the perforation center between the last nextpage is identical.
Above step is the unrestricted technical scheme of the present invention in order to explanation only.Any modification or partial replacement that does not break away from spirit and scope of the invention all should be encompassed in the middle of the claim scope of the present invention.