I am having an issue calling the addwatermarkfromfile method using Visual Basic 6.0. (Not .net)
Here's my basic code I am using to test:
Private Sub Form_Load()
Dim gApp As Acrobat.CAcroApp
Dim gPDDoc As Acrobat.CAcroPDDoc
Dim gPDpage As Acrobat.CAcroPDPage
Dim jso As Object
Dim doc As Variant
Dim nPdf As Integer
Set gApp = CreateObject("AcroExch.App")
Set gPDDoc = CreateObject("AcroExch.PDDoc")
If gPDDoc Is Nothing Then
MsgBox ("Failed to create Acrobat PDDoc object.")
nPdf = gPDDoc.Open("c:\dti\tnc\example.pdf")
If nPdf = -1 Then
Set jso = gPDDoc.GetJSObject
If Not jso Is Nothing Then
Set doc = jso.addWatermarkFromFile("c:\watermark.pdf", 0, 0, 0, False, True, True, 0, 0, -0.5, 0.4, True, 1, False, 0, 1)
nPdf = gPDDoc.Save(1, "c:\test.pdf")
nPdf = gPDDoc.Close()
Set gApp = Nothing
Set gPDDoc = Nothing
Set jso = Nothing
VB is erroring saying "Type Mismatch" on the jso.addWatermarkFromFile line. Am I missing the boat somewhere?
Does anyone have a VB 6 snippet of code I could review?
For Acrobat 7, 8 and 9 - not all IAC methods will work with VB6, and they certainly weren't tested against VB6. Marshaling some of the data types through COM may not work as expected if you use VB6. VB6 is not supported for Acrobat 7, 8 or 9, so don't be surprised if some things simply don't work.
> Does anyone have a VB 6 snippet of code I could review?
The last SDK to be tested against VB6 was Acrobat 6, I believe (may have been Acrobat 5). Acrobat 7 was VS2003 and Acrobat 8 & 9 are both VS2005, which are .NET. If you are using a version of Acrobat newer than 6, there will be no samples using VB6.