CN116127916B - Method and device for dynamically adding watermark - Google Patents

Method and device for dynamically adding watermark Download PDF

Info

Publication number
CN116127916B
CN116127916B CN202211444874.7A CN202211444874A CN116127916B CN 116127916 B CN116127916 B CN 116127916B CN 202211444874 A CN202211444874 A CN 202211444874A CN 116127916 B CN116127916 B CN 116127916B
Authority
CN
China
Prior art keywords
watermark
ofd
page
path data
layer
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.)
Active
Application number
CN202211444874.7A
Other languages
Chinese (zh)
Other versions
CN116127916A (en
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.)
Baiwang Co ltd
Original Assignee
Baiwang Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baiwang Co ltd filed Critical Baiwang Co ltd
Priority to CN202211444874.7A priority Critical patent/CN116127916B/en
Publication of CN116127916A publication Critical patent/CN116127916A/en
Application granted granted Critical
Publication of CN116127916B publication Critical patent/CN116127916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The application discloses a method and a device for dynamically adding watermarks, wherein the method comprises the following steps: analyzing an OFD page of the open fixed format document, and establishing an OFD display model according to an analysis result; according to the attribute of the watermark characters and the attribute of the OFD page, arranging the watermark characters on the OFD page, and generating a watermark path data set according to arrangement conditions, wherein the watermark path data set comprises all watermark path data which need to be added on the OFD page; randomly extracting watermark path data from the watermark path data set, and inserting watermark graphic data corresponding to the watermark path data into a layer of the OFD display model. According to the method, the OFD display model is built by analyzing the OFD page, and watermark graphic data is inserted into the image layer of the OFD display model according to the watermark path data, so that the confidentiality of the watermark can be improved, and an infringer is not easy to position the watermark.

Description

