Method for positioning impressions in batch PDF (Portable document Format) documents

文档序号:971432 发布日期:2020-11-03 浏览:5次 中文

阅读说明:本技术 一种批量pdf文档中印模的定位方法 (Method for positioning impressions in batch PDF (Portable document Format) documents ) 是由 涂凯 刘勇军 于 2020-07-20 设计创作,主要内容包括:本发明公开了一种批量PDF文档中印模的定位方法,获取印模角顶点,计算印模角顶点与页面顶点的位置距离,确定印模盖章基点坐标,根据第一个盖章基点坐标和第二盖章基点坐标的位置组合,确定印章的盖章位置。本发明实现了用户以所见即所的方式签署文件,不需要考虑文件的旋转和尺寸,实现了对多PDF文档进行方便、快捷、高效、准确的签署。(The invention discloses a method for positioning stamps in batch PDF documents, which comprises the steps of obtaining the vertex of a stamp corner, calculating the position distance between the vertex of the stamp corner and the vertex of a page, determining the coordinates of stamping base points of the stamps, and determining the stamping position of a stamp according to the position combination of the coordinates of a first stamping base point and the coordinates of a second stamping base point. The invention realizes that the user signs the file in a WYSIWYG mode without considering the rotation and the size of the file, and realizes the convenient, quick, efficient and accurate signing of the multi-PDF document.)

1. A method for positioning impressions in batch PDF documents is characterized by comprising the following operation steps:

1) taking the impression angular vertex: acquiring four corner vertexes of the impression in the template file, namely four corner vertexes of a rectangular area where the impression is located;

2) calculating the position distance between the vertex of the impression angle and the vertex of the page: respectively calculating the sum of the horizontal distance and the vertical distance between the four corner vertexes of the stamp and the page vertex in the corresponding direction of the stamp as the position distance between the corner vertexes of the stamp and the page vertex;

3) determining the coordinates of a stamping base point: selecting a position distance point, closest to the vertex of the page, of the vertex of the angle in the step 2) as a default first stamping base point coordinate;

4) determining second stamping base point coordinates: calculating a second stamping base point coordinate of the stamp by respectively adding the height and the width of the stamp to the first stamping base point coordinate in the step 3);

5) and determining the stamping position of the stamp according to the position combination of the first stamping base point coordinate and the second stamping base point coordinate.

2. The method of claim 1, wherein the first stamping base point is designated by a user.

Technical Field

The invention relates to an electronic document processing technology, in particular to a method for positioning impressions in batch PDF documents.

Background

Audit hospitals and examination centers often need to carry out approval, seal and signing operations on batch PDF files. The PDF files are dozens of less files and thousands of files, are converted from CAD drawing files, have different sizes and different rotation angles, but have fixed stamping positions. If the operation is carried out manually one by one, the operation is time-consuming and labor-consuming. If batch signing is carried out, a large number of PDF documents with different angles and sizes need to be signed and stamped, and because the coordinate positions of the documents with different angles and sizes are changed and an accurate positioning mode does not exist, the stamping position cannot be determined, so that the situation that the signature positions are not correct and even cannot be seen outside the documents always occurs during batch signing.

Disclosure of Invention

In order to solve the problem of difficult positioning of batch PDF document signing, the invention provides a method for positioning the stamping position of batch PDF documents. The template file and the files needing to be stamped in batches may have different sizes and different angles so as to ensure the accuracy of stamping positions.

The object of the invention is thus achieved. A method for positioning impressions in batch PDF documents comprises the following operation steps:

1) taking the impression angular vertex: acquiring four corner vertexes of the impression in the template file, namely four corner vertexes of a rectangular area where the impression is located;

2) calculating the position distance between the vertex of the impression angle and the vertex of the page: respectively calculating the sum of the horizontal distance and the vertical distance between the four corner vertexes of the stamp and the page vertex in the corresponding direction of the stamp as the position distance between the corner vertexes of the stamp and the page vertex;

3) determining the coordinates of a stamping base point: selecting a position distance point, closest to the vertex of the page, of the vertex of the angle in the step 2) as a default first stamping base point coordinate;

4) determining second stamping base point coordinates: calculating a second stamping base point coordinate of the stamp by respectively adding the height and the width of the stamp to the first stamping base point coordinate in the step 3);

