Micro Focus QTP (UFT) Forums
Capture data from pdf - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Capture data from pdf (/Thread-Capture-data-from-pdf)



Capture data from pdf - rahul1234 - 02-12-2010

Hi All,
I have one query.
I want to capture some data from pdf file and want to paste in spread sheet.
That data is coming in following way
Left side some text (say qualification) and on right side name and just below name phone no.
My requirement is i need to capture qualification in qualification column, the name in name column and phone no in phone column in spread sheet.
See the attachment for reference.
[/font]
please let me know the script that how can i do this.

Thanks in advance


RE: Capture data from pdf - Sivakumar Munganda - 02-23-2010

Take the first line of data and split the string after implex take that string as Name

take the second line and split by delimeter : and get the phone number
take the third line and trim it for Qualification
Code:
Function GetPDFPageCount(filename)
Dim pdfFile,Acroapp,pdf
'PDF File preparations
Set Acroapp = CreateObject("AcroExch.App")
Set pdf = CreateObject("AcroExch.PDDoc")
pdf.Open filename,"temp"
Set pdfFile = pdf.GetPDDoc
GetPDFPageCount = pdfFile.GetNumPages
Set pdffile = nothing
Acroapp.Exit
End Function