CN111523294A - PDF file-based comment separation processing method and device - Google Patents
PDF file-based comment separation processing method and device Download PDFInfo
- Publication number
- CN111523294A CN111523294A CN202010329251.XA CN202010329251A CN111523294A CN 111523294 A CN111523294 A CN 111523294A CN 202010329251 A CN202010329251 A CN 202010329251A CN 111523294 A CN111523294 A CN 111523294A
- Authority
- CN
- China
- Prior art keywords
- annotation
- target
- pdf file
- file
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 5
- 238000000926 separation method Methods 0.000 title abstract description 7
- 238000000034 method Methods 0.000 claims abstract description 35
- 238000004590 computer program Methods 0.000 claims description 15
- 230000002452 interceptive effect Effects 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/169—Annotation, e.g. comment data or footnotes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention provides a PDF file-based comment separation processing method and a PDF file-based comment separation processing device, wherein the method comprises the following steps: adding a target annotation at a target position of the PDF file; saving the target annotation as an annotation file independent of the PDF file, wherein the annotation file comprises annotation content of the target annotation, the target position and a corresponding relation between the PDF file and the target annotation; and when the PDF file is reopened, loading the annotation content on the corresponding position of the PDF file according to the annotation file. In the invention, the annotation content is not written into the PDF file, but the annotation file is independently generated, so that the PDF file is not changed due to the addition of the annotation, thereby maintaining the reliability of the PDF file.
Description
Technical Field
The invention relates to the field of file processing, in particular to a PDF file-based comment separation processing method and device.
Background
Currently, paperless office has become a necessary trend, and PDF has become an important delivery format for digital examination as the most common printing format. When an engineer processes a file in a PDF format, annotation information needs to be added to the PDF file, however, in the existing annotation adding manner, annotation content needs to be written into the PDF file, which actually changes the original PDF file, for example, the MD5 value of the original PDF file is changed, thereby reducing the reliability of the original PDF file.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing annotation information, which are used for at least solving the problem that in the related art, when annotations are added to a PDF (portable document format) file, the annotation content needs to be written into the PDF file, so that the reliability of the PDF file is reduced.
According to an embodiment of the present invention, there is provided a method for processing batch annotation information, including: adding a target annotation at a target position of the PDF file; saving the target annotation as an annotation file independent of the PDF file, wherein the annotation file comprises annotation content of the target annotation, the target position and a corresponding relation between the PDF file and the target annotation; and when the PDF file is reopened, loading the annotation content on the corresponding position of the PDF file according to the annotation file.
Optionally, adding a target annotation to the target location of the PDF file includes: acquiring a first interactive operation when the cursor stays at the target position; and responding to the first interactive operation, and adding the target annotation on the target position.
Optionally, adding a target annotation to the target location of the PDF file includes: pre-stored information is selected from a knowledge base as or as part of the annotation content.
Optionally, when adding a target annotation to a target location of the PDF file, the method further includes: displaying an identifier of the target annotation on the target position; displaying an annotation list on a second display area outside the first display area for displaying the PDF file, wherein the annotation list comprises the annotation content corresponding to the mark of the target annotation.
Optionally, saving the target annotation as an annotation file independent of the PDF file comprises: uploading the annotation content of the target annotation and the target position to a database, and establishing a corresponding relation between the PDF file and the target annotation, wherein the corresponding relation is a matching relation between the file name of the PDF file under the relative path and the target annotation.
Optionally, when the PDF file is reopened, loading the annotation content on the corresponding location of the PDF file according to the annotation file, including: when the PDF file is reopened on a first terminal or a second terminal, matching a corresponding target annotation for the PDF file in the database according to the corresponding relation, wherein the first terminal is a terminal for adding the target annotation, and the second terminal is other terminals except the first terminal; and when the matching is successful, generating and displaying the annotation list in the second display area according to the annotation content of the target annotation stored in the database and the target position.
Optionally, the method further comprises: when the PDF file is transmitted, the PDF file and the target annotation are transmitted separately.
Optionally, the method further comprises: editing and modifying the annotation content in the annotation list, and synchronizing the edited and modified annotation content to the database.
According to another embodiment of the present invention, there is provided an apparatus for processing batch annotation information, including: the adding module is used for adding a target annotation at the target position of the PDF file; the storage module is configured to store the target annotation as an annotation file independent of the PDF file, where the annotation file includes annotation content of the target annotation, the target location, and a corresponding relationship between the PDF file and the target annotation; and the loading module is used for loading the annotation content on the corresponding position of the PDF file according to the annotation file when the PDF file is reopened.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
In the above embodiment of the present invention, the annotation content is not written in the PDF file, but the annotation file is generated separately, and therefore, the PDF file is not changed by adding the annotation, thereby maintaining the reliability of the PDF file.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method of processing annotation information according to an embodiment of the invention;
FIG. 2 is a flow chart of a method of processing annotation information according to another embodiment of the invention;
FIG. 3 is a schematic illustration of an annotation addition interface according to an embodiment of the invention;
FIG. 4 is a schematic diagram of an annotation list editing interface according to an embodiment of the invention;
fig. 5 is a schematic structural diagram of a device for processing annotation information according to an embodiment of the invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Example 1
In the present embodiment, a method for processing batch information is provided, and fig. 1 is a flowchart of a method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, adding a target annotation at the target position of the PDF file;
step S104, saving the target annotation as an annotation file independent of the PDF file, wherein the annotation file comprises annotation content of the target annotation, the target position and a corresponding relation between the PDF file and the target annotation;
and step S106, when the PDF file is reopened, loading the annotation content on the corresponding position of the PDF file according to the annotation file.
In step S102 of this embodiment, a first interaction operation is acquired when the cursor stays at the target position; and responding to the first interactive operation, and adding the target annotation on the target position.
In step S102 of this embodiment, the method may further include: pre-stored information is selected from a knowledge base as or as part of the annotation content.
In step S102 of this embodiment, the method may further include: displaying an identifier of the target annotation on the target position; displaying an annotation list on a second display area outside the first display area for displaying the PDF file, wherein the annotation list comprises the annotation content corresponding to the mark of the target annotation.
In step S104 of this embodiment, the annotation content and the target position of the target annotation may be uploaded to a database, and a corresponding relationship between the PDF file and the target annotation is established, where the corresponding relationship is a matching relationship between a file name of the PDF file in a relative path and the target annotation.
In step S106 of this embodiment, when the PDF file is reopened on a first terminal or a second terminal, matching a corresponding target annotation for the PDF file in the database according to the corresponding relationship, where the first terminal is a terminal to which the target annotation is added, and the second terminal is another terminal except the first terminal; and when the matching is successful, generating and displaying the annotation list in the second display area according to the annotation content of the target annotation stored in the database and the target position.
In this embodiment, the method may further include: when the PDF file is transmitted, the PDF file and the target annotation are transmitted separately.
In this embodiment, the method may further include: editing and modifying the annotation content in the annotation list, and synchronizing the edited and modified annotation content to the database.
In the embodiment of the invention, the annotation list can make the annotation more accurate by selecting the standard texts in the existing knowledge base, the annotation separation makes the annotation list file be separately copied to an engineer, the transmission efficiency is higher, and the MD5 value of the original PDF is not changed all the time during the annotation action, so that the annotation is persuasive.
In order to facilitate understanding of the technical solutions provided by the present invention, the following detailed description is given with reference to embodiments of specific application scenarios.
Example 2
The embodiment provides a method for adding comments to a drawing in a PDF format by taking a PDF graphic file as an example. In the embodiment, annotations such as rectangles, circles, ellipses, character annotations, remarks and the like can be created, the annotations are not written into the PDF file, but the position information and the content information of the annotations are written into the database, a matching relation is established, and when the PDF file is opened and the annotations are successfully matched, the annotation information in the database is displayed and loaded to the corresponding position of the PDF. Fig. 2 is a flowchart of the method of the present embodiment, and fig. 3 is a schematic interface diagram of the present embodiment. As shown in fig. 2 and fig. 3, the method of the present embodiment mainly includes the following steps:
step S201, selecting to add annotations at the right click problem in the currently opened PDF drawing.
Step S202, popping up an annotation information frame on the page.
In step S203, if the annotation that the user wishes to add is a normative article, the user clicks the knowledge base button in the annotation information box, and then a search dialog box pops up. If the user does not wish to add annotation content from the knowledge base, the annotation content can be entered in the annotation information box.
Step S204, inputting the retrieval condition in the search dialog box, clicking the search, and searching and displaying the items meeting the retrieval condition from the knowledge base.
Step S205, one item is selected from the displayed items and added into the annotation information frame.
Step S206, after confirming the annotation content in the annotation information frame (for example, clicking a blank), the annotation information frame is closed, the annotation content is uploaded to the database, and a matching relationship between the annotation and the PDF drawing is established in the database (for example, a matching relationship is established between the filename and the annotation under the file relative path). And simultaneously, displaying the annotation content in an annotation list.
As shown in fig. 3, in this embodiment, the annotation list is displayed separately from the PDF drawing file, and the annotation list is located on the right side of the main view of the PDF drawing file, but may be displayed in other positions.
In step S207, as shown in fig. 4, after entering the annotation list, the annotation information can be edited by double-clicking, and the modification performed on the annotation list is synchronized to the database.
And step S208, matching the annotations when the PDF file added with the annotations is closed and then reopened, and loading the annotation information in the database into an annotation list of the PDF when the matching is successful. If a matching relationship is established between the filenames and the annotations in the relative path of the file in the step S206, if the filenames of the PDF drawings change, the matching cannot be successful, and the annotations cannot be displayed (the relative path points to the top three levels of directories, and the names of the middle two levels of directories are interchanged and can also be successfully matched).
In this embodiment, the annotation created on the PDF can be separately generated into an annotation file without changing the PDF drawing, and the annotation file can be separately transmitted and displayed on another terminal. The annotation list can enable annotation to be more accurate by selecting the standard texts in the existing knowledge base, the annotation separation enables the annotation list file to be separately copied to an engineer, the transmission efficiency is higher, and the MD5 value of the original PDF is not changed all the time in the annotation action, so that the annotation is more persuasive.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 3
In this embodiment, a device for processing batch annotation information is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. As used below, the terms "module" and "unit" may implement a combination of software and/or hardware of predetermined functions. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a structure of an apparatus for processing annotation information according to an embodiment of the present invention, and as shown in fig. 4, the apparatus includes an adding module 10, a saving module 20, and a loading module 30.
An adding module 10, configured to add a target annotation at a target position of a PDF file;
a saving module 20, configured to save the target annotation as an annotation file independent of the PDF file, where the annotation file includes annotation content of the target annotation, the target location, and a corresponding relationship between the PDF file and the target annotation;
and the loading module 30 is configured to load the annotation content in the corresponding position of the PDF file according to the annotation file when the PDF file is reopened.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 4
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, adding a target annotation at the target position of the PDF file;
s2, saving the target annotation as an annotation file independent of the PDF file, wherein the annotation file comprises annotation content of the target annotation, the target position and a corresponding relation between the PDF file and the target annotation;
s3, when the PDF file is reopened, loading the annotation content on the corresponding position of the PDF file according to the annotation file.
In this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, which can store computer programs.
Example 5
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, adding a target annotation at the target position of the PDF file;
s2, saving the target annotation as an annotation file independent of the PDF file, wherein the annotation file comprises annotation content of the target annotation, the target position and a corresponding relation between the PDF file and the target annotation;
s3, when the PDF file is reopened, loading the annotation content on the corresponding position of the PDF file according to the annotation file.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.
Claims (11)
1. A processing method of batch note information is characterized by comprising the following steps:
adding a target annotation at a target position of the PDF file;
saving the target annotation as an annotation file independent of the PDF file, wherein the annotation file comprises annotation content of the target annotation, the target position and a corresponding relation between the PDF file and the target annotation;
and when the PDF file is reopened, loading the annotation content on the corresponding position of the PDF file according to the annotation file.
2. The method of claim 1, wherein adding a target annotation to a target location of a PDF file comprises:
acquiring a first interactive operation when the cursor stays at the target position;
and responding to the first interactive operation, and adding the target annotation on the target position.
3. The method of claim 2, wherein adding a target annotation to a target location of a PDF file comprises:
pre-stored information is selected from a knowledge base as or as part of the annotation content.
4. The method of claim 1, wherein when adding a target annotation at a target location of a PDF file, the method further comprises:
displaying an identifier of the target annotation on the target position;
displaying an annotation list on a second display area outside the first display area for displaying the PDF file, wherein the annotation list comprises the annotation content corresponding to the mark of the target annotation.
5. The method of claim 1, wherein saving the target annotation as an annotation file separate from the PDF file comprises:
uploading the annotation content of the target annotation and the target position to a database, and establishing a corresponding relation between the PDF file and the target annotation, wherein the corresponding relation is a matching relation between the file name of the PDF file under the relative path and the target annotation.
6. The method according to claim 1, wherein when the PDF file is reopened, loading the annotation content on the corresponding position of the PDF file according to the annotation file comprises:
when the PDF file is reopened on a first terminal or a second terminal, matching a corresponding target annotation for the PDF file in the database according to the corresponding relation, wherein the first terminal is a terminal for adding the target annotation, and the second terminal is other terminals except the first terminal;
and when the matching is successful, generating and displaying the annotation list in the second display area according to the annotation content of the target annotation stored in the database and the target position.
7. The method of claim 1, further comprising:
when the PDF file is transmitted, the PDF file and the target annotation are transmitted separately.
8. The method of claim 4, further comprising:
editing and modifying the annotation content in the annotation list, and synchronizing the edited and modified annotation content to the database.
9. An apparatus for processing comment information, comprising:
the adding module is used for adding a target annotation at the target position of the PDF file;
the storage module is configured to store the target annotation as an annotation file independent of the PDF file, where the annotation file includes annotation content of the target annotation, the target location, and a corresponding relationship between the PDF file and the target annotation;
and the loading module is used for loading the annotation content on the corresponding position of the PDF file according to the annotation file when the PDF file is reopened.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 8 when executed.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010329251.XA CN111523294A (en) | 2020-04-23 | 2020-04-23 | PDF file-based comment separation processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010329251.XA CN111523294A (en) | 2020-04-23 | 2020-04-23 | PDF file-based comment separation processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111523294A true CN111523294A (en) | 2020-08-11 |
Family
ID=71904252
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010329251.XA Pending CN111523294A (en) | 2020-04-23 | 2020-04-23 | PDF file-based comment separation processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111523294A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114707182A (en) * | 2022-05-30 | 2022-07-05 | 天津联想协同科技有限公司 | Online document annotation authority control method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103761218A (en) * | 2014-01-27 | 2014-04-30 | 上海维响信息科技有限公司 | Method for annotating and commenting electronic document on computer |
US20170308511A1 (en) * | 2016-04-21 | 2017-10-26 | Arivis Ag | File format agnostic document viewing, link creation and validation in a multi-domain document hierarchy |
CN108776651A (en) * | 2018-06-08 | 2018-11-09 | 北京厚德思成科技有限公司 | The annotation processing method and system of pdf document |
-
2020
- 2020-04-23 CN CN202010329251.XA patent/CN111523294A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103761218A (en) * | 2014-01-27 | 2014-04-30 | 上海维响信息科技有限公司 | Method for annotating and commenting electronic document on computer |
US20170308511A1 (en) * | 2016-04-21 | 2017-10-26 | Arivis Ag | File format agnostic document viewing, link creation and validation in a multi-domain document hierarchy |
CN108776651A (en) * | 2018-06-08 | 2018-11-09 | 北京厚德思成科技有限公司 | The annotation processing method and system of pdf document |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114707182A (en) * | 2022-05-30 | 2022-07-05 | 天津联想协同科技有限公司 | Online document annotation authority control method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10635744B2 (en) | File format agnostic document viewing, link creation and validation in a multi-domain document hierarchy | |
US10169311B2 (en) | Workflow system and method for creating, distributing and publishing content | |
CN108762743B (en) | Data table operation code generation method and device | |
US7325188B1 (en) | Method and system for dynamically capturing HTML elements | |
CN105511873B (en) | User interface control display method and device | |
US20060080603A1 (en) | Method and apparatus for utilizing an object model to manage document parts for use in an electronic document | |
US20050210392A1 (en) | Document creating method, document creating apparatus, program, recording medium, and document data structure | |
CN108536745B (en) | Shell-based data table extraction method, terminal, equipment and storage medium | |
EP3488356A1 (en) | Cloud content states determination logic | |
CN110109981B (en) | Information display method and device for work queue, computer equipment and storage medium | |
CN110688145B (en) | Android MVP code automatic generation method and device, medium and electronic equipment | |
US8296399B2 (en) | Connecting galleries to dynamic server-hosted content | |
CN110941779A (en) | Page loading method and device, storage medium and electronic equipment | |
CN112905178A (en) | Method, device, equipment and medium for generating business function page | |
CN111523294A (en) | PDF file-based comment separation processing method and device | |
CN113268232B (en) | Page skin generation method and device and computer readable storage medium | |
JP2004110427A (en) | Web contents conversion method and system | |
CN116127935A (en) | Document creation method, device, electronic equipment and storage medium | |
JP2010108453A (en) | Document component management device and method, and program | |
CN108334621B (en) | Database operation method, device, equipment and computer readable storage medium | |
WO2021057695A1 (en) | Information importing method and apparatus | |
CN108334394B (en) | Multi-language processing method and device for basic data of multi-language software system | |
CN113051376A (en) | Information processing apparatus, recording medium, and information processing method | |
CN112711435A (en) | Version updating method, version updating device, electronic equipment and storage medium | |
JP2005107635A (en) | Electronic form input system, method and program, and medium |
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: 20200811 |