Method and device for dynamically adding watermark
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method and a device for dynamically adding watermarks.
Background
Along with popularization and popularity of OFD (Open Fixed-layout Documents) files, a large number of OFD reading and editing software and background processing programs appear on the market, and many of the OFD files have watermark processing functions and can be added with or removed from the OFD format files.
From the technical point of view, the current watermarking processing thought is single, two types are commonly used, namely, a watermarking annotation is used, the scheme uses words or images to describe the appearance of the watermark, and the advantage is that the grammar structure supported by the OFD format is utilized, and other standard OFD software can be identified. Another solution is to add text to the page content and mix the watermark content with the text content. The common feature of both schemes is the embedding of textual profile information and character codes, which may be referred to as "plaintext watermarks".
The plaintext watermark is convenient for human reading, can play the roles of advertising and warning readers of author copyrights, but has the problem of being easy to erase, for example, the watermark annotation adopts a grammar structure supported by an OFD format, and common OFD software can identify where watermark data is, so that the watermark data can be directly edited or removed. However, for the scheme of adding text in page content and mixing watermark content and text content, the recognition difficulty is not great as a whole, for example, the text content of the watermark is manually specified, and then the watermark text is screened by a text searching mode is also possible, but the processing process is slightly complicated.
Therefore, the plaintext watermarking technology in the prior art has the defect that watermark elements are easy to locate and erase, and the confidentiality of the watermark is low.
Content of the application
The embodiment of the application aims to provide a method and a device for dynamically adding watermarks, which are used for solving the defect that the watermarks are easy to locate and erase in the watermarking technology in the prior art.
In order to solve the technical problems, the application is realized as follows:
In a first aspect, a method for dynamically watermarking is provided, comprising the steps of:
Analyzing an OFD page of the open fixed format document, and establishing an OFD display model according to an analysis result;
According to the attribute of the watermark characters and the attribute of the OFD page, arranging the watermark characters on the OFD page, and generating a watermark path data set according to arrangement conditions, wherein the watermark path data set comprises all watermark path data which need to be added on the OFD page;
Randomly extracting watermark path data from the watermark path data set, and inserting watermark graphic data corresponding to the watermark path data into a layer of the OFD display model.
In a second aspect, there is provided an apparatus for dynamically watermarking, comprising:
The analysis module is used for analyzing the OFD page of the open fixed format document and establishing an OFD display model according to the analysis result;
The generation module is used for arranging the watermark characters on the OFD page according to the attribute of the watermark characters and the attribute of the OFD page, and generating a watermark path data set according to the arrangement condition, wherein the watermark path data set comprises all watermark path data which need to be added on the OFD page;
And the inserting module is used for randomly extracting watermark path data from the watermark path data set and inserting watermark graphic data corresponding to the watermark path data into the image layer of the OFD display model.
According to the embodiment of the application, the OFD display model is built by analyzing the OFD page, and the watermark graphic data is inserted into the image layer of the OFD display model according to the watermark path data, so that the concealment of the watermark can be increased, and an infringer is not easy to position the watermark.
Drawings
Fig. 1 is a flowchart of a method for dynamically adding watermarks according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a device for dynamically watermarking according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Along with the increasing popularization of domestic basic software, the application range of OFD format files is wider and wider, and watermarks need to be added in many business scenes, so that the method is used as Logo to play an advertising role on one hand and is also a copyright statement means on the other hand. Most of software uses fixed plaintext watermark, such as OFD standard watermark, adding text content, etc., the scheme is simple to realize, but has a significant problem of easy cracking, and common users can easily identify and delete by program mode using OFD reading software or technical manufacturer, and then diffuse files, so infringement cost is low, which is not beneficial to protecting rights of authors.
In order to solve the problems of the watermark embedding technology, the embodiment of the application provides a method and a device for adding a dynamic Path watermark in an OFD format, and improves the watermark adding mode and process, thereby increasing the recognition difficulty of the watermark. The method has the advantages that the method of adding the watermark in the page layer replaces the direct use of the OFD watermark structure and the text Path object replaces the text watermark, so that a cracker cannot simply position the watermark structure, and meanwhile, violent retrieval of watermark data is prevented. The improvement of the process is characterized in that firstly, all watermark elements in a page are typeset, then, the coordinate transformation of a single watermark Path is calculated, in addition, the insertion position of the watermark elements is dynamically selected, the random generation of the watermark initial position in the whole page is included, the insertion layer of the watermark elements is randomly generated, and meanwhile, the OFD display model is detected to ensure the correctness of the watermark and the overall display effect of the page content, and the difficulty of watermark cracking can be greatly increased through the improvement.
Specifically, the technical scheme of the embodiment of the application comprises the following three key steps:
1. OFD page analysis, identifying layers and primitives
And analyzing the OFD file according to the grammar rule of the OFD format file, and obtaining the width, the height, the layer and the primitive data in the layer, wherein the primitive types comprise graphics, images, characters, videos and composite objects. And analyzing the primitive Boundary attribute to obtain the plane distribution of the visual elements in the layers, and sequentially pushing the visual elements into a stack according to the appearance sequence of the layers to form a stacking relationship, so as to establish a simple display model of the OFD page.
2. Path data extraction and watermark page typesetting
And loading a watermark font file, and extracting font Path data and font width information of the watermark text. The watermarks are sequentially arranged along the reading direction from the origin of the first character pattern, the offset of the next character and the previous character in the X direction is the width of the former character, and the character offset is recorded at the same time, so that single-line typesetting data taking the character pattern Path as the basic is formed. According to the width and the height of the page, the width and the height of the single-row watermarks, the watermark spacing and the number of watermarks needing to be tiled in the page are calculated, so that all watermark Path data sets needing to be added in the page are obtained.
3. Watermark Path data insertion processing
After the processing of the last step, each piece of data in the watermark Path data set has a complete coordinate transformation relation, including offset in watermark lines, watermark line rotation and watermark unit relative page offset, the final display coordinates of the watermark on the page can be calculated by determining the page watermark starting position, and meanwhile, the relation between the data is discrete and does not need to be processed in sequence, so that a single Path data can be randomly selected for processing. The dynamics of Path data insertion are reflected in the following aspects, firstly, path data are not added piece by piece, and are randomly extracted from a set; secondly, the watermark initial position offset of each page is dynamically calculated, so that the difference of each page can be ensured; again, the Path inserted layer is not fixed and is dynamically generated by the program, where the Path inserted layer cannot be occluded by normal primitives in the page, taking into account the correctness of the display, referring to the OFD display model.
The method for dynamically adding the watermark provided by the embodiment of the application is described in detail through specific embodiments and application scenes thereof with reference to the accompanying drawings.
As shown in fig. 1, a flowchart of a method for dynamically adding watermarks is provided in an embodiment of the present application, where the method includes the following steps:
and step 101, analyzing the OFD page, and establishing an OFD display model according to the analysis result.
Specifically, an OFD page can be analyzed to obtain a plurality of layers of the OFD page; respectively analyzing a plurality of layers of the OFD page to obtain the primitives of each layer; respectively analyzing rectangular areas of the primitives of each layer, and establishing plane distribution of the primitives of each layer; and according to the sequence of each layer appearing on the OFD page, pushing each layer into a stack in sequence, and establishing a stacking relation of the layers to form the OFD display model.
And 102, arranging the watermark characters on the OFD page according to the attribute of the watermark characters and the attribute of the OFD page, and generating a watermark path data set according to the arrangement condition.
Specifically, a watermark font file can be loaded, and font path data and font width information can be extracted word by word; sequentially arranging watermark characters along the reading direction from the origin of the first character pattern, wherein the offset of the next watermark character and the previous watermark character in the X direction is the width of the next watermark character, and recording the offset, the line width and the line height in the line to form single-line typesetting data taking the character pattern path as the basic; calculating a transformation matrix of the font path data according to the rotation angle of the watermark characters; according to the width and the height of the OFD page, the line width, the line height and the watermark spacing of the single-line watermarks, the number of watermarks needing to be tiled in the page is calculated, and a watermark path data set is obtained.
Wherein the watermark path data set comprises all watermark path data that needs to be added at said OFD page.
Step 103, watermark path data are randomly extracted from the watermark path data set, and watermark graphic data corresponding to the watermark path data are inserted into the layer of the OFD display model.
Each piece of watermark path data in the watermark path data set has a complete coordinate transformation relation, including offset in watermark lines, watermark line rotation and offset of watermark units relative to pages.
Correspondingly, watermark initial offset of the OFD page can be randomly generated, and watermark path data can be randomly extracted from the watermark path data set; calculating the final display position of a watermark pattern corresponding to watermark path data in the OFD page according to watermark initial offset, watermark line internal offset, watermark line rotation and watermark unit relative page offset in the watermark path data; randomly generating a watermark insertion layer sequence number, and inserting watermark graphic data corresponding to the watermark path data into a layer corresponding to the sequence number.
In this embodiment, watermark graphic data corresponding to the watermark path data may be inserted into a layer of the OFD display model by performing the following steps:
step A: adding a new layer in the OFD page, and inserting the new layer into the topmost layer of the OFD page;
And (B) step (B): randomly generating a watermark insertion layer sequence number;
Step C: detecting whether the image layer corresponding to the serial number and the image layer on the upper layer of the image layer have the image element of the external matrix intersection of the watermark image corresponding to the watermark path data according to the OFD display model, and if not, executing the step D; otherwise, executing the step E;
step D: inserting watermark graphic data corresponding to the watermark path data into the layer corresponding to the sequence number;
Step E: and (C) adding 1 to the serial number, and returning to the step (C).
According to the embodiment of the application, the OFD display model is built by analyzing the OFD page, and the watermark graphic data is inserted into the image layer of the OFD display model according to the watermark path data, so that the concealment of the watermark can be increased, and an infringer is not easy to position the watermark.
In the embodiment of the application, an OFD page is analyzed, an OFD display model is established based on a layer and a basic graphic element, watermark content describes a text object by using text Path data, watermark display difference is caused in each page by dynamically setting watermark offset in the page, watermark insertion layers are dynamically selected by combining the OFD display model, and element insertion positions in the layer are dynamically selected.
The method for analyzing the OFD page and identifying the layers and the parts of the primitives comprises the following steps:
1. analyzing the OFD page to obtain a layer set Cl of the page;
2. Analyzing the OFD layer to obtain a primitive set Ce, wherein the primitive types comprise graphics, images, characters, videos and composite objects;
3. analyzing the rectangular area of the primitive, and establishing the plane distribution of the primitive of the current layer;
4. the page layers are sequentially stacked, a Z-axis stacking relation of the layers is established, and a simple display model Vm of the OFD page content is formed.
Further, the Path data extraction and watermark page typesetting part comprises the following steps:
5. Loading watermark font file, extracting character pattern Path data P and character width W word by word
6. Typesetting of watermark pages:
6.1. Typesetting in a row, sequentially arranging watermarks along a reading direction from a first character origin, wherein the offset of a next character and a previous character in the X direction is the width of the former character, and recording the offset Offx in the row, the row width Lw and the row height Lh;
6.2. Unit typesetting, namely calculating a transformation matrix Mc of the font Path data according to the rotation angle of the watermark;
6.3. Page typesetting, namely calculating the number of watermarks needing to be tiled in a page and the positions Upos of each unit according to the width and the height of the page, the width and the height of a single row of watermarks and the watermark spacing;
6.4. Collecting data, and generating typesetting parameters of all watermark Path data to form a set Cwater according to typesetting conditions of the watermark units in the page, wherein each element E comprises P, upos, mc, offx;
Further, based on the OFD display model, inserting the portion of watermark Path data includes the steps of:
7. adding a new layer Lt in the page, and inserting the top layer of the page;
8. randomly generating a watermark start offset Offpage in the current page;
9. Randomly fetching a watermark element E from the collection Cwater;
10. calculating the final display position of E in the page and the circumscribed rectangle Re according to the offset Offx of E in the unit, the watermark unit rotation matrix Mc, the unit position Upos and the watermark page initial offset Offpage;
11. Randomly generating a watermark insertion layer sequence number Index, detecting whether a graphic element intersected with R exists in the Index layer and an upper layer of the Index layer according to the display model Vm, if not, executing a step 12, otherwise, taking index+1 by the Index layer, and continuing to detect until the Lt layer;
12. through the calculation in the step 11, the screened Index layer has no problem of influencing Vm, so that the watermark Path data can be inserted into the back of the existing graphic element of the layer, and the position is still dynamically determined through random generation;
13. inserting watermark graphic data into an Index layer, and setting Path data, a bound, a transformation matrix and the like;
14. whether watermark elements exist in the set Cwater is judged, if yes, the step 9 is passed, otherwise, the writing flow is ended.
The embodiment of the application can realize the increase of the hiding performance of the watermark by modifying the watermark adding mode and the adding process, greatly enhance the difficulty of watermark identification while maintaining the display effect of the plaintext watermark, prevent an infringer from easily positioning watermark elements and erasing, and improve the watermark removing cost, thereby protecting the rights of an author, fully considering the shielding influence of page contents on the watermark elements in the watermark embedding process, and ensuring the correct hierarchical relationship between the added watermark elements and the page elements by dynamically selecting layers and adjusting, thereby perfectly displaying the display effect to be achieved by the watermark, and finally ensuring the consistency of the watermark effect embedded by the technology and conventional processing.
As shown in fig. 2, a schematic structural diagram of a device for dynamically adding watermarks according to an embodiment of the present application includes:
the parsing module 210 is configured to parse the open fixed format document OFD page, and build an OFD display model according to the parsing result.
Specifically, the parsing module 210 is specifically configured to parse an OFD page, so as to obtain multiple layers of the OFD page; respectively analyzing a plurality of layers of the OFD page to obtain the primitives of each layer; respectively analyzing rectangular areas of the primitives of each layer, and establishing plane distribution of the primitives of each layer; and according to the sequence of each layer appearing on the OFD page, pushing each layer into a stack in sequence, and establishing a stacking relation of the layers to form the OFD display model.
The generating module 220 is configured to arrange the watermark text on the OFD page according to the attribute of the watermark text and the attribute of the OFD page, and generate a watermark path data set according to the arrangement condition, where the watermark path data set includes all watermark path data that needs to be added on the OFD page.
Specifically, the generating module 220 is specifically configured to load a watermark font file, and extract, word by word, font path data and font width information; sequentially arranging watermark characters along the reading direction from the origin of the first character pattern, wherein the offset of the next watermark character and the previous watermark character in the X direction is the width of the next watermark character, and recording the offset, the line width and the line height in the line to form single-line typesetting data taking the character pattern path as the basic; calculating a transformation matrix of the font path data according to the rotation angle of the watermark characters; according to the width and the height of the OFD page, the line width, the line height and the watermark spacing of the single-line watermarks, the number of watermarks needing to be tiled in the page is calculated, and a watermark path data set is obtained.
And the inserting module 230 is configured to randomly extract watermark path data from the watermark path data set, and insert watermark graphic data corresponding to the watermark path data into a layer of the OFD display model.
Each piece of watermark path data in the watermark path data set has a complete coordinate transformation relation, including offset in watermark lines, watermark line rotation and offset of watermark units relative to pages.
Specifically, the inserting module 230 is specifically configured to randomly generate a watermark start offset of the OFD page, and randomly extract one piece of watermark path data from the watermark path data set; calculating the final display position of a watermark pattern corresponding to watermark path data in the OFD page according to watermark initial offset, watermark line internal offset, watermark line rotation and watermark unit relative page offset in the watermark path data; randomly generating a watermark insertion layer sequence number, and inserting watermark graphic data corresponding to the watermark path data into a layer corresponding to the sequence number.
In this embodiment, the inserting module 230 is specifically configured to perform the following steps:
step A: adding a new layer in the OFD page, and inserting the new layer into the topmost layer of the OFD page;
And (B) step (B): randomly generating a watermark insertion layer sequence number;
Step C: detecting whether the image layer corresponding to the serial number and the image layer on the upper layer of the image layer have the image element of the external matrix intersection of the watermark image corresponding to the watermark path data according to the OFD display model, and if not, executing the step D; otherwise, executing the step E;
step D: inserting watermark graphic data corresponding to the watermark path data into the layer corresponding to the sequence number;
Step E: and (C) adding 1 to the serial number, and returning to the step (C).
According to the embodiment of the application, the OFD display model is built by analyzing the OFD page, and the watermark graphic data is inserted into the image layer of the OFD display model according to the watermark path data, so that the concealment of the watermark can be increased, and an infringer is not easy to position the watermark.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (8)

