2008年9月3日星期三

如何在QTP中处理PDF文件

使用VBS中PDF相关的DOM技术:

Dim gApp, gPDDoc, jso
Set gApp = CreateObject( "AcroExch.App" )
Set gPDDoc = CreateObject( "AcroExch.PDDoc" )
If gPDDoc.Open( "c:\MyPdfFile.pdf" ) Then
Set jso = gPDDoc.GetJSObject()
jso.console.Show
jso.console.Clear
jso.console.println ( "Hello, Acrobat for QuickTest!" )
gApp.Show
End If
Set jso = Nothing : Set gPDDoc = Nothing : Set gApp=&_
nothing

没有评论: