2 Replies Latest reply on Oct 28, 2008 12:24 PM by (Shelley_Massey)

    AddWaterMarkfromfile method problem  - VB 6.0

      Hello!

      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.")
      End
      End If
      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()
      End If
      End If

      Set gApp = Nothing
      Set gPDDoc = Nothing
      Set jso = Nothing
      End Sub

      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?
      Thank you!
      shelley