CN109558705A - Watermark Tiling methods, device, computer equipment and storage medium based on PDF - Google Patents

Watermark Tiling methods, device, computer equipment and storage medium based on PDF Download PDF

Info

Publication number
CN109558705A
CN109558705A CN201811502546.1A CN201811502546A CN109558705A CN 109558705 A CN109558705 A CN 109558705A CN 201811502546 A CN201811502546 A CN 201811502546A CN 109558705 A CN109558705 A CN 109558705A
Authority
CN
China
Prior art keywords
watermark
tiling
parameter
type
text
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
CN201811502546.1A
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.)
Wanxing Polytron Technologies Inc
Original Assignee
Wanxing Polytron Technologies Inc
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 Wanxing Polytron Technologies Inc filed Critical Wanxing Polytron Technologies Inc
Priority to CN201811502546.1A priority Critical patent/CN109558705A/en
Publication of CN109558705A publication Critical patent/CN109558705A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]

Abstract

The embodiment of the present invention provides a kind of watermark Tiling methods, device, computer equipment and storage medium based on PDF.The described method includes: identifying the corresponding whether existing watermark of PDF document of the watermark addition instruction if receiving watermark addition instruction;If watermark is not present in the PDF document, the type of watermark and watermark of user's input are received;Receive watermark general parameter set by user and watermark tiling parameter;According to the watermark general parameter, the type of watermark, general procedure is carried out to watermark;According to the watermark general parameter, watermark tiling parameter and the type of watermark, the watermark after general procedure is subjected to tiling processing;Tiling watermark is generated in the PDF document according to the result of tiling processing.The embodiment of the present invention realizes watermark tiling, and the so entire PDF page can all have watermark, enriches the mode of watermark processing, improves the experience of user.

Description

