ACCESSING PDF ( PORTABLE DOCUMENT FORMAT ) PDF Free Download

Transcription

1 Chapter 16 Scripting Quicktest Skilled Web page 1 ACCESSING PDF ( PORTABLE DOCUMENT FORMAT )… 4 WHAT IS ACROBAT?… 4 IMPORTANT!!… 4 ACCESSIBILITY FOR PDF… 4 WHAT IS THE ACROBAT SDK?… 5 OLE AUTOMATION OBJECTS… 5 HELLO ACROBAT… 5 OLE AUTOMATION DOM… 6 ACROEXCH.POINT OBJECT… 6 AcroExch.Level.X Property… 7 AcroExch.Level.Y Property… 7 ACROEXCH.RECT OBJECT… 7 AcroExch.Rect.Backside Property… 7 AcroExch.Rect.Left Property… 7 AcroExch.Rect.Proper Property… 8 AcroExch.Rect.Prime Property… 8 ACROEXCH.TIME OBJECT… 8 AcroExch.Time.Date Property… 8 AcroExch.Time.Hour Property… 8 AcroExch.Time.Millisecond Property… 9 AcroExch.Time.Minute Property… 9 AcroExch.Time.Month Property… 9 AcroExch.Time.Second Property… 9 AcroExch.Time.Yr Property… 9 ACROEXCH.APP OBJECT AcroExch.App.CloseAllDocs() Technique AcroExch.App.Exit() Technique AcroExch.App.GetActiveDoc() Technique AcroExch.App.GetActiveTool() Technique AcroExch.App.GetAVDoc() Technique AcroExch.App.GetFrame() Technique AcroExch.App.GetNumAVDocs() Technique AcroExch.App.GetLanguage() Technique AcroExch.App.GetPreferenceEx() Technique AcroExch.App.Conceal() Technique AcroExch.App.Lock() Technique AcroExch.App.Reduce() Technique AcroExch.App.Maximize() Technique AcroExch.App.MenuItemExecute() Technique AcroExch.App.MenuItemIsEnabled() Technique AcroExch.App.MenuItemIsMarked() Technique AcroExch.App.MenuItemRemove() Technique AcroExch.App.SetActiveTool() Technique AcroExch.App.SetFrame() Technique AcroExch.App.SetPreference() Technique AcroExch.App.Present() Technique AcroExch.App.ToolButtonIsEnabled() Technique AcroExch.App.ToolButtonRemove() Technique Dani Vainstein Accessing PDF’s Web page 1 of 79

2 Chapter 16 Scripting Quicktest Skilled Web page 2 AcroExch.App.Unlock() Technique ACROEXCH.AVDOC OBJECT AcroExch.AVDoc.BringToFront() Technique AcroExch.AVDoc.ClearSelection() Technique AcroExch.AVDoc.Shut() Technique AcroExch.AVDoc.FindText() Technique AcroExch.AVDoc.GetAVPageView() Technique AcroExch.AVDoc.GetFrame () Technique AcroExch.AVDoc.GetPDDoc () Technique AcroExch.AVDoc.GetTitle () Technique AcroExch.AVDoc.GetViewMode () Technique AcroExch.AVDoc.IsValid () Technique AcroExch.AVDoc.Maximize() Technique AcroExch.AVDoc.Open() Technique AcroExch.AVDoc.OpenInWindowEx() Technique AcroExch.AVDoc.PrintPages() and PrintPagesSilent() Strategies AcroExch.AVDoc.SetFrame() Technique AcroExch.AVDoc.SetTextSelection() Technique AcroExch.AVDoc.SetTitle() Technique AcroExch.AVDoc.SetViewMode() Technique AcroExch.AVDoc.ShowTextSelect () Technique ACROEXCH.AVPAGEVIEW OBJECT AcroExch.AVPageView.DevicePointToPage () Technique AcroExch.AVPageView.DoGoBack () Technique AcroExch.AVPageView.DoGoForward() Technique AcroExch.AVPageView.GetAVDoc() Technique AcroExch.AVPageView.GetDoc() Technique AcroExch.AVPageView.GetPage() Technique AcroExch.AVPageView.GetPageNum() Technique AcroExch.AVPageView.GetZoom() Technique AcroExch.AVPageView.GetZoomType() Technique AcroExch.AVPageView.Goto() Technique AcroExch.AVPageView.ReadPageDown() and ReadPageUp() Strategies AcroExch.AVPageView.ScrollTo() Technique AcroExch.AVPageView.ZoomTo() Technique ACROEXCH.HILITELIST OBJECT AcroExch.HiliteList.Add() Technique ACROEXCH.PDANNOT OBJECT ACROEXCH.PDBOOKMARK OBJECT AcroExch.PDBookmark.Destroy () Technique AcroExch.PDBookmark.GetByTitle() Technique AcroExch.PDBookmark.GetTitle() Technique AcroExch.PDBookmark.IsValid() Technique AcroExch.PDBookmark.Carry out() Technique AcroExch.PDBookmark.SetTitle() Technique ACROEXCH.PDDOC OBJECT AcroExch.PDDoc.AcquirePage () Technique AcroExch.PDDoc.ClearFlags () Technique AcroExch.PDDoc.Shut () Technique AcroExch.PDDoc.Create () Technique AcroExch.PDDoc.CreateTextSelect () Technique Dani Vainstein Accessing PDF’s Web page 2 of 79