1. A method of dynamically watermarking comprising the steps of:
Analyzing an OFD page of the open fixed format document, and establishing an OFD display model according to an analysis result;
According to the attribute of the watermark characters and the attribute of the OFD page, arranging the watermark characters on the OFD page, and generating a watermark path data set according to arrangement conditions, wherein the watermark path data set comprises all watermark path data which need to be added on the OFD page;
randomly extracting watermark path data from the watermark path data set, and inserting watermark graphic data corresponding to the watermark path data into a layer of the OFD display model;
Each piece of watermark path data in the watermark path data set has a complete coordinate transformation relation, and the relation comprises watermark line internal offset, watermark line rotation and watermark unit relative page offset;
The step of randomly extracting watermark path data from the watermark path data set and inserting watermark graphic data corresponding to the watermark path data into a layer of the OFD display model specifically comprises the following steps:
randomly generating a watermark initial offset of an OFD page, and randomly extracting watermark path data from the watermark path data set;
Calculating the final display position of a watermark pattern corresponding to watermark path data in the OFD page according to watermark initial offset, watermark line internal offset, watermark line rotation and watermark unit relative page offset in the watermark path data;
Randomly generating a watermark insertion layer sequence number, and inserting watermark graphic data corresponding to the watermark path data into a layer corresponding to the sequence number.
2. The method according to claim 1, wherein the parsing the open fixed format document OFD page and building an OFD display model according to the parsing result specifically includes:
analyzing an OFD page to obtain a plurality of layers of the OFD page;
respectively analyzing a plurality of layers of the OFD page to obtain the primitives of each layer;
Respectively analyzing rectangular areas of the primitives of each layer, and establishing plane distribution of the primitives of each layer;
and according to the sequence of each layer appearing on the OFD page, pushing each layer into a stack in sequence, and establishing a stacking relation of the layers to form the OFD display model.
3. The method according to claim 1, wherein the step of arranging the watermark text on the OFD page according to the attribute of the watermark text and the attribute of the OFD page, and generating the watermark path data set according to the arrangement condition, specifically comprises:
Loading a watermark font file, and extracting font path data and font width information word by word;
Sequentially arranging watermark characters along the reading direction from the origin of the first character pattern, wherein the offset of the next watermark character and the previous watermark character in the X direction is the width of the next watermark character, and recording the offset, the line width and the line height in the line to form single-line typesetting data taking the character pattern path as the basic;
calculating a transformation matrix of the font path data according to the rotation angle of the watermark characters;
according to the width and the height of the OFD page, the line width, the line height and the watermark spacing of the single-line watermarks, the number of watermarks needing to be tiled in the page is calculated, and a watermark path data set is obtained.
4. The method according to claim 1, wherein the inserting watermark graphic data corresponding to the watermark path data into the layer of the OFD display model specifically comprises:
step A: adding a new layer in the OFD page, and inserting the new layer into the topmost layer of the OFD page;
And (B) step (B): randomly generating a watermark insertion layer sequence number;
Step C: detecting whether the image layer corresponding to the serial number and the image layer on the upper layer of the image layer have the image element of the external matrix intersection of the watermark image corresponding to the watermark path data according to the OFD display model, and if not, executing the step D; otherwise, executing the step E;
step D: inserting watermark graphic data corresponding to the watermark path data into the layer corresponding to the sequence number;
Step E: and (C) adding 1 to the serial number, and returning to the step (C).
5. A device for dynamically watermarking, comprising:
The analysis module is used for analyzing the OFD page of the open fixed format document and establishing an OFD display model according to the analysis result;
The generation module is used for arranging the watermark characters on the OFD page according to the attribute of the watermark characters and the attribute of the OFD page, and generating a watermark path data set according to the arrangement condition, wherein the watermark path data set comprises all watermark path data which need to be added on the OFD page;
The inserting module is used for randomly extracting watermark path data from the watermark path data set and inserting watermark graphic data corresponding to the watermark path data into a layer of the OFD display model;
Each piece of watermark path data in the watermark path data set has a complete coordinate transformation relation, and the relation comprises watermark line internal offset, watermark line rotation and watermark unit relative page offset;
The inserting module is specifically configured to randomly generate a watermark initial offset of an OFD page, and randomly extract watermark path data from the watermark path data set; calculating the final display position of a watermark pattern corresponding to watermark path data in the OFD page according to watermark initial offset, watermark line internal offset, watermark line rotation and watermark unit relative page offset in the watermark path data; randomly generating a watermark insertion layer sequence number, and inserting watermark graphic data corresponding to the watermark path data into a layer corresponding to the sequence number.
6. The apparatus of claim 5, wherein the device comprises a plurality of sensors,
The analysis module is specifically configured to analyze an OFD page to obtain multiple layers of the OFD page; respectively analyzing a plurality of layers of the OFD page to obtain the primitives of each layer; respectively analyzing rectangular areas of the primitives of each layer, and establishing plane distribution of the primitives of each layer; and according to the sequence of each layer appearing on the OFD page, pushing each layer into a stack in sequence, and establishing a stacking relation of the layers to form the OFD display model.
7. The apparatus of claim 5, wherein the device comprises a plurality of sensors,
The generating module is specifically used for loading watermark font files and extracting font path data and font width information word by word; sequentially arranging watermark characters along the reading direction from the origin of the first character pattern, wherein the offset of the next watermark character and the previous watermark character in the X direction is the width of the next watermark character, and recording the offset, the line width and the line height in the line to form single-line typesetting data taking the character pattern path as the basic; calculating a transformation matrix of the font path data according to the rotation angle of the watermark characters; according to the width and the height of the OFD page, the line width, the line height and the watermark spacing of the single-line watermarks, the number of watermarks needing to be tiled in the page is calculated, and a watermark path data set is obtained.
8. The device according to claim 5, characterized in that said insertion module is in particular adapted to perform the following steps:
step A: adding a new layer in the OFD page, and inserting the new layer into the topmost layer of the OFD page;
And (B) step (B): randomly generating a watermark insertion layer sequence number;
Step C: detecting whether the image layer corresponding to the serial number and the image layer on the upper layer of the image layer have the image element of the external matrix intersection of the watermark image corresponding to the watermark path data according to the OFD display model, and if not, executing the step D; otherwise, executing the step E;
step D: inserting watermark graphic data corresponding to the watermark path data into the layer corresponding to the sequence number;
Step E: and (C) adding 1 to the serial number, and returning to the step (C).
CN202211444874.7A 2022-11-18 2022-11-18 Method and device for dynamically adding watermark Active CN116127916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211444874.7A CN116127916B (en) 2022-11-18 2022-11-18 Method and device for dynamically adding watermark

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211444874.7A CN116127916B (en) 2022-11-18 2022-11-18 Method and device for dynamically adding watermark

