PDF Viewer SDK ActiveX

PDF Viewer SDK ActiveX 12.0

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

It is PDF Viewer SDK, fast open PDF, support print a PDF, searching the text with C , C#, VB.Net , VB6, Delphi, Vfp, MS Access.

VFP - How to add PDF Stamp to a PDF

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

Step 2: Launch VFP - Visual Foxpro. select New Project.

Step 3: Select Tools - Options... , select Control tabs, select PDF Viewer ActiveX Control, click OK button.

Step 4: Select Forms - click New... button to add new form.



Step 5: Select form1, click Modify button.

Step 6: In Form Controls Toolbar, click View Classes button, then select ActiveX Controls.
}
Step 7: Now you will see the PDF Viewer ActiveX Control, drag it on form.






Step 8: Create the UI as the following 


Step 9: In form init event, add the following code 

thisform.cbostampicon.AddItem("Approved")
thisform.cbostampicon.AddItem("Asls")
thisform.cbostampicon.AddItem("Confidential")
thisform.cbostampicon.AddItem("Departmental")
thisform.cbostampicon.AddItem("Draft")
thisform.cbostampicon.AddItem("Experimental")
thisform.cbostampicon.AddItem("Expired")
thisform.cbostampicon.AddItem("Final")
thisform.cbostampicon.AddItem("ForComment")
thisform.cbostampicon.AddItem("ForPublicRelease")
thisform.cbostampicon.AddItem("NotApproved")
thisform.cbostampicon.AddItem("NotForPublicRelease")
thisform.cbostampicon.AddItem("Sold")
thisform.cbostampicon.AddItem("TopSecret")
thisform.cbostampicon.ListIndex = 1
thisform.cbostampcolor.AddItem("transparent")
thisform.cbostampcolor.AddItem("aqua")
thisform.cbostampcolor.AddItem("black")
thisform.cbostampcolor.AddItem("blue")
thisform.cbostampcolor.AddItem("fuchsia")
thisform.cbostampcolor.AddItem("gray")
thisform.cbostampcolor.AddItem("green")
thisform.cbostampcolor.AddItem("lime")
thisform.cbostampcolor.AddItem("maroon")
thisform.cbostampcolor.AddItem("navy")
thisform.cbostampcolor.AddItem("olive")
thisform.cbostampcolor.AddItem("orange")
thisform.cbostampcolor.AddItem("purple")
thisform.cbostampcolor.AddItem("red")
thisform.cbostampcolor.AddItem("silver")
thisform.cbostampcolor.AddItem("teal")
thisform.cbostampcolor.AddItem("white")
thisform.cbostampcolor.AddItem("yellow")
thisform.cbostampcolor.ListIndex = 4
Step 10: In Open PDF button click event, add the following code

strfile = GETFILE('pdf', 'Browse PDF file', 'Browse', 1, 'Select PDF file ')
thisform.pdfviewer.LoadPDFFile (strfile)
thisform.pdfviewer.PDFClearStamp

Step 11: In Add PDF Stamp button click event, add the following code

   thisform.pdfviewer.PDFAddStamp(1, thisform.cbostampicon.ListIndex-1, thisform.txtleft.Value, thisform.txttop.value, thisform.txtwidth.value, thisform.txtheight.Value, thisform.cbostampcolor.ListIndex-1, ALLTRIM(thisform.txtstamptext.Text))

Step 12: In Save PDF button click event, add the following code

strOutputFile=GETFILE('pdf', 'Output PDF file', 'Browse', 1, 'Select')
bResult =thisform.pdfviewer.savePDF (strOutputFile)
IF bResult then
=MESSAGEBOX("Save PDF Completed")
Endif

After added the PDF stamps, the output PDF like this



Download this VFP sample source code