Detailed Description
The following description of the embodiments of the present invention 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 invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1, a schematic flow chart of a method for pasting pages across documents according to an embodiment of the present invention is provided. The method for pasting the page across the document can be operated in a terminal or a server, wherein the terminal can be electronic equipment such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and the like. The server may be an independent server or a server cluster formed by a plurality of servers. Specifically, the method for pasting pages across documents is applied to PDF editing software, wherein the PDF editing software can be configured in a terminal or a server, and the documents are PDF documents. As shown in fig. 1, the method may include steps S101 to S104.
S101, if the selected page is detected to exist, identifying whether an action of dragging the selected page exists or not; and taking the selected page as a page to be copied.
Specifically, the action of dragging the selected page includes an action of dragging the selected page by long-pressing by a mouse and an action of dragging the selected page by long-pressing by touching. Therefore, in this step, it is necessary to identify whether there is an action of clicking the mouse to drag the selected page for a long time or whether there is an action of clicking the mouse to drag the selected page for a long time; and taking the selected page as a page to be copied. In an embodiment, before step S101 is performed, that is, before identifying whether there is an action of dragging the selected page, it is required to detect whether there is a selected page in the document, and if it is detected that there is a selected page, a next step may be performed, that is, automatically identifying whether there is an action of dragging the selected page, where the document is a PDF document.
S102, if there is an action of dragging the page to be copied, detecting whether the page to be copied is dragged to a preset position of the document to be pasted according to a preset rule.
If the action of dragging the page to be copied is identified, whether the page to be copied is dragged to a preset position of the document to be pasted needs to be further detected according to a preset rule, specifically, whether an original document corresponding to the page to be copied and a document where the action of dragging the page to be copied is currently located are different documents needs to be judged according to the preset rule, if the document is the different documents, it is indicated that the document is the document to be pasted, whether the action of dragging the page to be copied is currently located at the preset position of the document to be pasted needs to be further judged, and the preset position comprises an icon of the document to be pasted and a tag page of the document to be pasted.
Therefore, in an embodiment, the preset position is an icon of the document to be pasted, and the step of detecting whether the page to be copied is dragged to the preset position of the document to be pasted according to the preset rule includes: and detecting whether the page to be copied is dragged to the icon of the document to be pasted according to a preset rule. Specifically, the detecting whether the page to be copied is dragged to the icon of the document to be pasted according to the preset rule includes an icon detection method. The icon detection method is shown in fig. 2, i.e., step S102 includes sub-steps S102a to S102c. S102a, judging whether the document dragged to the page to be copied is a document to be pasted or not; s102b, if the document to which the page to be copied is dragged is a document to be pasted, judging whether the page to be copied is dragged to an icon of the document to be pasted; s102c, if the page to be copied is dragged to the icon of the document to be pasted, judging that the page to be copied is dragged to the preset position of the document to be pasted. And the to-be-copied page can be directly and automatically opened by identifying that the to-be-copied page is dragged to the icon of the to-be-pasted document, so that the to-be-copied page can be directly dragged into the to-be-pasted document without opening the to-be-pasted document in advance, the purpose of automatically pasting and copying the page between different documents by utilizing the dragging action can be realized, and the page comprises a plurality of pages. Therefore, the implementation of the embodiment is beneficial to the operation smoothness of the whole cross-document copy and paste page and greatly improves the experience effect of the user.
In another embodiment, the preset position is a tab page of the document to be pasted, and the step of detecting whether the page to be copied is dragged to the preset position of the document to be pasted according to a preset rule includes: and detecting whether the page to be copied is dragged to a label page of the document to be pasted according to a preset rule. Specifically, the detecting whether the page to be copied is dragged to the tab page of the document to be pasted according to the preset rule includes a tab page detection method. The tag page detection method, as shown in fig. 3, i.e., step S102 includes sub-steps S102a, S102d, and S102e. S102a, judging whether the document dragged to the page to be copied is a document to be pasted or not; s102d, if the document to which the page to be copied is dragged is the document to be pasted, judging whether the page to be copied is dragged to a tag page of the document to be pasted; s102e, if the page to be copied is dragged to the label page of the document to be pasted, judging that the page to be copied is dragged to the preset position of the document to be pasted. And the page to be copied can be directly jumped to the page of the document to be pasted by identifying that the page to be copied is dragged to the tag page of the document to be pasted, so that the page to be copied is conveniently and directly dragged into the document to be pasted, the purpose of realizing automatic page pasting and copying by utilizing the dragging action among different documents can be realized, and the page comprises a plurality of pages. When the current position of the action of dragging the page to be copied is the label page of the document to be pasted, the document to be pasted is indicated to be opened, and at the moment, the user only needs to jump into the page of the document to be pasted. Therefore, the implementation of the embodiment is beneficial to the operation smoothness of the whole cross-document copy and paste page and greatly improves the experience effect of the user.
In an embodiment, the determining whether the document to which the page to be copied is dragged is a document to be pasted includes a document determining method. The document judging method, as shown in fig. 4, i.e., step S102a includes sub-steps S102a1 to S102a5. S102a1, acquiring a page index of the page to be copied and the number of the document corresponding to the page to be copied, wherein the number of the document corresponding to the page to be copied is used as a first number; s102a2, acquiring the number of the document to which the page to be copied is dragged, wherein the number of the document to which the page to be copied is dragged is used as a second number; s102a3, comparing whether the first number and the second number are the same number; s102a4, if the numbers are not the same, judging that the document to which the page to be copied is dragged is the document to be pasted; and S102a5, if the numbers are the same, judging that the document where the action of dragging the page to be copied is currently located is the original corresponding document.
Specifically, in step S102a1, after the page to be copied is selected, the page index number of the page to be copied and the number of the document corresponding to the page to be copied are directly obtained, where each PDF document has a unique corresponding number, and the number of the document corresponding to the page to be copied is taken as the first number.
Specifically, in step S102a2, when the action of dragging the page to be copied is located at a corresponding position of a document, the number of the document where the action of dragging the page to be copied is currently located is obtained, where the number of the document where the action of dragging the page to be copied is currently located is taken as the second number. For example, if the action is located on a tab page of a document, the number of the document may be directly obtained, or if the action is located on a page of a document, the number of the document may be directly obtained, and the corresponding position of the document is not specifically limited.
Specifically, in step S102a3, each PDF document has a unique corresponding number, and when the number of the original document corresponding to the page to be copied is inconsistent with the number of the document where the action of dragging the page to be copied is currently located, it indicates that the document corresponding to the original document is not the same document where the action of dragging the page to be copied is currently located, and it indicates that the action of dragging the page to be copied performs a function of copying and pasting pages across documents.
And S103, if the page to be copied is dragged to a preset position of the document to be pasted, opening the document to be pasted.
Specifically, as shown in step S102, when the page to be copied is dragged to the preset position of the document to be pasted, the document to be pasted is directly opened or directly jumped into the document to be pasted to open the document to be pasted, so that the page to be copied is dragged into the document to be pasted.
S104, pasting the page to be copied into the document to be pasted.
In an embodiment, the pasting the page to be copied into the document to be pasted includes a page pasting method. The page pasting method, as shown in fig. 5, i.e., step S102 includes sub-steps S104a to S104c. S104a, detecting whether the dragging action of the page to be copied is finished in real time; s104b, if the fact that the dragging action of the page to be copied is finished is detected, acquiring the position where the page to be copied is currently dragged into the document to be pasted so as to determine the pasting area of the page to be copied; and S104c, automatically pasting the page to be copied to the pasting area.
Specifically, before the to-be-copied page is directly pasted into the to-be-pasted document, whether the dragging action of the to-be-copied page is finished is required to be detected in real time, if so, the current position of the to-be-copied page to be dragged into the to-be-pasted document is obtained to determine the pasting area of the to-be-copied page, and when the pasting area of the to-be-copied page is determined, the to-be-copied page can be directly and automatically pasted on the pasting area.
In the embodiment, the operation of copying and pasting the page between different documents can be directly completed by identifying and detecting the action of dragging the page, and the operation of copying and pasting the page across the document can be completed without a plurality of steps like the operation of copying and pasting the page across the document in the prior art. The embodiment of the invention can effectively solve the problems of excessively complex and troublesome operation flow of pasting pages between different documents in the prior art, solves the problems of low smoothness, poor user experience effect and the like caused by excessively complex and troublesome operation, can effectively improve the efficiency of pasting the documents by users, and greatly improves the user experience effect.
Referring to FIG. 6, a schematic block diagram of anapparatus 100 for pasting pages across documents according to an embodiment of the present invention is shown. As shown in FIG. 6, theapparatus 100 for pasting pages across documents corresponds to the method for pasting pages across documents shown in FIG. 1. Thedevice 100 for pasting the page across the document includes a unit for executing the method for pasting the page across the document, and thedevice 100 for pasting the page across the document can be configured in a terminal or a server, wherein the terminal can be an electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and the like; the server may be an independent server or a server cluster formed by a plurality of servers. Specifically, thedevice 100 for pasting pages across documents may be configured in PDF editing software, which may be configured in a terminal or a server, where the documents are PDF documents. Referring to fig. 6, theapparatus 100 for pasting pages across documents includes anaction recognition unit 101, aposition detection unit 102, adocument opening unit 103, and apage pasting unit 104.
Theaction recognition unit 101 is configured to recognize whether an action of dragging the selected page exists if the selected page is detected to exist; and taking the selected page as a page to be copied.
Specifically, in one embodiment, theaction recognition unit 101 is configured to recognize whether there is an action of dragging the selected page, and before further need to detect whether there is a selected page in the document, if yes, automatically recognize whether there is an action of dragging the selected page; the document is a PDF document, and the action of dragging the selected page comprises the action of dragging the selected page by long-pressing a mouse and the action of dragging the selected page by long-pressing a touch.
Theposition detecting unit 102 is configured to detect, if there is an action of dragging the page to be copied, whether the page to be copied is dragged to a preset position of the document to be pasted according to a preset rule.
In one embodiment, as shown in fig. 7, theposition detection unit 102 includes a firstposition detection subunit 1021 and a secondposition detection subunit 1022. The firstposition detecting subunit 1021 includes adocument judging unit 102a, anicon judging unit 102b, and afirst judging unit 102c. Thedocument judging unit 102a is configured to judge whether the document to which the page to be copied is dragged is a document to be pasted; theicon judging unit 102b judges whether the page to be copied is dragged to an icon of the document to be pasted if the document to be copied is the document to be pasted; the first determiningunit 102c is configured to determine that the page to be copied is dragged to a preset position of the document to be pasted if the page to be copied is dragged to the icon of the document to be pasted.
In another embodiment, as shown in fig. 8, the secondposition detection subunit 1022 includes adocument determination unit 102a, a tabpage determination unit 102d, and asecond determination unit 102e. Thedocument judging unit 102a is configured to judge whether the document to which the page to be copied is dragged is a document to be pasted; a tagpage judging unit 102d, configured to judge whether the page to be copied is dragged to a tag page of the document to be pasted if the document to which the page to be copied is dragged is the document to be pasted; and the second determiningunit 102e is configured to determine that the page to be copied is dragged to a preset position of the document to be pasted if the page to be copied is dragged to the tab page of the document to be pasted.
In one embodiment, as shown in fig. 9, thedocument judging unit 102a includes a first number acquiring unit 102a1, a second number acquiring unit 102a2, a comparing unit 102a3, a first judging subunit 102a4, and a second judging subunit 102a5. The first number obtaining unit 102a1 is configured to obtain a page index of the page to be copied and a number of a document corresponding to the page to be copied, where the number of the document corresponding to the page to be copied is taken as a first number; a second number obtaining unit 102a2, configured to obtain a number of a document where the action of dragging the page to be copied is currently located, where the number of the document where the action of dragging the page to be copied is currently located is taken as a second number; a comparing unit 102a3, configured to compare whether the first number and the second number are the same number; the first determining subunit 102a4 is configured to determine that the document in which the action of dragging the page to be copied is currently located is a document to be pasted if the actions are not the same number; the second determining subunit 102a5 is configured to determine, if the numbers are the same, that the document in which the action of dragging the page to be copied is currently located is the original corresponding document.
Thedocument opening unit 103 is configured to open the document to be pasted if the page to be copied is dragged to a preset position of the document to be pasted.
Thepage pasting unit 104 is configured to paste the page to be copied into the document to be pasted.
In an embodiment, as shown in fig. 10, thepage pasting unit 104 includes anaction detecting unit 104a, aposition acquiring unit 104b, and apage pasting subunit 104c. Theaction detecting unit 104a is configured to detect in real time whether the action of dragging the page to be copied is ended; theposition obtaining unit 104b obtains a position of the page to be copied, which is currently dragged into the document to be pasted, so as to determine a pasting area of the page to be copied if the action of dragging the page to be copied is detected to be ended; and thepage pasting subunit 104c is configured to automatically paste the page to be copied onto the pasting area.
It should be noted that, as those skilled in the art can clearly understand, the specific implementation process and effects of theabove device 100 for pasting pages across documents and each unit may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and brevity of description, the description is omitted here.
The system described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 11.
Referring to fig. 11, a schematic block diagram of a computer device according to an embodiment of the present invention is shown. Thecomputer device 600 may be a terminal or a server, where the terminal may be an electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, and a personal digital assistant. The server may be an independent server or a server cluster formed by a plurality of servers.
With reference to FIG. 11, thecomputer device 600 includes aprocessor 602, memory and anetwork interface 605 connected by asystem bus 601, wherein the memory may include anon-volatile storage medium 603 and aninternal memory 604.
Thenon-volatile storage medium 603 may store anoperating system 6031 and acomputer program 6032. Thecomputer program 6032 includes program instructions that, when executed, cause theprocessor 602 to perform a method of pasting pages across documents.
Theprocessor 602 is used to provide computing and control capabilities to support the operation of theoverall computer device 600.
Theinternal memory 604 provides an environment for the execution of acomputer program 6032 in thenon-volatile storage medium 603, whichcomputer program 6032, when executed by theprocessor 602, causes theprocessor 602 to perform a method of pasting pages across documents.
Thenetwork interface 605 is used for network communication with other devices. Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of a portion of the architecture relevant to the present application and is not limiting of thecomputer device 600 to which the present application applies, and that aparticular computer device 600 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
Wherein theprocessor 602 is configured to execute acomputer program 6032 stored in a memory to implement the steps of: if the selected page is detected to exist, identifying whether an action of dragging the selected page exists or not; the selected page is used as a page to be copied; if the action of dragging the page to be copied exists, detecting whether the page to be copied is dragged to a preset position of a document to be pasted or not according to a preset rule; if the page to be copied is dragged to a preset position of the document to be pasted, opening the document to be pasted; and pasting the page to be copied into the document to be pasted.
In an embodiment, the preset position includes a document icon, and when implementing the step of detecting whether the page to be copied is dragged to the preset position of the document to be pasted according to the preset rule, theprocessor 602 specifically implements the following steps: judging whether the document dragged to the page to be copied is a document to be pasted or not; if the document to which the page to be copied is dragged is the document to be pasted, judging whether the page to be copied is dragged to an icon of the document to be pasted; and if the page to be copied is dragged to the icon of the document to be pasted, judging that the page to be copied is dragged to the preset position of the document to be pasted.
In an embodiment, the preset position includes a document tag page, and when implementing the step of detecting whether the page to be copied is dragged to the preset position of the document to be pasted according to the preset rule, theprocessor 602 specifically implements the following steps: judging whether the document dragged to the page to be copied is a document to be pasted or not; if the document to which the page to be copied is dragged is the document to be pasted, judging whether the page to be copied is dragged to a tag page of the document to be pasted; if the page to be copied is dragged to the label page of the document to be pasted, judging that the page to be copied is dragged to the preset position of the document to be pasted; and the step of opening the document to be pasted comprises the following steps: and automatically jumping to the page of the document to be pasted.
In one embodiment, when the step of determining whether the document dragged by the page to be copied is a document to be pasted is implemented by theprocessor 602, the following steps are specifically implemented: acquiring a page index of the page to be copied and the number of the document corresponding to the page to be copied, wherein the number of the document corresponding to the page to be copied is used as a first number; acquiring the number of the document to which the page to be copied is dragged, wherein the number of the document to which the page to be copied is dragged is used as a second number; comparing whether the first number and the second number are the same number; and if the numbers are not the same, judging that the document to which the page to be copied is dragged is the document to be pasted.
In one embodiment, when implementing the step of pasting the page to be copied into the document to be pasted, theprocessor 602 specifically implements the following steps: detecting whether the dragging action of the page to be copied is finished or not in real time; if the fact that the action that the page to be copied is dragged is detected to be ended, acquiring the position where the page to be copied is currently dragged into the document to be pasted to determine the pasting area of the page to be copied; and automatically pasting the page to be copied onto the pasting area.
It should be appreciated that in embodiments of the present invention, theprocessor 602 may be a central processing unit (Central Processing Unit, CPU), theprocessor 602 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, wherein the storage medium is a storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a computer-readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program includes program instructions. The program instructions, when executed by a processor, cause the processor to perform the method of pasting pages across documents as described above.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, etc. which may store the program code.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the system of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.