3 Chapter 16 Scripting Quicktest Skilled Web page 3 AcroExch.PDDoc.CreateThumbs () Technique AcroExch.PDDoc.CropPages () Technique AcroExch.PDDoc.DeletePages () Technique AcroExch.PDDoc.DeleteThumbs () Technique AcroExch.PDDoc.GetFileName () Technique AcroExch.PDDoc.GetFlags () Technique AcroExch.PDDoc.GetInfo () Technique AcroExch.PDDoc.GetInstanceID () Technique AcroExch.PDDoc.GetJSObject () Technique AcroExch.PDDoc.GetNumPages () Technique AcroExch.PDDoc.GetPageMode () Technique AcroExch.PDDoc.GetPermanentID () Technique AcroExch.PDDoc.InsertPages () Technique AcroExch.PDDoc.MovePage () Technique AcroExch.PDDoc.Open () Technique AcroExch.PDDoc.OpenAVDoc () Technique AcroExch.PDDoc.ReplacePages () Technique AcroExch.PDDoc.Save () Technique AcroExch.PDDoc.SetFlags () Technique AcroExch.PDDoc.SetInfo () Technique AcroExch.PDDoc.SetPageMode () Technique ACROEXCH.PDPAGE OBJECT AcroExch.PDPage.AddAnnot () Technique AcroExch.PDPage.AddNewAnnot () Technique AcroExch.PDPage.CreatePageHilite () Technique AcroExch.PDPage.CreateWordHilite () Technique AcroExch.PDPage.GetAnnotIndex() Technique AcroExch.PDPage.GetDoc() Technique AcroExch.PDPage.GetNumAnnots() Technique AcroExch.PDPage.GetNumber() Technique AcroExch.PDPage.GetRotate() Technique AcroExch.PDPage.GetSize() Technique AcroExch.PDPage.RemoveAnnot() Technique AcroExch.PDPage.SetRotate () Technique ACROEXCH.PDTEXTSELECT OBJECT AcroExch.PDTextSelect.Destroy () Technique AcroExch.PDTextSelect.GetBoundingRect () Technique AcroExch.PDTextSelect.GetNumText () Technique AcroExch.PDTextSelect.GetPage () Technique AcroExch.PDTextSelect.GetText () Technique ACROFORM OLE AUTOMATION AFORMAUT.APP OBJECT AFORMAUT.FIELD OBJECT AFORMAUT.FIELDS OBJECT DEVELOPER FAQ USER AND DEVELOPER RESOURCES What Do I Must Obtain from the Internet to Get the Acrobat SDK? The place Can I Get Assist With Acrobat Product Points? What Are the API Variations Between Acrobat and Adobe Reader? What API Strategies Are Obtainable to Modify PDF Paperwork? How Can I Extract Textual content From PDF Paperwork Utilizing the Acrobat SDK? Dani Vainstein Accessing PDF’s Web page 3 of 79

