1

Just wanted to add information on the below post (but seems I cant).

https://safeweb.hsbcpb.com/https://stackoverflow.com/questions/39269911/nuance-power-pdf-automation-using-excel-vba-macro

The reference is now: "C:\Program Files (x86)\Kofax\Power PDF 31\bin\PDFCore8_x64.dll"

even if called powerPDF and the documentation said so to create the with "powerdpdf.app", the following code work fine for me (just in case someone was looking for a solution like I did).

Function copy_pdf_values_wiht_nuance(path As String) As String
    
    Dim PDFApp As Object
    Dim dvOpenDoc As Object
    Dim ddDoc As Object
    

    Set PDFApp = CreateObject("nuancePDF.App")
    Set dvOpenDoc = CreateObject("nuancePDF.DVDoc")
    
    
    If dvOpenDoc.Open(path) = False Then
        PDFApp.Exit
        Exit Function
    End If
        
    Set ddDoc = dvOpenDoc.GetDDDoc()
    PDFApp.MenuItemExecute ("SelectAll")
    PDFApp.MenuItemExecute ("Copy")
    
    PDFApp.Exit
    
    'Set ddPage = ddDoc.AcquirePage(0)
    'Set hl = CreateObject("NuancePDF.HiliteList")
    
    'hr = hl.Add(12, 1)
    'hr = hl.Add(52, 2)
    'Set ts = ddPage.CreatePageHilite(hl)
    'hr = dvOpenDoc.SetTextSelection(ts)
    'dvOpenDoc.ShowTextSelect

    Dim clipboard As MSForms.DataObject
    Dim strContents As String
    
    Set clipboard = New MSForms.DataObject
    clipboard.GetFromClipboard
    strContents = clipboard.GetText
    
    copy_pdf_values_wiht_nuance = strContents
End Function

Copy and paste content of a PDF, having had the wrong reference.

Helkowsky
  • 11
  • 1

0 Answers0