Question:I have to generate roughly 18,000 PDF that contain sensitive information. The PDF will be served up through a web application to the end users. Obviously, some users need to see more reports than others. The two ways I'm thinking of serving up the PDF are physically saving each PDF to a directory under the web application or storing the PDF in the database. The PDF need to be viewable only by those authorized and I don't want users to guess URLs to see other users information. But I'm a little hesitant to put this information in a database. Is one way preferred over the other to secure PDF from ASP?
Answer: According to your needs, you can secure PDF in batch. Software VeryPDF Encrypt PDF COM can help encrypt PDF with open password and master password. By this software, you can set owner password to PDF and disable printing, editing, coping, and changing options. And this COM version allows you to call this software from C#, VB .NET, MS Visual Basic, Borland Delphi, VBA (MS Office products such as Access) and C++ via COM, C and C++ via native C. If you do not need to use the COM version there will also command line version available which also allows you to secure PDF in batch. Please check more detail information on homepage, in the following part, let us check how to use this software.
- Here I will take the COM version for examples. If you need to download command line version, GUI version, there is also one available for you.
- When downloading finishes, there will be a zip file. Please extract it to some folder then you can find related elements and help documents. When you use this software, please refer to the usage and help document.
Step 2 Secure PDF in batch from ASP.
- Functions: long WINAPI veryEncryptPDF(const char * inFileName, const char *outFileName, long EnctyptLen, long permission, const char *OwnerPassword, const char *UserPassword)
Description:This function can be used to encrypt your PDF files with various options.
- When you need to call this software to secure PDF from ASP code, please refer to the following code template.
Public Function veryEncryptPDFEx(ByVal inFileName As String,
ByVal outFileName As String, EnctyptLen As Long, permission As Long,
ByVal OwnerPassword As String, ByVal UserPassword As String) As Long
veryEncryptPDFEx = veryEncryptPDF(inFileName, outFileName,
EnctyptLen, permission, OwnerPassword, UserPassword
- When you call this software from command line option, the following parameters will be helpful for you:
-w : owner password.
-p : permission print.
-c : permission copy.
-m : permission modify.
-n : enable adding and changing text notes and AcroForm fields.
-e [128 or 40 ] : set encrypt level.
I can not list all of the functions and parameters here. If you need to check more, please visit homepage. During the using, if you have any question, please contact us as soon as possible.