4 Chapter 16 Scripting Quicktest Skilled Web page 4 How Do I Use Command Strains with Acrobat and Adobe Reader on Home windows? PDF TASKS Discover Textual content in all PDF’s File Open Invoking AVCommands Programmatically Looking phrases in PDF APPENDIX View Mode Enumeration Toolbar Objects Names Zoom Technique Enumeration Web page Rotation Enumeration Doc Flags Enumeration Accessing PDF ( Transportable Doc Format ) What Is Acrobat? Adobe Acrobat consists of a household of merchandise for creating, modifying, indexing, looking out, displaying, and manipulating PDF (Transportable Doc Format) information Adobe Reader for viewing, navigating, and printing PDF paperwork. Adobe Reader is free software program that lets anybody view and print Adobe PDF information on all main pc platforms, in addition to fill in and submit Adobe PDF varieties. Adobe has distributed greater than 500 million copies of the software program worldwide. Vital!! The Microsoft Home windows model of Acrobat is an OLE Automation server. With a view to use the OLE objects made obtainable by Acrobat, it’s essential to have the complete Acrobat product put in in your system!! Accessibility for PDF The Adobe Transportable Doc Format ( PDF ) is a file format for representing paperwork in a fashion impartial of the appliance software program, {hardware}, and working system used to create them, in addition to of the output gadget on which they’re to be displayed or printed. PFD information specify the looks of pages in a doc in a dependable, gadget impartial method Adobe offers strategies to make the content material of a PDF file obtainable to assistive know-how resembling display readers. On The Microsoft Home windows working system, Adobe Acrobat and Adobe Reader export PDF content material as COM objects. purposes can interface with Acrobat or Adobe Reader in two Methods : 1. By means of Microsoft’s Lively Accessibility( MSAA ) interface, utilizing MSAA objects that Acrobat or Adobe Reader exorts. 2. Straight by exported COM objects that permit entry to the PDF doc’s inner construction, referred to as the Doc Object Mannequin( DOM ). For Unix Platforms, Adobe Reader helps the Gnome accessibility structure. Dani Vainstein Accessing PDF’s Web page 4 of 79

5 Chapter 16 Scripting Quicktest Skilled Web page 5 What Is the Acrobat SDK? The Acrobat SDK is a set of instruments that make it easier to develop software program that interacts with Acrobat know-how. The SDK incorporates header information, sort libraries, easy utilities, pattern code, and documentation. Utilizing the Acrobat SDK, you may develop software program that integrates with Acrobat and Adobe Reader For extra details about acrobat SDK go to : The Adobe Acrobat 8.1 SDK is now obtainable freed from cost to all customers. Builders can use the SDK to create software program and plug-ins to work together and customise Adobe Acrobat and Adobe Reader. To obtain Acrobat SDK : OLE Automation Objects All of the samples can be on the QTTutorial.pdf file ( QuickTest Tutorial pdf File ) positioned in your Mercury Interactive Set up Folder /assist/ QTTutorial.pdf Hi there Acrobat Choice Express 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.present jso.console.clear jso.console.println ( “Hello, Acrobat for QuickTest!” ) gapp.present Set jso = Nothing : Set gpddoc = Nothing : Set gapp = Nothing Dani Vainstein Accessing PDF’s Web page 5 of 79

6 Chapter 16 Scripting Quicktest Skilled Web page 6 OLE Automation DOM All of the samples can be on the QTTutorial.pdf file ( QuickTest Tutorial pdf File ) positioned in your Mercury Interactive Set up Folder /assist/ QTTutorial.pdf AcroExch.Level Object A degree, specified by its x and y coordinates. Dani Vainstein Accessing PDF’s Web page 6 of 79

See also  2 Methods to Import OBS video into Premiere Pro (CC, CS6, CS5, CS4) for Editing

7 Chapter 16 Scripting Quicktest Skilled Web page 7 AcroExch.Level.X Property Will get or units the x-coordinate of an AcroPoint. returnvalue = object.x The x-coordinate of the AcroPoint. AcroExch.Level.Y Property Will get or units the y-coordinate of an AcroPoint. returnvalue = object.y The y-coordinate of the AcroPoint. AcroExch.Rect Object A rectangle, specified by the highest left and backside proper factors. AcroExch.Rect.Backside Property Will get or units the underside y-coordinate of an AcroRect. returnvalue = object.backside The y-coordinate of the underside of the AcroRect. AcroExch.Rect.Left Property Will get or units left x-coordinate of an AcroRect. returnvalue = object.left The x-coordinate of the left aspect of the AcroRect. Dani Vainstein Accessing PDF’s Web page 7 of 79

8 Chapter 16 Scripting Quicktest Skilled Web page 8 AcroExch.Rect.Proper Property Will get or units the precise x-coordinate of an AcroRect. returnvalue = object.proper The x-coordinate of the precise aspect of the AcroRect. AcroExch.Rect.Prime Property Will get or units the highest y-coordinate of an AcroRect. returnvalue = object.high The y-coordinate of the highest of the AcroRect. AcroExch.Time Object A specified time, correct to the millisecond, together with the day of the week. AcroExch.Time.Date Property Will get or units the date from an AcroTime. returnvalue = object.date The date from the AcroTime. The date runs from 1 to 31. AcroExch.Time.Hour Property Will get or units the hour from an AcroTime. returnvalue = object.hour The hour from the AcroTime. The hour runs from 0 to 23. Dani Vainstein Accessing PDF’s Web page 8 of 79