Publications (2)

Publication Number Publication Date
CN116127916A CN116127916A (en) 2023-05-16
CN116127916B true CN116127916B (en) 2024-05-28

Family

ID=86298071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211444874.7A Active CN116127916B (en) 2022-11-18 2022-11-18 Method and device for dynamically adding watermark

Country Status (1)

Country Link
CN (1) CN116127916B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117910438A (en) * 2024-03-13 2024-04-19 江苏中威科技软件系统有限公司 Dynamic format file DLF generation device

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002084510A (en) * 2000-09-08 2002-03-22 Jisedai Joho Hoso System Kenkyusho:Kk Method and apparatus for embedding electronic watermark
CN101408923A (en) * 2007-11-16 2009-04-15 清华大学 Method for affirming IP nuclear publishing rights by using digital watermarking technology
CN105139334A (en) * 2015-10-10 2015-12-09 上海中信信息发展股份有限公司 Multiline text watermark production device
CN108810654A (en) * 2018-07-12 2018-11-13 武汉斗鱼网络科技有限公司 A kind of watermark adding method, device and electronic equipment
CN109583158A (en) * 2018-11-15 2019-04-05 福建南威软件有限公司 A kind of electronics license copy generation method based on dynamic watermark
CN109963204A (en) * 2019-04-24 2019-07-02 努比亚技术有限公司 Watermark adding method, device, mobile terminal and readable storage medium storing program for executing
CN110069942A (en) * 2019-03-18 2019-07-30 广州多益网络股份有限公司 Watermark embedding method, device, equipment and computer readable storage medium
CN110941845A (en) * 2019-12-13 2020-03-31 北京锐安科技有限公司 File acquisition method and device, computer equipment and storage medium
CN111680273A (en) * 2020-05-21 2020-09-18 北京北信源软件股份有限公司 Watermark embedding method, device, electronic equipment and readable storage medium
CN111738898A (en) * 2020-06-17 2020-10-02 友虹(北京)科技有限公司 Text digital watermark embedding \ extracting method and device
CN114238877A (en) * 2021-12-15 2022-03-25 湖南麒麟信安科技股份有限公司 Watermark generation method and device for cloud desktop and electronic equipment
CN114417226A (en) * 2021-11-10 2022-04-29 北京字节跳动网络技术有限公司 Page generation method, display method, device, electronic equipment and storage medium
CN114612279A (en) * 2020-12-03 2022-06-10 腾讯科技(深圳)有限公司 Watermark adding method and device
CN114817872A (en) * 2022-03-15 2022-07-29 百望股份有限公司 Method for adding dynamic watermark in OFD (office automation) document
CN114943065A (en) * 2022-06-12 2022-08-26 上海明度智云计算有限公司 User-defined multi-watermark combination generation method, system and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004023565A (en) * 2002-06-18 2004-01-22 Canon Inc Electronic watermark burying apparatus, electronic watermark extracting apparatuses, and method thereof
US20060239500A1 (en) * 2005-04-20 2006-10-26 Meyer Thomas W Method of and apparatus for reversibly adding watermarking data to compressed digital media files

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002084510A (en) * 2000-09-08 2002-03-22 Jisedai Joho Hoso System Kenkyusho:Kk Method and apparatus for embedding electronic watermark
CN101408923A (en) * 2007-11-16 2009-04-15 清华大学 Method for affirming IP nuclear publishing rights by using digital watermarking technology
CN105139334A (en) * 2015-10-10 2015-12-09 上海中信信息发展股份有限公司 Multiline text watermark production device
CN108810654A (en) * 2018-07-12 2018-11-13 武汉斗鱼网络科技有限公司 A kind of watermark adding method, device and electronic equipment
CN109583158A (en) * 2018-11-15 2019-04-05 福建南威软件有限公司 A kind of electronics license copy generation method based on dynamic watermark
CN110069942A (en) * 2019-03-18 2019-07-30 广州多益网络股份有限公司 Watermark embedding method, device, equipment and computer readable storage medium
CN109963204A (en) * 2019-04-24 2019-07-02 努比亚技术有限公司 Watermark adding method, device, mobile terminal and readable storage medium storing program for executing
CN110941845A (en) * 2019-12-13 2020-03-31 北京锐安科技有限公司 File acquisition method and device, computer equipment and storage medium
CN111680273A (en) * 2020-05-21 2020-09-18 北京北信源软件股份有限公司 Watermark embedding method, device, electronic equipment and readable storage medium
CN111738898A (en) * 2020-06-17 2020-10-02 友虹(北京)科技有限公司 Text digital watermark embedding \ extracting method and device
CN114612279A (en) * 2020-12-03 2022-06-10 腾讯科技(深圳)有限公司 Watermark adding method and device
CN114417226A (en) * 2021-11-10 2022-04-29 北京字节跳动网络技术有限公司 Page generation method, display method, device, electronic equipment and storage medium
CN114238877A (en) * 2021-12-15 2022-03-25 湖南麒麟信安科技股份有限公司 Watermark generation method and device for cloud desktop and electronic equipment
CN114817872A (en) * 2022-03-15 2022-07-29 百望股份有限公司 Method for adding dynamic watermark in OFD (office automation) document
CN114943065A (en) * 2022-06-12 2022-08-26 上海明度智云计算有限公司 User-defined multi-watermark combination generation method, system and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Research on Application of OFD Technology in Secure Electronic Bills;Shaokang Wang et al;ICAIS 2019: Artificial Intelligence and Security;20190711;128–139 *
基于矩阵分解的小波域鲁棒水印算法研究;张丽娜;中国优秀硕士学位论文全文数据库信息科技辑;20210515(第5期);I138-43 *
基于零水印的动态多重水印算法;齐文通;中国优秀硕士学位论文全文数据库信息科技辑;20090715(第7期);I138-27 *