Watermark Tiling methods, device, computer equipment and storage medium based on PDF
Technical field
The present invention relates to technical field of data processing more particularly to it is a kind of by the watermark Tiling methods of PDF, device, based on Calculate machine equipment and storage medium.
Background technique
The purpose of design pdf document format is the Information publishing of multimedia integrat- ing and publication in order to support on cross-platform, It is provided in particular in the support to Web information issuance.In order to achieve this goal, PDF has many other electronic file forms can not Compared to the advantages of.Pdf document format can be by text, font, format, color and graph image independently of equipment and resolution ratio Equal encapsulation are in one file.The formatted file can also include the electronic information such as hypertext link, sound and dynamic image, branch Speciality file is held, integrated level and security reliability are all higher.For average reader, there is paper mold with the e-book of PDF production The texture and reading effect of book can realistically show the original appearance of former book, and show that size can be adjusted arbitrarily, provide to reader Personalized reading method.The font embedded system of PDF, can be such that font transmits with file, and user can set in difference Standby terminal (such as PC, mobile terminal, E-book reader) can have identical reading experience.
PDF is in addition to bringing fabulous reading experience to user, it is also necessary to experience is preferably edited to user.PDF watermark is made It is to be embedded in the PDF document page that there is a kind of identifiable digital information, in PDF document processing for digital watermarking one kind Middle application is very universal.As PDF document application popularization rate is higher and higher, demand of the user in PDF watermark processing function Increasing.Current PDF software product common on the market still has several drawbacks in watermark processing function, at watermark The mode of reason is single, and the urtext or picture of watermark, can only occur in the page once, and cannot cover PDF pages The all areas in face, in this way, reducing the experience of user.
Summary of the invention
The embodiment of the present invention provides a kind of watermark Tiling methods, device, computer equipment and storage medium based on PDF, PDF watermark tiling can be achieved, enrich the mode of watermark processing, improve the experience of user.
In a first aspect, the embodiment of the invention provides a kind of watermark Tiling methods based on PDF, this method comprises:
If receiving watermark addition instruction, the corresponding whether existing water of PDF document of the watermark addition instruction is identified Print;If watermark is not present in the PDF document, the type of watermark and watermark of user's input are received;Receive watermark set by user General parameter and watermark tiling parameter;According to the watermark general parameter, the type of watermark, general procedure is carried out to watermark; According to the watermark general parameter, watermark tiling parameter and the type of watermark, by the watermark after general procedure Carry out tiling processing;Tiling watermark is generated in the PDF document according to the result of tiling processing.
Second aspect, the embodiment of the invention provides a kind of the watermark tiling device based on PDF, the watermark based on PDF Tiling device includes for executing the corresponding unit of method described in above-mentioned first aspect.
The third aspect, the embodiment of the invention provides a kind of computer equipment, the computer equipment includes memory, with And the processor being connected with the memory;
The memory is for storing computer program, and the processor is for running the calculating stored in the memory Machine program, to execute method described in above-mentioned first aspect.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, when the computer program is executed by processor, realizes method described in above-mentioned first aspect.
Watermark general parameter and watermark tiling parameter can be set in the embodiment of the present invention, according to watermark general parameter, watermark Type carries out general procedure to watermark;According to watermark general parameter, watermark tiling parameter and type of watermark, will pass through general Watermark that treated carries out tiling processing, to generate tiling watermark.The embodiment of the present invention realizes watermark tiling, so entire The PDF page can all have watermark, enrich the mode of watermark processing, improve the experience of user.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 and Fig. 2 is the flow diagram of the watermark Tiling methods provided in an embodiment of the present invention based on PDF;
Fig. 3 is the sub-process schematic diagram of the watermark Tiling methods provided in an embodiment of the present invention based on PDF;
Fig. 4 is the sub-process schematic diagram of the watermark Tiling methods provided in an embodiment of the present invention based on PDF;
Fig. 5 is the schematic block diagram of the watermark tiling device provided in an embodiment of the present invention based on PDF;
Fig. 6 is the schematic block diagram of tiling processing unit provided in an embodiment of the present invention;
Fig. 7 is the schematic block diagram of text identification unit provided in an embodiment of the present invention;
Fig. 8 is the schematic block diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
Fig. 1 and Fig. 2 is the flow diagram of the watermark Tiling methods provided in an embodiment of the present invention based on PDF, is applied to In the servers such as desktop computer, tablet computer, smart phone.Incorporated by reference to Fig. 1 and Fig. 2, this method includes S101-S113.
S101 identifies whether the corresponding PDF document of the watermark addition instruction has deposited if receiving watermark addition instruction In watermark.
Wherein, watermark addition instruction is triggered by touch or click of user etc..If receiving watermark addition instruction, identification The corresponding whether existing watermark of PDF document of the watermark addition instruction.Wherein, in text file corresponding to PDF document There is the relevant identification information for whether adding watermark.It obtains in text file corresponding to PDF document and whether adds watermark Identification information;According to the whether existing watermark of the identification information judgment PDF document.Such as whether the identification information of addition watermark is used " 0 " and " 1 " indicates, wherein " 0 " indicates that watermark is not present, and " 1 " indicates that there are watermarks.If text file corresponding to PDF document In whether add watermark identification information be " 0 ", it is determined that PDF document be not present watermark, if " 1 ", it is determined that PDF document is deposited In watermark.
In one embodiment, if receiving watermark addition instruction, setting interface is called, newly to surge by the way that interface is arranged Print modifies watermark, setting watermark parameters etc..Wherein, which exists in the form of the page is arranged.In the setting interface institute On the corresponding setting page, the various information of user's input can receive, to realize newly-increased watermark, modify watermark, setting watermark is joined Number etc. function.
If watermark is not present in the PDF document, step S102 is executed;If there are watermarks for the PDF document, step is executed S107。
S102 receives the type of watermark and watermark of user's input.
Watermark is not present in the even described PDF document, receives the type of watermark and watermark of user's input.Wherein, type of watermark Including Text Watermarking and picture watermark, accordingly, watermark includes watermark text and watermark picture.It is to be understood that the present invention is real It applies example and tiling processing mainly is made to watermark text and watermark picture.
In one embodiment, step S102, comprising: receive the selected type of watermark of user;If type of watermark is text Watermark receives the watermark text of user's input;If type of watermark is picture watermark, the watermark picture of user's input is received.Wherein, The mode that user inputs watermark picture can be to be selected from file, to select picture, is also possible to file directly Picture in folder drags to position corresponding to input watermark picture etc..This embodiment achieves newly-increased watermark text or watermarks Picture.
The step realizes newly-increased watermark.After newly-increased watermark, then receive the parameter setting to watermark.
S103 receives watermark general parameter set by user and watermark tiling parameter.
Wherein, watermark general parameter can be understood as tiling unrelated some general parameters with watermark.If type of watermark is Text Watermarking, then corresponding watermark general parameter includes watermark font, font size, color (font color), (font is underscore It is no to need underscore), watermark location offset (if need to tile, then this can disable), rotation angle, transparency, scaling Ratio, Page Range (indicate that the page 1-2 in PDF document needs to carry out water such as page 1-2 to the PDF Page Range of watermark Print), page level etc..Wherein, page level includes that watermark is located at the upper layer of text in PDF document, watermark is located in PDF document The bottom etc. of text.If type of watermark is picture watermark, then corresponding watermark general parameter includes dimension of picture size, watermark Positional shift (if need to tile, then this can disable), rotation angle, transparency, scaling, Page Range, the page Level etc..
Watermark tiling parameter is parameter relevant to watermark tiling.Such as include that whether watermark is tiled for setting, respectively corresponds choosing Item "Yes" and "No".If user selects "Yes", then it is determined that watermark tiling need to be carried out;If user select "No", determine without Watermark tiling.Line space and column pitch of the watermark tiling parameter when further including tiling between each watermark.
Wherein, watermark general parameter and watermark tiling parameter are set, can be arranged by way of order, can also set It sets and is configured on the page.Specifically without limitation.
S104 carries out general procedure to watermark according to the watermark general parameter, the type of watermark.
If type of watermark is Text Watermarking, according to the watermark general parameter, the type of watermark, watermark is carried out general Processing, comprising: to watermark font, font size, watermark location offset, rotation angle, transparency, scaling, Page Range, the page The processing of level etc..Universal process method any in the prior art can be used in the method for carrying out general procedure to watermark.It carries out Watermark after general procedure can be understood as the original watermark to tile.Watermark after carrying out general procedure can individually make With.
S105 will pass through general according to the watermark general parameter, watermark tiling parameter and the type of watermark Watermark that treated carries out tiling processing.
First determine the need for the watermark after general procedure carrying out tiling processing according to watermark tiling parameter, if It needs to carry out tiling processing, then according to watermark general parameter, type of watermark, the watermark after general procedure is carried out at tiling Reason;If being handled without carrying out tiling processing without tiling, directly execution step S106.
In one embodiment, as shown in figure 3, step S105 includes the following steps S1051-S1057.
S1051 judges whether the watermark after general procedure needs to carry out watermark according to watermark tiling parameter Tiling.
As watermark tiling parameter in need carry out watermark tiling and without watermark tiling respectively with tiling mark " yes " and " no " is indicated, wherein " yes " expression need to carry out watermark tiling, and " no " indicates to tile without watermark.The parameter if watermark is tiled Tiling is identified as " yes ", it is determined that PDF document need to carry out watermark tiling, if " no ", it is determined that PDF document is without carrying out water Print tiling.
S1052, according to the watermark general parameter, the type of watermark, is determined by general if watermark tiling need to be carried out Watermark that treated rendered in the page after size.
Wherein, if type of watermark is different, it is determined that the size after the watermark after general procedure renders in the page is big Small mode is different.
In one embodiment, step S1052 includes: the identification type of watermark, and the type of watermark includes Text Watermarking With picture watermark;If type of watermark is Text Watermarking, watermark text, font, the font size etc. in the watermark general parameter are obtained; According to the watermark text, font, font size etc., the size after watermark text renders in the page is calculated;If type of watermark For picture watermark, the watermark dimension of picture size in the watermark general parameter is obtained, acquired watermark dimension of picture is big It is small rendered in the page as the watermark picture after size.Wherein, if such as Text Watermarking, according to watermark text, Font, font size and default font, font size size calculate the size of watermark text.
Wherein, identify that the type of watermark, the type of watermark include Text Watermarking and picture watermark.Acquisition can be passed through Relevant identification information corresponding to PDF document obtains, if such as Text Watermarking, then font, font size, font face can be corresponding with The identification informations such as color then without identification informations such as corresponding font, font sizes, and have the marks such as dimension of picture letter if picture watermark Breath.
S1053 traverses all pages in the PDF document to watermark processing, and determines the size of maximum page.
It is to be appreciated that the size of all pages in some PDF documents is all consistent, own in some PDF documents The size of the page is not consistent.Regardless of whether the size of all pages is consistent, all need in traversal PDF document to watermark All pages of processing, and determine the size of maximum page, the i.e. rectangle size of maximum page.The size of maximum page is obtained, When being for subsequent processing, it can guarantee that tiling watermark can be paved with the PDF page all in PDF document.
S1054 passes through change according to the rotation angle in the size of identified maximum page, the watermark general parameter It changes matrix and calculates rectangle size corresponding to the transformed restriction path of the maximum page.
It wherein, include displacement parameter, scaling parameter, rotation parameter in transformation matrix.Under normal circumstances, displacement ginseng Number, scaling parameter are all zero, and rotation parameter uses the rotation angle in watermark general parameter.By identified maximum page Size (size of the maximum page can be determined by the coordinate on four vertex of rectangle), the rotation in the watermark general parameter Gyration can obtain limiting path after converting by transformation matrix.Geometry (such as diamond shape after the restriction path correspondent transform Shape etc.) vertex set/array, it should be noted that in the set/array on vertex other than including coordinate a little, It further include some attributes a little, such as starting point, closing point.Then corresponding rectangle size is determined according to restriction path.Tool Body, as obtained the x coordinate minimum value for limiting all vertex in path, x coordinate maximum value, y-coordinate minimum value, y-coordinate most Big value determines corresponding rectangle size according to x coordinate minimum value, x coordinate maximum value, y-coordinate minimum value, y-coordinate maximum value. Four vertex that such as can first determine corresponding rectangle determine corresponding rectangle size further according to four vertex.Wherein, according to (x coordinate minimum value, y-coordinate minimum value), (x coordinate minimum value, y-coordinate maximum value), (x coordinate maximum value, y-coordinate are minimum Value), (x coordinate maximum value, y-coordinate maximum value) determine four vertex of corresponding rectangle, determine institute further according to four vertex Corresponding rectangle size.As can also directly according to (x coordinate maximum value-x coordinate minimum value), (y-coordinate maximum value-y-coordinate is most Small value) determine corresponding rectangle size.
S1055 calculates watermark according to watermark size, the calculated rectangle size of institute and watermark tiling parameter Fill up the line number and columns of rectangle needs.
Wherein, line space and column pitch when the watermark tiling parameter includes tiling between each watermark.If text Watermark, according to watermark text size size, calculated rectangle size, tiling when each watermark text between line space and Column pitch calculates line number and columns that watermark text fills up matrix needs.It should be noted that if it is Text Watermarking, then Set line space and column pitch is indicated with character quantity, to calculate for convenience.If picture watermark, according to water Impression chip size size, calculated rectangle size, tiling when each watermark picture between line space and column pitch, calculate Watermark picture fills up the line number and columns of matrix needs.It should be noted that if it is picture watermark, then it is set in the ranks Away from column pitch being indicated with the quantity of pixel.Also, it is understood that ground is provided with line space if it is picture watermark And column pitch, then the tiling effects of watermark picture are set with the line space and column pitch of setting, it is each in the tiling effects There is spacing between watermark picture;If being not provided with line space and column pitch, then line space can be defaulted and column pitch is zero, In this way, watermark picture tiling in be each watermark picture be it is interconnected, i.e., between each watermark picture in tiling effects It is not no spacing.Calculate line number and columns that rectangle needs are filled up in watermark, it is possible to understand that it is more to fill up every row needs when rectangle for ground Few watermark (including watermark text and watermark picture), each column need how many a watermarks.
S1056 recombinates watermark and exports the watermark after recombination according to calculated line number and columns.
How many a watermarks, each column are needed to need how many a watermarks according to row every when filling up rectangle, recombination watermark is flat to be formed Effect is spread, and exports the watermark after recombination.Such as if Text Watermarking, recombinating watermark text and exporting after recombinating has tiling effect The watermark text of fruit;If picture watermark, recombinates watermark picture and export the watermark picture with tiling effects after recombination.Its In, the watermark after output recombination, to form preview effect.
S1057, using the watermark after recombination as the result of tiling processing.
The embodiment further limits how to carry out tiling processing to watermark text and watermark picture.By calculating watermark text The rectangle size of this size or the size of watermark picture and the calculated entire maximum page of covering, essence Line number and columns that rectangle needs watermark are filled up in true calculating, realize that tiling is handled to recombinate watermark according to line number and columns Effect, enrich the mode of watermark processing, improve the experience of user.
S106 generates tiling watermark according to the result of tiling processing in the PDF document.
According to the effect of tiling processing, tiling watermark is generated further according to the method for general watermark processing.
S107 identifies the type of watermark of existing watermark.
The even described PDF document has existed watermark, identifies the type of watermark of existing watermark.Wherein, watermark class is identified Type can be identified by identification information.
If type of watermark is Text Watermarking, step S108 is executed;If type of watermark is picture watermark, step S112 is executed.
S108 is identified that, to obtain recognition result, the recognition result includes watermark text to the existing watermark.
Further include tiling watermark or non-tiling watermark in the recognition result, and if tiling watermark, determine water The duplicate line number of printed text sheet and columns, and determine and record according to the duplicate line number of watermark and columns the water of the existing watermark Print tiling parameter.
In one embodiment, as shown in figure 4, step S108 includes the following steps S1081-S1086.
S1081 obtains the watermark text of the existing watermark.
Wherein, if tiling watermark, then including multiple duplicate original watermark texts in watermark text, if non-tiling Watermark, then corresponding is an original watermark.
S1082 retrieves the content of text of the watermark text to obtain search result.
It traverses and retrieves the content of text of the watermark text to obtain search result, it is multiple duplicate to determine whether Text, and whether compare multiple duplicate texts identical.
S1083 judges whether the watermark text has ranks repeat property according to search result.
If having multiple duplicate texts, and multiple duplicate texts are identical, then it is determined that watermark text has ranks repetition Characteristic;Otherwise, it determines watermark text does not have ranks repeat property.
S1084 determines that the existing watermark is tiling watermark, and determine described deposited if having ranks repeat property In the duplicate line number of watermark and columns.
Determine that existing watermark repeats according to the number that text duplicate in watermark text occurs in each column of every a line Line number and columns.
S1085 determines and records the watermark tiling parameter of the existing watermark according to the duplicate line number of watermark and columns.
The watermark tiling parameter of existing watermark is determined according to the duplicate line number of watermark and columns, duplicate text, such as really Allocate the line space and column pitch of each watermark text when paving.And record determined watermark tiling parameter.It can such as order It enables row the inside show watermark tiling parameter, and saves watermark tiling parameter;If there is the corresponding setting page, can also set Corresponding position on the page is set to insert and show watermark tiling parameter.If corresponding position is inserted and is shown on the setting page Show watermark tiling parameter, then corresponding subsequent setting watermark tiling parameter can be understood as the tiling of the watermark to the display Parameter is modified.
S1086 determines that the existing watermark is non-tiling watermark if not having ranks repeat property.
The embodiment, which is furthermore achieved, identifies the Text Watermarking for having carried out tiling processing, further to this article This watermark carries out parameter matching.
S109 judges whether the watermark modification instruction for receiving user.If being not received by the watermark modification instruction of user, Then step S103 is executed, to receive watermark general parameter set by user and watermark tiling parameter.
Wherein, watermark modification instruction, can be by modifying command triggers accordingly;There is the setting page if it exists, can pass through The region where the watermark is touched or clicked on the setting page to trigger.
S110 receives the modification information that user modifies to watermark text if receiving the watermark modification instruction of user. Then step S103 is executed, to receive watermark general parameter set by user and watermark tiling parameter.
S111 extracts the watermark picture of the existing watermark.
Even type of watermark is picture watermark, extracts the watermark picture of the existing watermark.
S112 judges whether the watermark modification instruction for receiving user.If being not received by the watermark modification instruction of user, Then step S103 is executed, to receive watermark general parameter set by user and watermark tiling parameter.
S113 receives the modification information that user modifies to watermark picture if receiving the watermark modification instruction of user. Such as receive a new watermark picture of replacement.Then step S103 is executed, to receive the general ginseng of watermark set by user Several and watermark tiling parameter.
Above step S107-S113 realizes the watermark text or watermark picture for modifying existing watermark, and flat to text Paving watermark is identified, while realizing that parameter matches.
Above method embodiment realize in PDF document Text Watermarking or picture watermark carry out accurately at tiling Reason, in this way, PDF full page can all have corresponding watermark text or watermark picture, enriches the mode of watermark processing, improves The experience of user.It realizes simultaneously and identification and parameter matching is carried out to the Text Watermarking for having carried out tiling processing, with into one Step improves the experience of user.
Fig. 5 is the schematic block diagram of the watermark tiling device provided in an embodiment of the present invention based on PDF.The device includes using The unit corresponding to the above-mentioned watermark Tiling methods based on PDF of execution.Specifically, as shown in figure 5, the device 100 includes water Print judging unit 101, newly-increased unit 102, parameter set unit 103, General Porcess Unit 104, tiling processing unit 105, life At unit 106.
In one embodiment, as shown in figure 5, described device further include type identification unit 107, text identification unit 108, It modifies judging unit 109, text modification unit 110, picture extraction unit 111 and picture and modifies unit 112.
Watermark judging unit 101, if being identified corresponding to the watermark addition instruction for receiving watermark addition instruction The whether existing watermark of PDF document.
Newly-increased unit 102 receives the type of watermark and watermark of user's input if watermark is not present for the PDF document.
In one embodiment, increasing unit 102 newly includes that type reception unit, received text unit and picture receive list Member.Wherein, type reception unit receives the selected type of watermark of user.Received text unit, if being text for type of watermark This watermark receives the watermark text of user's input.Picture receiving unit receives user if being picture watermark for type of watermark The watermark picture of input.
Parameter set unit 103, for receiving watermark general parameter set by user and watermark tiling parameter.
General Porcess Unit 104, for being carried out to watermark general according to the watermark general parameter, the type of watermark Processing.
Tile processing unit 105, for according to the watermark general parameter, watermark tiling parameter and the watermark Watermark after general procedure is carried out tiling processing by type.
In one embodiment, as shown in fig. 6, tiling processing unit 105 includes watermark tiling judging unit 1051, watermark ruler Very little determination unit 1052, page size determination unit 1053, rectangle computing unit 1054, ranks computing unit 1055, recombination are single Member 1056, tiling result determination unit 1057.Wherein, watermark tiling judging unit 1051, joins for being tiled according to the watermark Number judges whether the watermark after general procedure needs to carry out watermark tiling.Watermark size determination unit 1052, if for Watermark tiling need to be carried out, according to the watermark general parameter, the type of watermark, determines the watermark after general procedure in page Size after being rendered in face.Page size determination unit 1053, for traversing the institute in the PDF document to watermark processing There is the page, and determines the size of maximum page.Rectangle computing unit 1054, for according to the size of identified maximum page, It is right to calculate the transformed restriction path institute of the maximum page by transformation matrix for rotation angle in the watermark general parameter The rectangle size answered.Ranks computing unit 1055, for according to watermark size, the calculated rectangle size of institute and described Watermark tiling parameter calculates line number and columns that rectangle needs are filled up in watermark.Recomposition unit 1056, for according to calculated row Several and columns recombinates watermark and exports the watermark after recombination.Tile result determination unit 1057, makees for the watermark after recombinating For the result of tiling processing.
In one embodiment, watermark size determination unit 1052 includes type judging unit, text size computing unit, figure Chip size computing unit.Wherein, type judging unit, the type of watermark, the type of watermark include text water for identification Print and picture watermark.Text size computing unit obtains the general ginseng of the watermark if being Text Watermarking for the type of watermark Watermark text, font and font size in number;According to the watermark text, font and font size, watermark text is calculated in the page Size after middle rendering.Dimension of picture computing unit obtains the watermark if being picture watermark for the type of watermark Watermark dimension of picture size in general parameter, using acquired watermark dimension of picture size as the watermark picture in the page Size after middle rendering.
Generation unit 106, for generating tiling watermark in the PDF document according to the result of tiling processing.
Type identification unit 107 identifies the type of watermark of existing watermark if being used for the existing watermark of the PDF document.
Text identification unit 108, if the type of watermark for existing watermark is Text Watermarking, to the existing watermark Identified that, to obtain recognition result, the recognition result includes watermark text.
In one embodiment, as shown in fig. 7, text identification unit 108 includes text acquiring unit 1081, text retrieval list Member 1082, text feature judging unit 1083, text tiling determination unit 1084, recording unit 1085.Wherein, text obtains single Member 1081, for obtaining the watermark text of the existing watermark.Text retrieving unit 1082, for retrieving the watermark text Content of text to obtain search result.Text feature judging unit 1083, for judging the watermark text according to search result Whether this has ranks repeat property.Text tiling determination unit 1084, if for having ranks repeat property, determination is described It is tiling watermark there are watermark, and determines the duplicate line number of the existing watermark and columns.Recording unit 1085 is used for basis The duplicate line number of watermark and columns determine and record the watermark tiling parameter of the existing watermark.Text tiling determination unit 1084, if being also used to not have ranks repeat property, determine that the existing watermark is non-tiling watermark.
Judging unit 109 is modified, for judging whether that the watermark modification for receiving user instructs.
Text modification unit 110 receives user and carries out to watermark text if instruction is modified in the watermark for receiving user The modification information of modification.
Picture extraction unit 111 extracts the existing water if the type of watermark for existing watermark is picture watermark The watermark picture of print.
Judging unit 109 is modified, for judging whether that the watermark modification for receiving user instructs.
Picture modifies unit 112, if instruction is modified in the watermark for receiving user, receives user and carries out to watermark picture The modification information of modification.
It should be noted that it is apparent to those skilled in the art that, the tool of above-mentioned apparatus and each unit Body realizes process, can be no longer superfluous herein with reference to the corresponding description in preceding method embodiment, for convenience of description and succinctly It states.
Above-mentioned apparatus can be implemented as a kind of form of computer program, and computer program can be in meter as shown in Figure 8 It calculates and is run on machine equipment.
Fig. 8 is a kind of schematic block diagram of computer equipment provided in an embodiment of the present invention.The equipment is processing PDF watermark The equipment such as server terminal.The equipment 200 includes that processor 202, memory and the network connected by system bus 201 connects Mouth 203, wherein memory may include non-volatile memory medium 204 and built-in storage 205.
The non-volatile memory medium 204 can storage program area 2046 and computer program 2042.This is non-volatile to deposit The computer program 2042 stored in storage media by processor 202 execute when, it can be achieved that described in above-mentioned server based on The watermark Tiling methods of PDF.The processor 202 supports the operation of whole equipment 200 for providing calculating and control ability.It should Built-in storage 205 provides environment for the operation of the computer program in non-volatile memory medium, and the computer program is processed When device 202 executes, processor 202 may make to execute the watermark Tiling methods described in above-mentioned server based on PDF.The network Interface 203 is for carrying out network communication.It will be understood by those skilled in the art that structure shown in Fig. 8, only with the present invention The block diagram of the relevant part-structure of scheme, does not constitute the restriction for the equipment being applied thereon to the present invention program, specifically Equipment may include perhaps combining certain components or with different component cloth than more or fewer components as shown in the figure It sets.
Wherein, the processor 202 is for running computer program stored in memory, to realize following steps:
If receiving watermark addition instruction, the corresponding whether existing water of PDF document of the watermark addition instruction is identified Print;If watermark is not present in the PDF document, the type of watermark and watermark of user's input are received;Receive watermark set by user General parameter and watermark tiling parameter;According to the watermark general parameter, the type of watermark, general procedure is carried out to watermark; According to the watermark general parameter, watermark tiling parameter and the type of watermark, by the watermark after general procedure Carry out tiling processing;Tiling watermark is generated in the PDF document according to the result of tiling processing.
In one embodiment, the processor 202 is described according to the watermark general parameter, watermark tiling in execution Parameter and the type of watermark are implemented as follows when the watermark after general procedure is carried out the step of tiling processing Step:
Judge whether the watermark after general procedure needs to carry out watermark tiling according to watermark tiling parameter;If Watermark tiling need to be carried out, according to the watermark general parameter, the type of watermark, determines the watermark after general procedure in page Size after being rendered in face;All pages in the PDF document to watermark processing are traversed, and determine the ruler of maximum page It is very little;According to the rotation angle in the size of identified maximum page, the watermark general parameter, institute is calculated by transformation matrix State rectangle size corresponding to the transformed restriction path of maximum page;It is big according to watermark size, the calculated rectangle of institute The small and described watermark tiling parameter calculates line number and columns that rectangle needs are filled up in watermark;According to calculated line number and column Number recombinates watermark and exports the watermark after recombination;Using the watermark after recombination as the result of tiling processing.
In one embodiment, the processor 202 is described according to the watermark general parameter, the watermark class in execution Type is implemented as follows step when determining the step of the size after the watermark after general procedure renders in the page:
Identify that the type of watermark, the type of watermark include Text Watermarking and picture watermark;If the type of watermark is Text Watermarking obtains watermark text, font and font size in the watermark general parameter;According to the watermark text, font And font size, calculate the size after watermark text renders in the page;If the type of watermark is picture watermark, institute is obtained The watermark dimension of picture size in watermark general parameter is stated, using acquired watermark dimension of picture size as the watermark picture Size after being rendered in the page.
In one embodiment, the processor 202 also realizes following steps:
If the existing watermark of PDF document, identifies the type of watermark of existing watermark;If the watermark class of existing watermark Type is Text Watermarking, is identified that, to obtain recognition result, the recognition result includes watermark text to the existing watermark; Judge whether that the watermark modification for receiving user instructs;If receiving the watermark modification instruction of user, user is received to watermark text Originally the modification information modified.
In one embodiment, the processor 202 is also implemented as follows step:
If the type of watermark of existing watermark is picture watermark, the watermark picture of the existing watermark is extracted;Judgement is The no watermark modification instruction for receiving user;If receiving the watermark modification instruction of user, receives user and watermark picture is carried out The modification information of modification.
In one embodiment, the processor 202 identifies the existing watermark described to obtain identification knot When the step of fruit, it is implemented as follows step:
Obtain the watermark text of the existing watermark;The content of text of the watermark text is retrieved to obtain retrieval knot Fruit;Judge whether the watermark text has ranks repeat property according to search result;If having ranks repeat property, institute is determined Existing watermark is stated as tiling watermark, and determines the duplicate line number of the existing watermark and columns;According to the duplicate row of watermark Several and columns determines and records the watermark tiling parameter of the existing watermark;If not having ranks repeat property, described in determination Existing watermark is non-tiling watermark.
In one embodiment, the processor 202 is in the step for executing the type of watermark for receiving user's input and watermark When rapid, it is implemented as follows step:
Receive the selected type of watermark of user;If type of watermark is Text Watermarking, the watermark text of user's input is received; If type of watermark is picture watermark, the watermark picture of user's input is received.
It should be appreciated that in embodiments of the present invention, alleged processor 202 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (application program lication Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor Or the processor is also possible to any conventional processor etc..
Those of ordinary skill in the art will appreciate that be realize above-described embodiment method in all or part of the process, It is that relevant hardware can be instructed to complete by computer program.The computer program can be stored in a storage medium, The storage medium can be computer readable storage medium.The computer program is by the processing of at least one of the computer system Device executes, to realize the process step of the embodiment of the above method.
Therefore, the present invention also provides a kind of storage mediums.The storage medium can be computer readable storage medium.It should Storage medium is stored with computer program, which performs the steps of when being executed by a processor
If receiving watermark addition instruction, the corresponding whether existing water of PDF document of the watermark addition instruction is identified Print;If watermark is not present in the PDF document, the type of watermark and watermark of user's input are received;Receive watermark set by user General parameter and watermark tiling parameter;According to the watermark general parameter, the type of watermark, general procedure is carried out to watermark; According to the watermark general parameter, watermark tiling parameter and the type of watermark, by the watermark after general procedure Carry out tiling processing;Tiling watermark is generated in the PDF document according to the result of tiling processing.
In one embodiment, the processor is described according to the watermark general parameter, watermark tiling ginseng in execution The several and described type of watermark is implemented as follows step when the watermark after general procedure is carried out the step of tiling processing It is rapid:
Judge whether the watermark after general procedure needs to carry out watermark tiling according to watermark tiling parameter;If Watermark tiling need to be carried out, according to the watermark general parameter, the type of watermark, determines the watermark after general procedure in page Size after being rendered in face;All pages in the PDF document to watermark processing are traversed, and determine the ruler of maximum page It is very little;According to the rotation angle in the size of identified maximum page, the watermark general parameter, institute is calculated by transformation matrix State rectangle size corresponding to the transformed restriction path of maximum page;It is big according to watermark size, the calculated rectangle of institute The small and described watermark tiling parameter calculates line number and columns that rectangle needs are filled up in watermark;According to calculated line number and column Number recombinates watermark and exports the watermark after recombination;Using the watermark after recombination as the result of tiling processing.
In one embodiment, the processor is described according to the watermark general parameter, the type of watermark in execution, really When determining the step of the size after the watermark after general procedure renders in the page, it is implemented as follows step:
Identify that the type of watermark, the type of watermark include Text Watermarking and picture watermark;If the type of watermark is Text Watermarking obtains watermark text, font and font size in the watermark general parameter;According to the watermark text, font And font size, calculate the size after watermark text renders in the page;If the type of watermark is picture watermark, institute is obtained The watermark dimension of picture size in watermark general parameter is stated, using acquired watermark dimension of picture size as the watermark picture Size after being rendered in the page.
In one embodiment, the processor also realizes following steps:
If the existing watermark of PDF document, identifies the type of watermark of existing watermark;If the watermark class of existing watermark Type is Text Watermarking, is identified that, to obtain recognition result, the recognition result includes watermark text to the existing watermark; Judge whether that the watermark modification for receiving user instructs;If receiving the watermark modification instruction of user, user is received to watermark text Originally the modification information modified.
In one embodiment, the processor is also implemented as follows step:
If the type of watermark of existing watermark is picture watermark, the watermark picture of the existing watermark is extracted;Judgement is The no watermark modification instruction for receiving user;If receiving the watermark modification instruction of user, receives user and watermark picture is carried out The modification information of modification.
In one embodiment, the processor is executing described identified to the existing watermark to obtain identification knot After the step of fruit, it is also implemented as follows step:
Obtain the watermark text of the existing watermark;The content of text of the watermark text is retrieved to obtain retrieval knot Fruit;Judge whether the watermark text has ranks repeat property according to search result;If having ranks repeat property, institute is determined Existing watermark is stated as tiling watermark, and determines the duplicate line number of the existing watermark and columns;According to the duplicate row of watermark Several and columns determines and records the watermark tiling parameter of the existing watermark;If not having ranks repeat property, described in determination Existing watermark is non-tiling watermark.
In one embodiment, the processor is the step of executing the type of watermark and watermark for receiving user's input When, it is implemented as follows step:
Receive the selected type of watermark of user;If type of watermark is Text Watermarking, the watermark text of user's input is received; If type of watermark is picture watermark, the watermark picture of user's input is received.
The storage medium can be USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk Or the various computer readable storage mediums that can store program code such as CD.
In several embodiments provided by the present invention, it should be understood that disclosed device, device and method, it can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, the division of the unit, Only a kind of logical function partition, there may be another division manner in actual implementation.Those skilled in the art can be with It is well understood, for convenience of description and succinctly, the specific work process of the device of foregoing description, equipment and unit can With with reference to the corresponding process in preceding method embodiment, details are not described herein.The above, specific embodiment party only of the invention Formula, but scope of protection of the present invention is not limited thereto, anyone skilled in the art the invention discloses In technical scope, various equivalent modifications or substitutions can be readily occurred in, these modifications or substitutions should all cover in guarantor of the invention Within the scope of shield.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (10)

1. a kind of watermark Tiling methods based on PDF, which is characterized in that the described method includes:
If receiving watermark addition instruction, the corresponding whether existing watermark of PDF document of the watermark addition instruction is identified;
If watermark is not present in the PDF document, the type of watermark and watermark of user's input are received;
Receive watermark general parameter set by user and watermark tiling parameter;
According to the watermark general parameter, the type of watermark, general procedure is carried out to watermark;
It, will be after general procedure according to the watermark general parameter, watermark tiling parameter and the type of watermark Watermark carries out tiling processing;
Tiling watermark is generated in the PDF document according to the result of tiling processing.
2. the method according to claim 1, wherein described flat according to the watermark general parameter, the watermark Parameter and the type of watermark are spread, the watermark after general procedure is subjected to tiling processing, comprising:
Judge whether the watermark after general procedure needs to carry out watermark tiling according to watermark tiling parameter;
If watermark tiling need to be carried out, according to the watermark general parameter, the type of watermark, the water after general procedure is determined The size being imprinted on after being rendered in the page;
All pages in the PDF document to watermark processing are traversed, and determine the size of maximum page;
According to the rotation angle in the size of identified maximum page, the watermark general parameter, calculated by transformation matrix Rectangle size corresponding to the transformed restriction path of maximum page;
It calculates watermark according to watermark size, the calculated rectangle size of institute and watermark tiling parameter and fills up rectangle need The line number and columns wanted;
According to calculated line number and columns, recombinates watermark and export the watermark after recombination;
Using the watermark after recombination as the result of tiling processing.
3. according to the method described in claim 2, it is characterized in that, described according to the watermark general parameter, the watermark class Type determines the size after the watermark after general procedure renders in the page, comprising:
Identify that the type of watermark, the type of watermark include Text Watermarking and picture watermark;
If the type of watermark is Text Watermarking, watermark text, font and the font size in the watermark general parameter are obtained;Root According to the watermark text, font and font size, the size after watermark text renders in the page is calculated;
If the type of watermark is picture watermark, the watermark dimension of picture size in the watermark general parameter is obtained, will be obtained The watermark dimension of picture size taken rendered in the page as the watermark picture after size.
4. the method according to claim 1, wherein the method also includes:
If the existing watermark of PDF document, identifies the type of watermark of existing watermark;
If the type of watermark of existing watermark is Text Watermarking, the existing watermark is identified to obtain recognition result, The recognition result includes watermark text;
Judge whether that the watermark modification for receiving user instructs;
If receiving the watermark modification instruction of user, the modification information that user modifies to watermark text is received.
5. according to the method described in claim 4, it is characterized in that, the method also includes:
If the type of watermark of existing watermark is picture watermark, the watermark picture of the existing watermark is extracted;
Judge whether that the watermark modification for receiving user instructs;
If receiving the watermark modification instruction of user, the modification information that user modifies to watermark picture is received.
6. according to the method described in claim 4, it is characterized in that, described identify to be known the existing watermark Other result, comprising:
Obtain the watermark text of the existing watermark;
The content of text of the watermark text is retrieved to obtain search result;
Judge whether the watermark text has ranks repeat property according to search result;
If having ranks repeat property, determine that the existing watermark is tiling watermark, and determine that the existing watermark repeats Line number and columns;
The watermark tiling parameter of the existing watermark is determined and recorded according to the duplicate line number of watermark and columns;
If not having ranks repeat property, determine that the existing watermark is non-tiling watermark.
7. the method according to claim 1, wherein the type of watermark and watermark for receiving user's input, packet It includes:
Receive the selected type of watermark of user;
If type of watermark is Text Watermarking, the watermark text of user's input is received;
If type of watermark is picture watermark, the watermark picture of user's input is received.
8. a kind of watermark tiling device based on PDF, which is characterized in that the watermark tiling device based on PDF includes:
Watermark judging unit, if identifying the corresponding PDF document of the watermark addition instruction for receiving watermark addition instruction Whether existing watermark;
Newly-increased unit receives the type of watermark and watermark of user's input if watermark is not present for the PDF document;
Parameter set unit, for receiving watermark general parameter set by user and watermark tiling parameter;
General Porcess Unit, for carrying out general procedure to watermark according to the watermark general parameter, the type of watermark;
Tile processing unit, is used for according to the watermark general parameter, watermark tiling parameter and the type of watermark, will Watermark after general procedure carries out tiling processing;
Generation unit, for generating tiling watermark in the PDF document according to the result of tiling processing.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory, and is connected with the memory Processor;
The memory is for storing computer program;The processor is for running the computer journey stored in the memory Sequence, to execute the method according to claim 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence when the computer program is executed by processor, realizes the method according to claim 1 to 7.
CN201811502546.1A 2018-12-10 2018-12-10 Watermark Tiling methods, device, computer equipment and storage medium based on PDF Pending CN109558705A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811502546.1A CN109558705A (en) 2018-12-10 2018-12-10 Watermark Tiling methods, device, computer equipment and storage medium based on PDF

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811502546.1A CN109558705A (en) 2018-12-10 2018-12-10 Watermark Tiling methods, device, computer equipment and storage medium based on PDF

Publications (1)

Publication Number Publication Date
CN109558705A true CN109558705A (en) 2019-04-02

Family

ID=65869314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811502546.1A Pending CN109558705A (en) 2018-12-10 2018-12-10 Watermark Tiling methods, device, computer equipment and storage medium based on PDF

Country Status (1)

Country Link
CN (1) CN109558705A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191414A (en) * 2019-11-11 2020-05-22 苏州亿歌网络科技有限公司 Page watermark generation method, identification method, device, equipment and storage medium
CN112214740A (en) * 2020-09-27 2021-01-12 金蝶医疗软件科技有限公司 PDF processing method, device, computer equipment and storage medium
CN116089363A (en) * 2023-04-04 2023-05-09 联宝(合肥)电子科技有限公司 Data processing method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU4921699A (en) * 1998-07-14 2000-02-07 Athanassios Manikas Electronic watermarking
CN102881034A (en) * 2012-05-14 2013-01-16 珠海金山办公软件有限公司 System and method for inserting watermarks into application document
CN105139334A (en) * 2015-10-10 2015-12-09 上海中信信息发展股份有限公司 Multiline text watermark production device
CN105488432A (en) * 2015-11-30 2016-04-13 山东中创软件工程股份有限公司 Document anti-fake method and device
CN106778105A (en) * 2016-11-28 2017-05-31 福建天泉教育科技有限公司 The adding method and system of digital visible watermark

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU4921699A (en) * 1998-07-14 2000-02-07 Athanassios Manikas Electronic watermarking
CN102881034A (en) * 2012-05-14 2013-01-16 珠海金山办公软件有限公司 System and method for inserting watermarks into application document
CN105139334A (en) * 2015-10-10 2015-12-09 上海中信信息发展股份有限公司 Multiline text watermark production device
CN105488432A (en) * 2015-11-30 2016-04-13 山东中创软件工程股份有限公司 Document anti-fake method and device
CN106778105A (en) * 2016-11-28 2017-05-31 福建天泉教育科技有限公司 The adding method and system of digital visible watermark

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BRIGHT2017: "设置页面水印的效果", 《HTTPS://BRIGHT2017.BLOG.CSDN.NET/ARTICLE/DETAILS/70332747?UTM_MEDIUM》 *
GONGQI: "用JavaScript实现网页动态水印", 《HTTPS://WWW.CNBLOGS.COM/GONGQI/P/4074609.HTML?UTM_SOURCE=TUICOOL&UTM_MEDIUM=REFERRAL》 *
冰泪恋心: "页面水印效果的实现—新篇", 《HTTPS://WWW.CNBLOGS.COM/BLLX/P/8757064.HTML》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191414A (en) * 2019-11-11 2020-05-22 苏州亿歌网络科技有限公司 Page watermark generation method, identification method, device, equipment and storage medium
CN112214740A (en) * 2020-09-27 2021-01-12 金蝶医疗软件科技有限公司 PDF processing method, device, computer equipment and storage medium
CN116089363A (en) * 2023-04-04 2023-05-09 联宝(合肥)电子科技有限公司 Data processing method, device, electronic equipment and storage medium
CN116089363B (en) * 2023-04-04 2023-09-01 联宝(合肥)电子科技有限公司 Data processing method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
AU2019202677B2 (en) System and method for automated conversion of interactive sites and applications to support mobile and other display environments
US5761686A (en) Embedding encoded information in an iconic version of a text image
WO2019127824A1 (en) Visual diagram page realization method and apparatus, terminal device and storage medium
CN109558705A (en) Watermark Tiling methods, device, computer equipment and storage medium based on PDF
US5765176A (en) Performing document image management tasks using an iconic image having embedded encoded information
US8593666B2 (en) Method and system for printing a web page
CN110009721A (en) Generate the triangle gridding of the image indicated by curve
JP5736767B2 (en) Providing method of digital media, print medium, and computer program
TWI533194B (en) Methods for generating reflow-content electronic-book and website system thereof
US10678410B2 (en) Browser-based image processing
US8522138B2 (en) Content analysis apparatus and method
CN112965645B (en) Page dragging method and device, computer equipment and storage medium
CN103186880B (en) Generate the method and apparatus of thumbnail
US20170060820A1 (en) Authoring tool including style selector bars for selecting styles for media components
CN105404612A (en) Digital resource display method and system
CN105512096B (en) A kind of optimization method and device based on font embedded in document
CN114332895A (en) Text image synthesis method, text image synthesis device, text image synthesis equipment, storage medium and program product
CN109582934A (en) The conversion method and device of format document
AU2019226189B2 (en) A system for comparison and merging of versions in edited websites and interactive applications
US20180307665A1 (en) Computer Implemented Methods For Enhancing Word Processor Software with Third-Party Electronic Forms Design Software
TWM491194U (en) Data checking platform server
JP2017033355A (en) Information processing device and program
JP7451106B2 (en) Information processing device, control method, program and storage medium
JP7310178B2 (en) Information processing system, information processing device and program
JP2019159839A (en) Information processing program, information processing method, and information processing device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190402