9 Chapter 16 Scripting Quicktest Skilled Web page 9 AcroExch.Time.Millisecond Property Will get or units the milliseconds from an AcroTime. returnvalue = object.millisecond The milliseconds from the AcroTime. Milliseconds run from 0 to 999. AcroExch.Time.Minute Property Will get or units the minutes from an AcroTime. returnvalue = object.minute The minutes from the AcroTime. Minutes run from 0 to 59. AcroExch.Time.Month Property Will get or units the month from an AcroTime. returnvalue = object.month The month from the AcroTime. The month runs from 1 to 12, the place 1 is January,…, and 12 is December. AcroExch.Time.Second Property Will get or units the seconds from an AcroTime. returnvalue = object.second The seconds from the AcroTime. Seconds run from 0 to 59. AcroExch.Time.Yr Property Dani Vainstein Accessing PDF’s Web page 9 of 79

10 Chapter 16 Scripting Quicktest Skilled Web page 10 Will get or units the 12 months from an AcroTime. returnvalue = object.12 months The 12 months from the AcroTime. The Yr runs from 1 to AcroExch.App Object The Acrobat software itself. This can be a creatable interface. From the appliance layer, you might management the looks of Acrobat, whether or not Acrobat seems, and the dimensions of the appliance window. This object offers entry to the menu bar and the toolbar, in addition to the visible illustration of a PDF file on the display (by way of an AVDoc object). AcroExch.App.CloseAllDocs() Technique Closes all open paperwork. You’ll be able to shut every particular person AVDoc object by calling AVDoc.Shut. returnvalue = object.closealldocs -1 if profitable, 0 if not. You could explicitly shut all paperwork or name App.CloseAllDocs. In any other case, the method won’t ever exit. AVDoc.Shut() AVDoc.Open() AVDoc.OpenInWindow() PDDoc.Shut() PDDoc.Open() PDDoc.OpenAVDoc() Choice Express Dim AcroApp, returnvalue Set AcroApp = CreateObject( “AcroExch.App” ) If AcroApp.GetNumAVDocs > 0 Then returnvalue = AcroApp.CloseAllDocs() Print “AcroApp.CloseAllDocs returned with code —> ” & Cstr( returnvalue ) Set AcroApp = Nothing Dani Vainstein Accessing PDF’s Web page 10 of 79

11 Chapter 16 Scripting Quicktest Skilled Web page 11 AcroExch.App.Exit() Technique Exits Acrobat. Purposes ought to name App.Exit earlier than exiting. returnvalue = object.exit Returns -1 if the complete shutdown course of succeeded. This consists of closing any open paperwork, releasing OLE references, and eventually exiting the appliance. If any step fails, the operate returns 0, and the appliance will proceed working. This technique won’t work if the appliance is seen (if the person is accountable for the appliance). In such circumstances, if the Present() technique had beforehand been referred to as, you might name Conceal() after which Exit(). Use App.CloseAllDocs to shut all of the paperwork earlier than calling this technique. Choice Express Dim AcroApp, returnvalue Set AcroApp = CreateObject( “AcroExch.App” ) If AcroApp.GetNumAVDocs > 0 Then returnvalue = AcroApp.CloseAllDocs() Print “AcroApp.CloseAllDocs returned with code —> ” & Cstr( returnvalue ) AcroApp.Exit() Set AcroApp = Nothing AcroExch.App.GetActiveDoc() Technique Will get the frontmost doc. Set avdoc = object.getactivedoc An AcroExch.AVDoc that represents the frontmost AcroExch.AVDoc object. If there are not any paperwork open, it would return Nothing. App.GetAVDoc() Choice Express Dim AcroApp, AcroAvDoc Set AcroApp = CreateObject( “AcroExch.App” ) Dani Vainstein Accessing PDF’s Web page 11 of 79

12 Chapter 16 Scripting Quicktest Skilled Web page 12 Set AcroAVDoc = AcroApp.GetActiveDoc() If Not AcroAVDoc Is Nothing Then returnvalue = AcroApp.CloseAllDocs() AcroApp.Exit()Set AcroApp = Nothing AcroExch.App.GetActiveTool() Technique Will get the title of the at present lively software. returnvalue = object.getactivetool Returns Nothing if there isn’t a lively software. Returns the title of the at present lively software in any other case. Instrument Title Film Hyperlink Thread Crop Widget Contact-Up Textual content Choice Object Choice Kind Hand Zoom Choose BCLC:Desk/Formatted_TextZoneTool SelectGraphics Textual content FreeText Sound Stamp FileAttachment Ink Sq. Circle Line Spotlight UI Label Film Instrument (M) Hyperlink Instrument (L) Article Instrument (A) Crop Instrument (C) Type Instrument (F) TouchUp Textual content Instrument (T) TouchUp Object Instrument (T) / TouchUp Order Instrument (T) Hand Instrument (H) Zoom In Instrument (Z) / Zoom Out Instrument (Z) Textual content Choose Instrument (V) / Column Choose Instrument (V) Desk/Formatted Textual content Choose Instrument (V) Graphics Choose Instrument (G) Observe Instrument (S) FreeText Instrument (S) Sound Attachment Instrument (S) Stamp Instrument (S) File Attachment Instrument (S) Pencil Instrument (N) Sq. Instrument (N) Circle Instrument (N) Line Instrument (N) Spotlight Instrument (U) Dani Vainstein Accessing PDF’s Web page 12 of 79

