Image Viewer CP Pro SDK ActiveX

Image Viewer CP Pro SDK ActiveX

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

It is a PDF Viewer and Document Viewer SDK , Export to PDF ,Image processing, 1D and 2D Barcode Reader, Writer, DICOM and OCR with C#, C , VB.NET , VB, Delphi, Vfp, MS Access.

Popular Solution Go   Back

MS Access 2016 - How to display PDF file

Step 1: To install the Image Viewer CP Pro SDK ActiveX, begin by launching the setup file (http://www.viscomsoft.com/demo/imageviewercpprosetup.exe). Select the desired installation folder for the Image Viewer CP Pro 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 Pro ActiveX Control.


Step 5: Resize the Image Viewer CP Pro ActiveX Control on form and add the following UI on form.(2 button, 3 textbox , 2 label control)




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

Step 7:  In Command1 click event, add the following code

Private Sub Command1_Click()
Dim dlg As Object
Dim bResult As Boolean
Dim iPageTotal As Integer

Dim obj As ImageViewer
Set obj = ImageViewer0.Object


Set dlg = Application.FileDialog(msoFileDialogOpen)

bResult = dlg.Show

If bResult Then
     
    obj.PDFUseAdvancedViewer = True
  
    txtfile.Value = dlg.SelectedItems(1)
   
    obj.LoadMultiPage dlg.SelectedItems(1), 1
           
    txttotalpage.Value = obj.GetTotalPage
    txtpagenumber.Value = 1
   
    obj.MouseTrackMode = LeftPanOnly
End If


End Sub


Step 8:  In go button click event, add the following code

Private Sub cmdgo_Click()
Dim obj As ImageViewer
Set obj = ImageViewer0.Object
 obj.LoadMultiPage txtfile.Value, txtpagenumber.Value
End Sub

Step 9: Right click the Form1, then select "Open" menu item. Then you may run the form


Download the source code of the display PDF Sample