FoxitPhantom pdf to Excel Automation

1.1k Views Asked by At

Hi i have a pdf file (path) and I want to convert it to a excel file. im using foxit phantom. I've used the api manual for ref and i cant figure it out. (http://cdn01.foxitsoftware.com/pub/foxit/manual/phantom/en_us/API%20Reference%20for%20Application%20Communication.pdf) The file is just a pdf with random values. I have the library PhantomPDF

Sub convert()

Dim phApp As PhantomPDF.Application
Set phApp = CreateObject("PhantomPDF.Application")
Dim phCreator As PhantomPDF.Document
Set phCreator = phApp.CurrentDocument
Dim hresult As Variant
Dim path As String
path = "C:\Users\plfournier\Documents\test.pdf"

hresult = phCreator.OCRAndExportToExcel(path, 1, 1, True)

End Sub
1

There are 1 best solutions below

0
Giovanni Tonelli On
Sub convert()

    Dim phApp As PhantomPDF.Application

    Dim phCreator As PhantomPDF.Document
    Dim hresult As Variant
    Dim path As String

    Set phApp = CreateObject("PhantomPDF.Application")
    Set phCreator = phApp.CurrentDocument
    path = "C:\Users\39340\Downloads\90-21 DN16 CONTACT.xls"

    phCreator.OCRAndExportToExcel path, 1, 1, True, True

End Sub