13 Chapter 16 Scripting Quicktest Skilled Web page 13 StrikeOut Underline Squiggly DigSigTool Strikeout Instrument (U) Underline Instrument (U) Not uncovered by UI. Digital Signature Instrument (D) App.SetActiveTool() Choice Express Dim AcroApp, AcroAvDoc Set AcroApp = CreateObject( “AcroExch.App” ) Set AcroAVDoc = AcroApp.GetActiveDoc() If Not AcroAVDoc Is Nothing Then returnvalue = AcroApp.CloseAllDocs() AcroApp.Exit()Set AcroApp = Nothing AcroExch.App.GetAVDoc() Technique Will get an AcroExch.AVDoc object by way of its index throughout the checklist of open AVDoc objects. Use App.GetNumAVDocs to find out the variety of AcroExch.AVDoc objects. Set avdoc = object.getavdoc( nindex ) An AVDoc object for the desired AcroExch.AVDoc doc, or Nothing if nindex is larger than the variety of open paperwork. nindex The index of the doc to get. App.GetActiveDoc() Choice Express Dim AcroApp, AcroAvDoc Dim ndoc Dani Vainstein Accessing PDF’s Web page 13 of 79

See also  6+ PPT to Exe Converter Software Free Download for Windows, Mac

14 Chapter 16 Scripting Quicktest Skilled Web page 14 Set AcroApp = CreateObject( “AcroExch.App” ) If AcroApp.GetNumAVDocs > 0 Then Print “Currently open documents —> ” & AcroApp.GetNumAVDocs For ndoc = 0 To AcroApp.GetNumAVDocs – 1 Set AcroAvDoc = AcroApp.GetAVDoc( ndoc ) Print “Index = ” & ndoc & ” title : ” & AcroAvDoc.GetTitle() Subsequent Else Print “No open pdf documents found.” AcroApp.Exit() Set AcroApp = Nothing : Set AcroAvDoc = Nothing AcroExch.App.GetFrame() Technique Will get the window s body. Set rect = object.getframe() The AcroExch.Rect object that represents the window s body, specified as an AcroExch.Rect GetFrame shouldn’t be helpful when the PDF file was opened with AVDoc.OpenInWindow. GetFrame returns the appliance window s body (not the doc window s body). Nevertheless, the appliance s window is hidden when a doc is opened utilizing OpenInWindow, and doesn’t change in dimension as doc home windows are moved and resized. App.Maximize() App.SetFrame() AcroExch.App.GetNumAVDocs() Technique Will get the variety of open AcroExch.AVDoc objects. The utmost variety of paperwork the Acrobat software can open at a time is specified by the avpmaxopendocuments desire, which could be obtained with App.GetPreferenceEx and set by App.SetPreferenceEx. Dani Vainstein Accessing PDF’s Web page 14 of 79

15 Chapter 16 Scripting Quicktest Skilled Web page 15 rely = object.getnumavdocs() The variety of open AcroExch.AVDoc objects. App.GetActiveDoc() App.GetAVDoc() AcroExch.App.GetLanguage() Technique Will get a code that specifies which language the Acrobat software s person interface is utilizing. lang = object.getlanguage() String containing a three-letter language code. Have to be one of many following: DEU German, ENU English, ESP Spanish, FRA French, ITA Italian NLD Dutch, SVE Swedish, CZE Czech, SUO Finnish, JPN Japanese Extra… App.GetPreference() App.SetPreference() AcroExch.App.GetPreferenceEx() Technique Will get the desired software desire, utilizing the Variant sort to cross values. returnvalue = object.getpreference( ntype ) ntype The title of the preferences merchandise whose worth is obtained. The worth of the desired desire merchandise. AcroExch.App.Conceal() Technique Dani Vainstein Accessing PDF’s Web page 15 of 79

16 Chapter 16 Scripting Quicktest Skilled Web page 16 Hides the Acrobat software. When the viewer is hidden, the person has no management over it, and the Acrobat software exits when the final automation object is closed. returnvalue = object.conceal() True if profitable, false in any other case. App.Present() AcroExch.App.Lock() Technique Locks the Acrobat software. Sometimes, this technique is named when utilizing AVDoc.OpenInWindowEx to attract into one other software s window. For those who name App.Lock, it is best to name App.UnlockEx when you’re achieved utilizing OLE automation. There are some benefits and drawbacks of locking the viewer when utilizing AVDoc.OpenInWindowEx. You could weigh these earlier than deciding whether or not to lock the viewer: Locking prevents issues that may typically happen if two processes try to open a file on the similar time. Locking prevents a person from utilizing Acrobat s person interface (resembling including annotations) in your software s window. Locking can forestall every other software, together with the Acrobat software, from opening PDF information. This downside could be minimized by calling App.UnlockEx as quickly because the file as been opened. returnvalue = object.lock( lockedby ) lockedby A string that’s used because the title of the appliance that has locked the Acrobat software. true if the Acrobat software was locked efficiently, false in any other case. Locking will fail if the Acrobat software is seen. App.Unlock() AcroExch.App.Reduce() Technique Minimizes the Acrobat software. Dani Vainstein Accessing PDF’s Web page 16 of 79

17 Chapter 16 Scripting Quicktest Skilled Web page 17 returnvalue = object.reduce( bminimize ) bminimize If a constructive quantity, the Acrobat software is minimized. If 0, the Acrobat software is returned to its regular state. True if profitable, false in any other case. AcroExch.App.Maximize() Technique Maximizes the Acrobat software. returnvalue = object.maximize( bmaximize ) bmaximize If a constructive quantity, the Acrobat software is maximized. If 0, the Acrobat software is returned to its regular state. True if profitable, false in any other case. App.GetFrame() App.SetFrame() AcroExch.App.MenuItemExecute() Technique Executes the menu merchandise whose language-independent menu merchandise title is specified. returnvalue = object.menuitemexecute( menuitemname ) menuitemname The language-independent title of the menu merchandise to execute. ShowHideToolBar ShowHideMenuBar (new in Acrobat 3.0) ShowHideClipboard endshowhidegroup Cascade Dani Vainstein Accessing PDF’s Web page 17 of 79

18 Chapter 16 Scripting Quicktest Skilled Web page 18 TileHorizontal TileVertical CloseAll Returns true if the menu merchandise executes efficiently, false if the menu merchandise is lacking or shouldn’t be enabled. App.MenuItemIsEnabled() App.MenuItemIsMarked() App.MenuItemRemove() Choice Express Dim AcroApp, AcroAVDoc Dim gpdfpath gpdfpath = “C:QTTutorial.pdf” ‘ ** Initialize Acrobat by creating App object Set AcroApp = CreateObject( “AcroExch.App” ) ‘ ** show Acrobat AcroApp.Show() ‘ ** Set AVDoc object Set AcroAVDoc = CreateObject( “AcroExch.AVDoc” ) ‘ ** open the PDF If AcroAVDoc.Open( gpdfpath, ” ) Then wait 1 acroapp.menuitemexecute ( “ShowHideToolBar” ) MsgBox “toolbar ought to be hidden” acroapp.menuitemexecute ( “ShowHideToolBar” ) wait 1 AcroApp.CloseAllDocs() AcroApp.Exit() Set AcroApp = Nothing : Set AcroAvDoc = Nothing AcroExch.App.MenuItemIsEnabled() Method Determines whether the specified menu item is enabled. returnvalue = object.menuitemisenabled( menuitemname ) menuitemname The language-independent name of the menu item whose enabled state is obtained. Dani Vainstein Accessing PDF’s Page 18 of 79

19 Chapter 16 Scripting Quicktest Professional Page 19 True if the menu item is enabled, False if it is disabled or does not exist. App.MenuItemExecute() App.MenuItemIsMarked() App.MenuItemRemove() AcroExch.App.MenuItemIsMarked() Method Determines whether the specified menu item is marked. returnvalue = object.menuitemismarked( menuitemname ) menuitemname The language-independent name of the menu item whose marked state is obtained. True if the menu item is enabled, False if it is disabled or does not exist. App.MenuItemExecute() App.MenuItemIsEnabled() App.MenuItemRemove() AcroExch.App.MenuItemRemove() Method Removes the menu item whose language-independent menu item is specified. returnvalue = object.menuitemremove( menuitemname ) menuitemname The language-independent name of the menu item to remove. True if the menu item was removed, False if the menu item does not exist. App.MenuItemExecute() App.MenuItemIsEnabled() Dani Vainstein Accessing PDF’s Page 19 of 79

20 Chapter 16 Scripting Quicktest Professional Page 20 App.MenuItemIsMarked() AcroExch.App.SetActiveTool() Method Sets the active tool according to the specified name, and determines whether the tool is to be used only once or should remain active after being used (persistent). returnvalue = object.setactivetool( buttonname, persistent ) buttonname persistent The name of the tool to set as the active tool. Hand – Hand tool. Note – Tool for making notes. (not in LE 2.0 or Reader) Select – Text selection tool. SelectGraphics – Graphics selection tool. (new in 2.0) Zoom – Tool for changing the zoom factor. Link – Link creation tool. (not in LE 2.0 or Reader) Thread – Thread creation tool. (not in LE 2.0 or Reader) A request indicating whether the tool should be persistent. A positive number indicates a request to the Acrobat application for the tool to remain active after it has been used. If 0 is specified, the Acrobat application reverts to the previously active tool after this tool is used once. True if successful, false if not. App.GetActiveTool() App.ToolButtonIsEnabled() App.ToolButtonRemove() AcroExch.App.SetFrame() Method Sets the window s frame to the specified rectangle. returnvalue = object.setframe( iacrorect ) iacrorect An AcroExch.Rect specifying the window frame. Dani Vainstein Accessing PDF’s Page 20 of 79

See also  10 Best Anti-Spyware [2021] — Spyware Removal & Protection

21 Chapter 16 Scripting Quicktest Professional Page 21 true if the frame was set, false if iacrorect is not of type AcroExch.Rect. App.GetFrame() App.Maximize() AcroExch.App.SetPreference() Method Sets a value in the preferences file. Zoom values (used in avpdefaultzoomscale and avpmaxpagecachezoom) must be passed as percentages and are automatically converted to fixed point numbers, e.g., 100 is automatically converted to 1.0. Colors (used in avpnotecolor) are automatically converted from RGB values to the representation used in the preferences file returnvalue = object.setpreference( ntype, nvalue ) ntype nvalue The preferences item whose value is set. section lists the preferences items. The value to set. Always returns true. App.GetLanguage() App.GetPreference() AcroExch.App.Show() Method Shows the Acrobat viewer. When the viewer is shown, the user is in control, and the Acrobat viewer does not automatically exit when the last automation object is destroyed. returnvalue = object.show() Always returns true. App.Hide() AcroExch.App.ToolButtonIsEnabled() Method Dani Vainstein Accessing PDF’s Page 21 of 79

22 Chapter 16 Scripting Quicktest Professional Page 22 Is the specified toolbar button enabled? returnvalue = object.toolbuttonisenabled( buttonname ) buttonname The name of the button whose enabled state is obtained. A list a buttons can be seen in Appendix15, Table2 – Toolbar button names true if the button is enabled, false if it is not enabled or does not exist. App.GetActiveTool() App.SetActiveTool() App.ToolButtonRemove() Option Explicit Dim AcroApp, AcroAVDoc Dim gpdfpath gpdfpath = “C:QTTutorial.pdf” ‘ ** Initialize Acrobat by creating App object Set AcroApp = CreateObject( “AcroExch.App” ) ‘ ** show Acrobat AcroApp.Show() ‘ ** Set AVDoc object Set AcroAVDoc = CreateObject( “AcroExch.AVDoc” ) ‘ ** open the PDF If AcroAVDoc.Open( gpdfpath, ” ) Then Print “ZoomIn enabled? —> ” & acroapp.toolbuttonisenabled( “ZoomIn” ) Print “ZoomOut enabled? —> ” & acroapp.toolbuttonisenabled( “ZoomOut” ) Print “Zoom100 enabled? —> ” & acroapp.toolbuttonisenabled( “Zoom100” ) Print “Select enabled? —> ” & acroapp.toolbuttonisenabled( “Select” ) Print “Note enabled? —> ” & acroapp.toolbuttonisenabled( “Note” ) Print “Link enabled? —> ” & acroapp.toolbuttonisenabled( “Link” ) Print “FirstPage enabled? —> ” & acroapp.toolbuttonisenabled( “FirstPage” ) Print “FindDialog enabled? —> ” & acroapp.toolbuttonisenabled( “FindDialog” ) AcroApp.CloseAllDocs() AcroApp.Exit() Set AcroApp = Nothing Dani Vainstein Accessing PDF’s Web page 22 of 79

23 Chapter 16 Scripting Quicktest Skilled Web page 23 AcroExch.App.ToolButtonRemove() Technique Removes the desired button from the toolbar. returnvalue = object.toolbuttonremove( buttonname ) buttonname The title of the button to take away. An inventory a buttons could be seen in Appendix15, Table2 – Toolbar button names true if the button was eliminated, false in any other case. App.GetActiveTool() App.SetActiveTool() App.ToolButtonIsEnabled() AcroExch.App.Unlock() Technique Unlocks the Acrobat viewer if it was beforehand locked. This technique clears a flag that signifies the viewer is locked. For those who referred to as App.Lock(), it is best to name App.Unlock() when you’re achieved utilizing OLE automation. object.unlock() It’s strongly really useful that Lock and Unlock be used in case you name OpenInWindow. All the time returns true. Dani Vainstein Accessing PDF’s Web page 23 of 79

24 Chapter 16 Scripting Quicktest Skilled Web page 24 App.Lock() AcroExch.AVDoc Object A view of a PDF doc in a window. This can be a creatable interface. There’s one AVDoc object per displayed doc. Not like a PDDoc object, an AVDoc object has a window related to it. AcroExch.AVDoc.BringToFront() Technique Brings the window to the entrance. object.bringtofront() All the time returns true. AcroExch.AVDoc.ClearSelection() Technique Clears the present choice. object.clearselection() true if the choice was cleared, false in any other case. AcroExch.AVDoc.Shut() Technique Closes a doc. You’ll be able to shut all open AVDocs by calling App.CloseAllDocs(). object.shut( bnoclose ) bnoclose If true, the doc is closed with out saving it. If false and the doc has been modified, the person is requested whether or not or not the file ought to be saved. false if an error occurred whereas closing the file, true in any other case. Dani Vainstein Accessing PDF’s Web page 24 of 79

25 Chapter 16 Scripting Quicktest Skilled Web page 25 AcroExch.AVDoc.FindText() Technique Finds the desired textual content, scrolls in order that it’s seen, and highlights it. object.findtext( textual content, casesensitive, wholewordsonly, reset ) textual content casesensitive wholewordsonly reset The textual content that’s to be discovered. If true, the search is case-sensitive. If false, it’s caseinsensitive. If true, the search matches solely entire phrases. If false, it matches partial phrases. If true, the search begins on the primary web page of the doc. If false, it begins on the present web page. true if the textual content was discovered, false if it was not. Choice Express Dim AcroApp, AcroAVDoc Dim gpdfpath, breset, ncount gpdfpath = “C:QTTutorial.pdf” ‘ ** Initialize Acrobat by creating App object Set AcroApp = CreateObject( “AcroExch.App” ) ‘ ** show Acrobat AcroApp.Show() ‘ ** Set AVDoc object Set AcroAVDoc = CreateObject( “AcroExch.AVDoc” ) ‘ ** open the PDF If AcroAVDoc.Open( gpdfpath, ” ) Then AcroAVDoc.BringToFront() breset = True : ncount = 0 Do While AcroAVDoc.FindText( “Checkpoint”, True, True, breset ) breset = False : ncount = ncount + 1 Wait 0, 200 Loop AcroApp.CloseAllDocs() AcroApp.Exit() Print “The phrase ‘Checkpoint’ was discovered ” & ncount & ” instances.” Set AcroApp = Nothing Dani Vainstein Accessing PDF’s Page 25 of 79

26 Chapter 16 Scripting Quicktest Professional Page 26 AcroExch.AVDoc.GetAVPageView() Method Gets the AcroExch.AVPageView associated with an AcroExch.AVDoc. Set pageview = object.getavpageview() The AcroExch.AVPageView. AcroExch.AVDoc.GetFrame () Method Gets the rectangle specifying the window s size and location. Set frame = object.getframe() An AcroExch.Rect containing the frame. Option Explicit Dim AcroApp, AcroAVDoc, AcroFrame Dim gpdfpath gpdfpath = “C:QTTutorial.pdf” ‘ ** Initialize Acrobat by creating App object Set AcroApp = CreateObject( “AcroExch.App” ) ‘ ** show Acrobat AcroApp.Show() ‘ ** Set AVDoc object Set AcroAVDoc = CreateObject( “AcroExch.AVDoc” ) ‘ ** open the PDF If AcroAVDoc.Open( gpdfpath, ” ) Then AcroAVDoc.BringToFront() Set AcroFrame = AcroAVDoc.GetFrame() Print “Frame Left –> ” & AcroFrame.left Print “Frame Right –> ” & AcroFrame.proper Print “Frame Top –> ” & AcroFrame.high Print “Frame Bottom –> ” & AcroFrame.backside Dani Vainstein Accessing PDF’s Web page 26 of 79

Leave a Comment