Method for controlling limited access of PDF file
Technical Field
The invention relates to the field of computer software application, in particular to a method for controlling limited access of a PDF file.
Background
PDF is a Portable Document Format, which is an electronic file Format. It has many advantages over other electronic document formats, such as file format independence from the operating system platform, i.e., PDF files are common whether in the Windows or Unix operating systems. This feature makes it an ideal document format for electronic document distribution and digital information dissemination over the Internet.
The limited control of the PDF file is generally realized in a file encryption mode, and the encrypted file can be authorized one by one machine, and the copying and printing are prohibited. The realization needs to set a password for each PDF file, the password is bound with computer hardware of a user, the setting is complex, and the operation is inconvenient. Therefore, the issuing efficiency of the PDF files cannot be guaranteed, and the text control personnel are often busy and burnt, but cannot ensure that each process technician uses the files with correct versions, which directly affects the product quality index.
Disclosure of Invention
The invention aims to provide a method for controlling the limited access of a PDF file, which can at least solve part of defects in the prior art.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions: a method for controlling PDF file limited access includes network client end and network server end,
the system also comprises an authority control module used for distributing a plurality of different authorities;
uploading a PDF file to be set with authority to the network server side in the network client side for authority setting;
then the network client side acquires the PDF file after the authority setting is finished;
the network client comprises a browser for a text control person to obtain a PDF file, and the authority control module receives the PDF file which is transmitted by the network server and is subjected to authority setting and then allocates the PDF file to different access addresses of the browser according to different authorities.
Further, before uploading the PDF with the authority to be set, registering different authority information of the PDF file with the authority to be set through an information registration module; the information registration module sends out an instruction that the network client uploads a PDF file to be set with authority to the network server according to different registered authority information, and sends out an instruction that the authority control module needs to distribute different authorities.
Furthermore, the plurality of different authorities distributed by the authority control module comprise an no-authority instruction, a download authority instruction and a browse authority instruction; and the no-permission instruction, the downloading permission instruction and the browsing permission instruction are respectively distributed to different access addresses of the browser.
Further, setting the authority at the network server side specifically includes: and setting a download file matched with the download permission instruction and setting a browsing file matched with the browsing permission instruction.
Further, the step of obtaining the download file includes: s1, storing the uploaded PDF file to be set with authority in the network server; s2, decomposing the PDF file to be set with authority at the network server end; s3, writing the data into the database after decomposition; and S4, adding the watermark in the database and providing a download address.
Further, the information registered by the information registration module is a path, a file name, an uploading user and uploading time of the file, and the path, the file name, the uploading user and the uploading time of the file are stored in a database.
Further, a SWFTOOLS tool is adopted for converting the PDF file into the SWF file.
Further, the step of acquiring the browsing file includes: s10, converting the uploaded PDF file to be set with authority into an SWF file at the network server; s20, the conversion is completed and then the conversion is stored in the network server; s30, decomposing the SWF file at the network server end; and S40, writing the data into the database after the decomposition is finished, and providing a browsing address.
Further, in the step S10, the conversion method specifically includes: and the PDF file to be set with the authority is clicked by the control personnel and then converted, or the conversion is started after the timing time is reached at the network server side.
Further, the virtual printer is adopted to access the address of the browser allocated by the download authority instruction.
Compared with the prior art, the invention has the beneficial effects that:
1. different authorities are distributed through the authority control module, and a series of problems that PDF file distribution efficiency is low, different types of user authorities are difficult to control, version errors are easy to occur and the like in the past are effectively solved.
2. The method saves human resources, reduces communication links, reduces cost, avoids version errors and provides guarantee for the safety of the files.
Drawings
Fig. 1 is a work flow diagram of a method for controlling a PDF file to have limited access according to an embodiment of the present invention;
fig. 2 is a flowchart of a step of acquiring a download file of a method for controlling a PDF file to have limited access according to an embodiment of the present invention;
fig. 3 is a flowchart of a step of fetching a browsing file of a method for controlling restricted access to a PDF file according to an embodiment of the present invention;
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a method for controlling a PDF file to have a limited access, including a network client, a network server, and an authority control module for allocating a plurality of different authorities; uploading a PDF file to be set with authority to the network server side in the network client side for authority setting; then the network client side acquires the PDF file after the authority setting is finished; the network client comprises a browser for a text control person to obtain a PDF file, and the authority control module receives the PDF file which is transmitted by the network server and is subjected to authority setting and then allocates the PDF file to different access addresses of the browser according to different authorities. In the method, different authorities are distributed through the authority control module, so that a series of problems that the conventional PDF file distribution efficiency is low, different types of user authorities are difficult to control, version errors are easy to occur and the like are effectively solved, and employees can download the PDF files with correct authorities through a browser.
The following are specific examples:
as an optimization scheme of the embodiment of the invention, before the PDF of the authority to be set is uploaded, different authority information of the PDF file of the authority to be set is registered through an information registration module; the information registration module sends out an instruction that the network client uploads a PDF file to be set with authority to the network server according to different registered authority information, and sends out an instruction that the authority control module needs to distribute different authorities. The method comprises the steps that a control manager registers information of a publishable technical file, rule types, product types and the like are required to be registered, the rule types and the product types form two-level pull-down menus, each menu corresponds to two groups, one is a management group, the authority is set to be downloadable, the other is an operation group, the authority is set to be browseable on line, the functions of the groups can be cancelled, and the authority setting is increased according to actual requirements.
As an optimization scheme of the embodiment of the invention, a plurality of different authorities distributed by the authority control module comprise an no-authority instruction, a download authority instruction and a browse authority instruction; and the no-permission instruction, the downloading permission instruction and the browsing permission instruction are respectively distributed to different access addresses of the browser. All employees can access the PDF file on the browser according to the different authority instructions according to the own authority. For example, if the command is an unauthorized command, no relevant content can be obtained, if the command is a download permission command, the download can be performed, and if the command is a browse permission command, the user can only read on the internet.
Further optimizing the above scheme, performing permission setting at the network server side specifically includes: and setting a download file matched with the download permission instruction and setting a browsing file matched with the browsing permission instruction. Each different instruction corresponds to a different authority file.
Further optimizing the above scheme, referring to fig. 2, the step of obtaining the download file includes: s1, storing the uploaded PDF file to be set with authority in the network server; s2, decomposing the PDF file to be set with authority at the network server end; s3, writing the data into the database after decomposition; and S4, adding the watermark in the database and providing a download address. When a controller clicks a PDF file link or the PDF file link is not clicked, after the PDF file link is timed for 10 minutes, the PDF file is converted into an SWF format file on a server, the file can display vector graphics in a webpage with a small resource occupation amount, if the PDF file has pictures or special fonts, rendering multiples are set to ensure that the picture of the converted file is not distorted, the converted SWF format file is named again according to a conversion timestamp and placed under another path of the server, and the path is a downloading address.
According to the scheme, the information registered by the information registration module is the path, the file name, the uploading user and the uploading time of the file, and the path, the file name, the uploading user and the uploading time of the file are stored in a database. The file handle is set for the file by the system for uniquely identifying the PDF file, and information such as a path, a file name, an uploading user, uploading time and the like of the PDF file is recorded.
Further optimizing the scheme, the PDF file is converted into the SWF file by adopting a SWFTOOLS tool. And the webpage loaded with the SWF file at the network server side is directly accessed by online browsing without setting a designated page number flash.
As an optimization scheme of the embodiment of the present invention, please refer to fig. 3, where the step of obtaining the browsing file includes: s10, converting the uploaded PDF file to be set with authority into an SWF file at the network server; s20, the conversion is completed and then the conversion is stored in the network server; s30, decomposing the SWF file at the network server end; and S40, writing the data into the database after the decomposition is finished, and providing a browsing address. If the user does not have the right to browse the document, no document path is provided for the user, and the user is prompted to have no right to browse the information; if the user has online browsing authority, the browser is used for directly loading the SWF format document, and the file path of the file cannot be disclosed because the SWF document is on the network server, so that the downloading of the user is controlled; if the user has the downloading authority, reading information such as a file path and the like from the database, finding the uploaded PDF file, watermarking the file, carrying information such as an IP address, a user name, current time and the like of a user client, and providing the address of the processed PDF file to the client for the user to download.
As the optimization scheme of the embodiment of the invention, the virtual printer can be adopted to access the address of the browser distributed by the download permission instruction, and the operation is convenient and quick.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.