5) and determining the stamping position of the stamp according to the position combination of the first stamping base point coordinate and the second stamping base point coordinate.

Further, the first stamping base point is designated by the user.

The invention realizes that the user signs the file in a WYSIWYG mode without considering the rotation and the size of the file; the speed of stamping is improved by about 18 times compared with manual stamping, the positioning accuracy is 100%, and the multi-PDF document is conveniently, quickly, efficiently and accurately signed.

Drawings

FIG. 1 is a flow chart of a method of the present invention;

FIG. 2 is a schematic view of an impression positioning according to an embodiment of the present invention;

FIG. 3 is a schematic diagram of a stamp insertion according to an embodiment of the present invention;

fig. 4 is a schematic diagram of stamp position calculation according to an embodiment of the present invention.

Detailed Description

The invention is further illustrated below with reference to the figures and examples. Referring to fig. 1 to 4, a method for positioning impressions in a batch PDF document includes the following specific operation steps (as shown in fig. 1):

1) opening the PDF document, and acquiring impression information: obtaining four corner points of the impression in the template file, namely: pA, pB, pC, pD (as shown in FIG. 2), i.e., the four corner vertices of the rectangular region where the stamp is located;

2) and respectively calculating the position distances between the four vertex points of the impression and the four vertex points of the page, namely: dA = Adx + Ady, dB = Bdx + Bdy, dC = Cdx + Cdy, dD = Ddx + Ddy (see fig. 2);

3) obtaining the coordinates of a stamping base point: selecting the point closest to the top point of the page (i.e. the minimum position distance) as the default stamping base point coordinate (i.e. the minimum value dMin in dA, dB, dC, and dD, and pC point in fig. 1) for stamping, or the user can designate the stamping base point by himself;

4) taking the width dWith, height dHeight of the impression (see fig. 2);

5) acquiring the page number nPageIndex of the impression (namely the number of pages covered on the document by the impression is shown in figure 3);

6) fixed reference origin: the upper left corner of the default page is taken as the origin of reference (fourth quadrant) poorg (see fig. 2 and 3);

7) obtaining the rotation angle pRoacate of the page where the impression is located (see FIG. 2);

8) determining the original vertex coordinates of the stamp picture: calculating the vertex coordinates pTop of the stamp picture according to pOrg, pRoace and dMin (dMin = minX + minY), and keeping consistent with the quadrant of the reference origin (see figure 3);

9) determining the coordinates of the diagonal vertices: obtaining coordinates pBottom of the diagonal vertex of the pTop according to the pTop, dWidth and dHeight (see figure 3);

10) completing the insertion of the stamp picture: inserting the seal picture data is completed according to the page number PageIndex and the coordinates pTop and pBottomn of the two fixed points (see figure 3).

The actual operation flow of the user is as follows:

1. and taking any one document from the documents needing to be stamped in batches as a TFile (template file).

2. A stamp is added to the template document as TSeal.

3. From step 1) to step 10) according to a specific operation method, obtaining SealPos (seal position), which comprises: page number, vertex, and bottom.

Four points of TSeal (impression) were taken at different rotation angles of the page, the positions from the four vertices of the page (see table 1) are as follows:

table 1:

(Note: the coordinate transformation in Table 1 is shown in FIG. 4)

4. And stamping according to SealPos (stamping position).

Comparison of performance for the three signing modalities (see table 2):

table 2:

Figure RE-623573DEST_PATH_IMAGE002

as can be seen from table 2:

A. and (3) manual stamping: because the documents are manually stamped after being opened one by one, the time consumption is 9700S, the accuracy rate is 100%, but the time consumption, the labor consumption and the positioning are difficult, and the position is easily stamped in a wrong way.

B. Traditional seal in batches: the stamping position is fixed, the documents with multiple rotation angles and different sizes cannot be adapted, the time consumption is 480S, the accuracy rate is 35%, and the error rate is high.

C. Accurate stamp in batches: and (3) dynamically calculating the position, adapting to various documents (different angles and sizes), wherein the time consumption is 560S, and the accuracy is 100%.

According to the positioning method of the printing die in the batch PDF document, the speed of stamping and stamping is improved by about 18 times compared with the speed of manual stamping, and the accuracy rate of stamping positioning is 100%.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于多目标优化的刑罚测试数据扩增方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!