Also Published As

Publication number Publication date
CN116127916A (en) 2023-05-16

Similar Documents

Publication Publication Date Title
US20190087392A1 (en) System and method for automated conversion of interactive sites and applications to support mobile and other display environments
US5960448A (en) System and method for displaying a graphically enhanced view of a region of a document image in which the enhanced view is correlated with text derived from the document image
US9817804B2 (en) System for comparison and merging of versions in edited websites and interactive applications
US8494280B2 (en) Automated method for extracting highlighted regions in scanned source
US8718364B2 (en) Apparatus and method for digitizing documents with extracted region data
US8539342B1 (en) Read-order inference via content sorting
US5765176A (en) Performing document image management tasks using an iconic image having embedded encoded information
US8930814B2 (en) Digital comic editor, method and non-transitory computer-readable medium
JP5439454B2 (en) Electronic comic editing apparatus, method and program
US7602972B1 (en) Method and apparatus for identifying white space tables within a document
US20130326341A1 (en) Digital comic editor, method and non-transitorycomputer-readable medium
US8522138B2 (en) Content analysis apparatus and method
US20130014007A1 (en) Method for creating an enrichment file associated with a page of an electronic document
US20130100161A1 (en) Digital comic editor, method and non-transitory computer-readable medium
CN104111922A (en) Processing method and device of streaming document
CN116127916B (en) Method and device for dynamically adding watermark
CN116126349B (en) OOXML document entrainment detection method, storage medium and electronic device
WO2012002357A1 (en) Document processing device and program
KR20110087620A (en) Layout based page recognition method for printed medium
WO2015047921A1 (en) Determining images of article for extraction
JP2010258627A (en) Image processor, image processing method, program, and storage medium
CN115994521A (en) Document editing method, presentation method, and document paragraph identification method and device
Chao Graphics extraction in a PDF document
CN117763257A (en) Webpage sensitive content marking system based on OCR
CN113378528A (en) Watermark identification method and device for PDF (Portable document Format) file

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
GR01 Patent grant