VeryPDF PDF Password Remover provides two versions: the standard version named VeryPDF PDF Password Remover which contains a GUI application as well as a command line application; and the Pro version named VeryPDF PDF Password Remover COM which is designed for developer users. This page aims at showing you how to use the COM version.
VeryPDF PDF Password Remover COM is specially designed for software programmer to quickly add a PDF password remover utility to your application.
A sample program is provided below to illustrate proper usage of VeryPDF PDF Password Remover COM. Removing PDF password is as simple as filling out a few properties.
Operating Systems: all Windows platforms, like Windows 2000, XP, Vista, 7, 8,10, 11, Windows Server 2003, 2008, 2008 R2 and later systems, both 32 bit and 64 bit.
The following programming languages are supported: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.
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <windowsx.h>
__declspec(dllexport)
long WINAPI veryDecryptPDF(const char * inFileName, const char *outFileName, const char *OwnerPassword, const char *UserPassword);
__declspec(dllexport)
BOOL WINAPI veryIsPDFEncrypted(const char * inFileName);
void GetModulePath(char *out_path,char *in_name)
{
char *p;
GetModuleFileName(NULL,out_path,256);
p =strrchr(out_path,'\\');
p[1]=0;
strcat(out_path,in_name);
}
void main()
{
char srcpath[_MAX_PATH]
char despath[_MAX_PATH];>
memset(srcpath,0,_MAX_PATH);
memset(despath,0,_MAX_PATH);
//example 1
GetModulePath(srcpath,"test1.pdf");
GetModulePath(despath,"test1Decrypt.pdf");
if(veryIsPDFEncrypted(srcpath))
veryDecryptPDF(srcpath,despath,"owner","user");
//example 2
GetModulePath(srcpath,"test2.pdf");
GetModulePath(despath,"test2Decrypt.pdf");
if(veryIsPDFEncrypted(srcpath))
veryDecryptPDF(srcpath,despath,"owner","user");
}
Private Sub Command1_Click()
Dim result
result = veryIsPDFEncrypted("test1.pdf")
If result = 1 Then
result = veryDecryptPDF("test1.pdf", "test1Decrypt.pdf", "owner", "user")
End If
result = veryIsPDFEncrypted("test2.pdf")
If result = 1 Then
result = veryDecryptPDF("test2.pdf", "test2Decrypt.pdf", "owner", "user")
End If
End Sub
<%
dim oTest
dim ret
Set oTest = Server.CreateObject("DecryptPDFOCX.CDecryptPDF")
Response.write "Create Object Success!"
ret = oTest.veryIsPDFEncryptedEx("C:\wwwhome\test1.pdf")
if ret = 1 then
ret = oTest.veryDecryptPDFEx("C:\wwwhome\test1.pdf",
"C:\wwwhome\test1_Decrypted.pdf","owner","user")
if ret = 0 then
Response.write "Decrypt PDF file Failer!"
else
Response.write "Decrypt PDF file Success!"
end if
end if
%>
If you want to download or purchase this COM version, please enter Try and Buy page.