Image Viewer CP Gold SDK ActiveX

Image Viewer CP Gold SDK ActiveX

Platform : Windows 10, Windows 8, Vista, Windows 7, XP

For Windows Developers who need to PDF TIFF Viewer and Image Viewer , plus support TIFF with WANG Annotations, securing a PDF document, add annotation with PDF for C , C#, VB.NET , VB, Delphi, Vfp, MS Access.

Popular Solution Go   Back

MS Access 2016 - How to Convert PDF to PDF/A with password protected

Step 1: To install the Image Viewer CP Gold SDK ActiveX, begin by launching the setup file (http://www.viscomsoft.com/demo/imageviewercpgoldsetup.exe). Select the desired installation folder for the Image Viewer CP Gold SDK ActiveX and continue with the installation on your development computer.

Step 2: Launch MS Access 2016. select Blank database.

Step 3: Select Create Tab, select Form Design.

Step 4: Select Design Tab, Select ActiveX Control. Select Image Viewer CP Gold ActiveX Control.


Step 5: Resize the Image Viewer CP Gold ActiveX Control on form and add the following UI on form.(2 buttons 1 textbox control)

Step 6: double click Open button, In code editor , then  Select Tools - References... , select  Microsoft Office 16.0 Object Library, click OK button.

 

 

Step 7:  In Open button click event, add the following code

Private Sub cmdopen_Click()

Dim obj As ImageViewer

Set obj = ImageViewer0.Object

Set dlg = Application.FileDialog(msoFileDialogOpen)

dlg.Filters.Clear

dlg.Filters.Add "PDF", "*.pdf"

bResult = dlg.Show


If bResult Then

   txtfilename.Value = dlg.SelectedItems(1)

    obj.FileName = dlg.SelectedItems(1)

    obj.MouseTrackMode = LeftPanOnly

End If

End Sub

Step 8:  In Convert button click event, add the following code, the output pdf password is 123

Private Sub cmdconvert_Click()
Dim obj As ImageViewer
Set obj = ImageViewer0.Object
Dim dlg As FileDialog
Dim strType As String
Dim strFileName As String
strType = "pdf"
obj.PDFOutputPDFA = True
obj.PDFUserPassword = "123"
obj.PDFSetPassword "123", "123"
obj.PDFSetEncryption40bit True, True, True, True
            
Set dlg = Application.FileDialog(msoFileDialogSaveAs)
With dlg
     dlg.AllowMultiSelect = False
     .Title = "Save File"
     .InitialFileName = "YourFile"
End With
If dlg.Show Then
      strFileName = dlg.SelectedItems(1)
      
   iResult = obj.Save(strFileName, strType)
   
End If
 If iResult = 1 Then
        MsgBox "Save to " strFileName "." LCase(strType)
    Else
        MsgBox "Save failed"
    End If
    
End Sub

Step 9: Right click the Form1, then select "Open" menu item. Then you may run the form, load the PDF , click convert button, the output PDF/A file password is 123