data-id=ole-automation
OLE Automation
This chapter describes the objects, data types, and methods in the OLE automation interface.
The names AcroExch.App and AxAcroPDFLib.AxAcroPDF are the external strings OLE clients use to create objects of certain types. The Acrobat developer type libraries call them CAcro.App and AcroPDFLib, respectively.
Acrobat supports dual interfaces, so the methods all have a return type of HResult.
The following table summarizes the available objects and data types.
data-id=50532405_31190
data-id=acroexch-app
AcroExch.App
The Acrobat application itself. This is a creatable interface. From the application layer, you can control the appearance of Acrobat, whether Acrobat appears, and the size of the application window. This object provides access to the menu bar and the toolbar, as well as the visual representation of a PDF file on the screen (through an AVDoc object).
data-id=methods
Methods
The App object has the following methods.
AcroExch.AVDoc object via its index within the list of open AVDoc objects.IDispatch interface for a named object, typically a third-party plug-in.AcroExch.AVDoc objects.nType to the value stored at pVal.data-id=50532405_33231
data-id=closealldocs
CloseAllDocs
Closes all open documents. You can close each individual AVDoc object by calling AVDoc. Close.
You must explicitly close all documents or call App.CloseAllDocs. Otherwise, the process never exits.
Syntax
VARIANT_BOOL CloseAllDocs();
Returns
-1 if successful, 0 if not.
Related methods
AVDoc.CloseAVDoc.OpenAVDoc.OpenInWindowAVDoc.OpenInWindowExPDDoc.ClosePDDoc.OpenPDDoc.OpenAVDoc
data-id=50532405_24553
data-id=exit
Exit
Exits Acrobat. Applications should call App.Exit before exiting.
Note
Use
App.CloseAllDocs to close all the documents before calling this method.
Syntax
VARIANT_BOOL Exit();
Returns
Returns -1 if the entire shutdown process succeeded. This includes closing any open documents, releasing OLE references, and finally exiting the application. If any step fails, the function returns 0, and the application continues running. This method does not work if the application is visible (if the user is in control of the application). In such cases, if the Show method had previously been called, you can call Hide and then Exit.
Related methods
App.CloseAllDocs
data-id=50532405_36544
data-id=getactivedoc
GetActiveDoc
Gets the frontmost document.
Syntax
LPDISPATCH GetActiveDoc();
Returns
The LPDISPATCH for the frontmost AcroExch.AVDoc object. If there are no documents open, it returns NULL.
Related methods
App.GetAVDoc
data-id=50532405_26079
data-id=getactivetool
GetActiveTool
Gets the name of the currently active tool.
Syntax
BSTR GetActiveTool();
Returns
Returns NULL if there is no active tool. Returns the name of the currently active tool otherwise. See the PDF Library documentation for a list of tool names.
Related methods
App.SetActiveTool
data-id=50532405_26359
data-id=getavdoc
GetAVDoc
Gets an AcroExch.AVDoc object from its index within the list of open AVDoc objects. Use App. GetNumAVDocs to determine the number of AcroExch.AVDoc objects.
Syntax
LPDISPATCH GetAVDoc(long nIndex);
Parameters
Returns
The LPDISPATCH for the specified AcroExch.AVDoc document, or NULL if nIndex is greater than the number of open documents.
Related methods
App.GetActiveTool
data-id=50532405_24866
data-id=getframe
GetFrame
Gets the window’s frame.
GetFrame is not useful when the PDF file was opened with AVDoc. OpenInWindow. GetFrame returns the application window’s frame (not the document window’s frame). However, the application’s window is hidden when a document is opened using OpenInWindow, and does not change in size as document windows are moved and resized.
This method is also not useful if the Acrobat application is in single document interface (SDI) mode.
Syntax
LPDISPATCH GetFrame();
Returns
The LPDISPATCH for the window’s frame, specified as an AcroExch.Rect.
If the Acrobat application is in SDI mode, a [0,0,0,0] Rect is returned.
Related methods
data-id=50532405_91171
data-id=getinterface
GetInterface
Gets an IDispatch interface for a named object, typically a third-party plug-in. This is an entry point to functionality that is undefined and which must be provided by the plug-in author. If you are accessing third-party functionality through GetInterface, ask the author for additional information.
Syntax
LPDISPATCH GetInterface (BSTR szName);
Parameters
Returns
The LPDISPATCH for the objects’s interface or NULL if the object was not found.
data-id=50532405_84453
data-id=getlanguage
GetLanguage
Gets a code that specifies which language the Acrobat application’s user interface is using.
Syntax
BSTR GetLanguage();
Returns
String containing a three-letter language code. Must be one of the following:
- DEU-German
- ENU-English
- ESP-Spanish
- FRA-French
- ITA-Italian
- NLD-Dutch
- SVE-Swedish
Related methods
App.GetPreferenceApp.SetPreference
data-id=50532405_17689
data-id=getnumavdocs
GetNumAVDocs
Gets the number of open AcroExch.AVDoc objects. The maximum number of documents the Acrobat application can open at a time is specified by the avpMaxOpenDocuments preference, which can be obtained with App. GetPreferenceEx and set by App. SetPreferenceEx.
Syntax
long GetNumAVDocs();
Returns
The number of open AcroExch.AVDoc objects.
Related methods
App.GetActiveDocApp.GetAVDoc
data-id=50532405_36273
GetPreference
Note
This method is deprecated; use GetPreferenceEx instead.
GetPreferenceis unable to accept important data types such as strings, but GetPreferenceEx can convert many data types into acceptable formats.
Gets a value from the preferences file. Zoom values (used in avpDefaultZoomScale and avpMaxPageCacheZoom) are returned as percentages (for example, 1.00 is returned as 100). Colors (used in avpNoteColor – PDcolorValue) are automatically converted to RGB values from the representation used in the preferences file.
Syntax
long GetPreference(short nType);
Parameters
Returns
The value of the specified preference item.
Related methods
App.GetLanguageApp.SetPreference
data-id=50532405_13271
data-id=getpreferenceex
GetPreferenceEx
Gets the specified application preference, using the VARIANT type to pass values.
Syntax
VARIANT GetPreferenceEx(short nType);
Parameters
Returns
The value of the specified preference item.
Related methods
App.GetLanguageApp.SetPreferenceEx
data-id=50532405_35477
data-id=hide
Hide
Hides the Acrobat application. When the viewer is hidden, the user has no control over it, and the Acrobat application exits when the last automation object is closed.
Syntax
VARIANT_BOOL Hide();
Returns
-1 if successful, 0 if not.
Related methods
App.Show
data-id=50532405_19732
data-id=lock
Lock
Locks the Acrobat application. Typically, this method is called when using AVDoc. OpenInWindowEx to draw into another application’s window. If you call App.Lock, you should call App. UnlockEx when you are done using OLE automation.
There are some advantages and disadvantages of locking the viewer when using AVDoc. OpenInWindowEx. You must consider these before deciding whether to lock the viewer:
- Locking prevents problems that can sometimes occur if two processes are trying to open a file at the same time.
- Locking prevents a user from using Acrobat’s user interface (such as adding annotations) in your application’s window.
- Locking can prevent any other application, including the Acrobat application, from opening PDF files. This problem can be minimized by calling
App.UnlockEx as soon as the file has been opened.
Syntax
VARIANT_BOOL Lock(BSTR szLockedBy);
Parameters
Returns
-1 if the Acrobat application was locked successfully, 0 otherwise. Locking fails if the Acrobat application is visible.
Related methods
App.UnlockEx
data-id=50532405_95716
data-id=minimize
Minimize
Minimizes the Acrobat application.
Syntax
VARIANT_BOOL Minimize(long BMinimize);
Parameters
0, the Acrobat application is returned to its normal state.Returns
-1 if successful, 0 if not.
Related methods
data-id=50532405_28128
data-id=maximize
Maximize
Maximizes the Acrobat application.
Syntax
VARIANT_BOOL Maximize(long bMaximize);
Parameters
0, the Acrobat application is returned to its normal state.Returns
-1 if successful, 0 if not.
Related methods
data-id=50532405_17615
data-id=menuitemexecute
MenuItemExecute
Executes the menu item whose language-independent menu item name is specified.
Syntax
VARIANT_BOOL MenuItemExecute(BSTR szMenuItemName);
Parameters
Returns
Returns -1 if the menu item executes successfully, or 0 if the menu item is missing or is not enabled.
Related methods
App.MenuItemIsEnabledApp.MenuItemIsMarkedApp.MenuItemRemove
data-id=50532405_38263
data-id=menuitemisenabled
MenuItemIsEnabled
Determines whether the specified menu item is enabled.
Syntax
VARIANT_BOOL MenuItemIsEnabled(BSTR szMenuItemName);
Parameters
Returns
-1 if the menu item is enabled, 0 if it is disabled or does not exist.
Related methods
App.MenuItemExecuteApp.MenuItemIsMarkedApp.MenuItemRemove
data-id=50532405_31861
data-id=menuitemismarked
MenuItemIsMarked
Determines whether the specified menu item is marked.
Syntax
VARIANT_BOOL MenuItemIsMarked(BSTR szMenuItemName);
Parameters
Returns
-1 if the menu item is marked, 0 if it is not marked or does not exist.
Related methods
App.MenuItemExecuteApp.MenuItemIsEnabledApp.MenuItemRemove
data-id=50532405_28065
data-id=menuitemremove
MenuItemRemove
Removes the menu item whose language-independent menu item is specified.
Syntax
VARIANT_BOOL MenuItemRemove(BSTR szMenuItemName);
Parameters
Returns
-1 if the menu item was removed, 0 if the menu item does not exist.
Related methods
App.MenuItemExecuteApp.MenuItemIsEnabledApp.MenuItemIsMarked
data-id=50532405_61057
data-id=restore
Restore
Restores the main window of the Acrobat application. Calling this with bRestore set to a positive number causes the main window to be restored to its original size and position and to become active.
Syntax
VARIANT_BOOL Restore(long bRestore);
Parameters
0 otherwise.Returns
-1 if successful, 0 if not.
Related methods
data-id=50532405_34602
data-id=setactivetool
SetActiveTool
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).
Syntax
VARIANT_BOOL SetActiveTool(BSTR szButtonName,
long bPersistent);
Parameters
0 is specified, the Acrobat application reverts to the previously active tool after this tool is used once.Returns
-1 if the tool was set, 0 otherwise.
Related methods
App.GetActiveToolApp.ToolButtonIsEnabledApp.ToolButtonRemove
data-id=50532405_14415
data-id=setframe
SetFrame
Sets the window’s frame to the specified rectangle. This method has no effect if the Acrobat application is in single document interface (SDI) mode.
Syntax
VARIANT_BOOL SetFrame(LPDISPATCH iAcroRect);
Parameters
LPDISPATCH for an AcroExch.Rect specifying the window frame. iAcroRect contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
-1 if the frame was set, 0 if iAcroRect is not of type AcroExch.Rect.
Related methods
data-id=50532405_33867
data-id=setpreference
SetPreference
Note
This method is deprecated; use SetPreferenceEx instead.
SetPreferenceis unable to accept important data types such as strings, but SetPreferenceEx can convert many data types into acceptable formats.
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 (for example, 100 is automatically converted to 1.0). Colors (used in avpHighlightColor or avpNoteColor) are automatically converted from RGB values to the representation used in the preferences file.
Syntax
VARIANT_BOOL SetPreference(short nType, long nValue);
Parameters
Returns
-1 if successful, 0 if not.
Related methods
App.GetLanguageApp.GetPreferenceEx
data-id=50532405_91929
data-id=setpreferenceex
SetPreferenceEx
Sets the application preference specified by nType to the value stored at pVal. If pVal has a non-conforming VARTYPE, SetPreferenceEx performs type conversion. For example, a string representation of an integer is converted to an actual integer.
Syntax
VARIANT_BOOL SetPreferenceEx(short nType, VARIANT* pVal);
Parameters
Returns
Returns -1 if nType is a supported type or the type conversion is successful, 0 otherwise.
Related methods
App.GetLanguageApp.GetPreferenceEx
data-id=50532405_20395
data-id=show
Show
Shows the Acrobat application. When the viewer is shown, the user is in control, and the Acrobat application does not automatically exit when the last automation object is destroyed. However, it will exit if no documents are being displayed.
Syntax
VARIANT_BOOL Show();
Returns
-1 if successful, 0 if not.
Related methods
App.Hide
data-id=50532405_10079
data-id=toolbuttonisenabled
ToolButtonIsEnabled
Determines whether the specified toolbar button is enabled.
Syntax
VARIANT_BOOL ToolButtonIsEnabled(BSTR szButtonName);
Parameters
Returns
-1 if the button is enabled, 0 if it is not enabled or does not exist.
Related methods
App.GetActiveToolApp.SetActiveToolApp.ToolButtonRemove
data-id=50532405_31485
data-id=toolbuttonremove
ToolButtonRemove
Removes the specified button from the toolbar.
Syntax
VARIANT_BOOL ToolButtonRemove(BSTR szButtonName);
Parameters
Returns
-1 if the button was removed, 0 otherwise.
Related methods
App.GetActiveToolApp.SetActiveToolApp.ToolButtonIsEnabled
data-id=50532405_37485
data-id=unlock
Unlock
Note
In version 4.0 or later, use
App.UnlockEx instead.
Unlocks the Acrobat application if it was previously locked. This method clears a flag that indicates the viewer is locked. If you called App. Lock, you should call App.Unlock when you are done using OLE automation.
Use App. Lock and App . UnlockEx if you call OpenInWindow.
Typically, you call App. Lock when your application initializes and App.Unlock in your application’s destructor method.
Syntax
VARIANT_BOOL Unlock();
Returns
-1 if successful, 0 if not.
Related methods
data-id=50532405_30535
data-id=unlockex
UnlockEx
Unlocks the Acrobat application if it was previously locked.
Syntax
VARIANT_BOOL UnlockEx (BSTR szLockedBy);
Parameters
Returns
-1 if successful, 0 if not.
Related methods
App.Lock
data-id=50532405_36696
data-id=acroexch-avdoc
AcroExch.AVDoc
A view of a PDF document in a window. This is a creatable interface. There is one AVDoc object per displayed document. Unlike a PDDoc object, an AVDoc object has a window associated with it.
data-id=methods-1
data-id=id1
Methods
The AVDoc object has the following methods.
AcroExch.AVPageView associated with an AcroExch.AVDoc.AcroExch.PDDoc associated with an AcroExch.AVDoc.AcroExch.AVDoc is still valid.bMaxSize is a positive number.data-id=50532405_25352
data-id=bringtofront
BringToFront
Brings the window to the front.
Syntax
VARIANT_BOOL BringToFront();
Returns
Returns 0 if no document is open, -1 otherwise.
data-id=50532405_16710
data-id=clearselection
ClearSelection
Clears the current selection.
Syntax
VARIANT_BOOL ClearSelection();
Returns
Returns -1 if the selection was cleared, 0 if no document is open or the selection could not be cleared.
Related methods
AVDoc.SetTextSelectionAVDoc.ShowTextSelectPDDoc.CreateTextSelectPDPage.CreatePageHilitePDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_10907
data-id=close
Close
Closes a document. You can close all open AVDoc objects by calling App. CloseAllDocs.
To reuse an AVDoc object, close it with AVDoc. Close, then use the AVDoc object’s LPDISPATCH for AVDoc. OpenInWindow.
Syntax
VARIANT_BOOL Close(long bNoSave);
Parameters
0 and the document has been modified, the user is asked whether or not the file should be saved.Returns
Always returns -1, even if no document is open.
Related methods
App.CloseAllDocsAVDoc.OpenAVDoc.OpenInWindowAVDoc.OpenInWindowExPDDoc.ClosePDDoc.OpenPDDoc.OpenAVDoc
data-id=50532405_28644
data-id=findtext
FindText
Finds the specified text, scrolls so that it is visible, and highlights it.
Syntax
VARIANT_BOOL FindText(BSTR szText, long bCaseSensitive, long bWholeWordsOnly, long bReset);
Parameters
0, it is case-insensitive.0, it matches partial words.0, it begins on the current page.Returns
-1 if the text was found, 0 otherwise.
data-id=50532405_35375
data-id=getavpageview
GetAVPageView
Gets the AcroExch.AVPageView associated with an AcroExch.AVDoc.
Syntax
LPDISPATCH GetAVPageView();
Returns
The LPDISPATCH for the AcroExch.AVPageView or NULL if no document is open.
Related methods
AVDoc.GetPDDocAVDoc.SetViewModeAVPageView.GetAVDocAVPageView.GetDoc
data-id=50532405_28538
data-id=getframe-1
data-id=id2
GetFrame
Gets the rectangle specifying the window’s size and location.
Syntax
LPDISPATCH GetFrame();
Returns
The LPDISPATCH for an AcroExch.Rect containing the frame, or NULL if no document is open.
Related methods
AVDoc.SetFrame
data-id=50532405_25013
data-id=getpddoc
GetPDDoc
Gets the AcroExch.PDDoc associated with an AcroExch.AVDoc.
Syntax
LPDISPATCH GetPDDoc();
Returns
The LPDISPATCH for the AcroExch.PDDoc or NULL if no document is open.
Related methods
AVDoc.GetAVPageViewAVPageView.GetAVDocAVPageView.GetDoc
data-id=50532405_12179
data-id=gettitle
GetTitle
Gets the window’s title.
Syntax
BSTR GetTitle();
Returns
The window’s title or NULL if no document is open.
Related methods
data-id=50532405_29291
data-id=getviewmode
GetViewMode
Gets the current document view mode (pages only, pages and thumbnails, or pages and bookmarks).
Syntax
long GetViewMode();
Returns
The current document view mode or 0 if no document is open. The return value is one of the following:
PDDontCare:0: leave the view mode as it isPDUseNone:1: display without bookmarks or thumbnailsPDUseThumbs:2: display using thumbnailsPDUseBookmarks:3: display using bookmarksPDFullScreen:4: display in full screen mode
Related methods
AVDoc.GetAVPageViewAVDoc.SetViewMode
data-id=50532405_42634
data-id=isvalid
IsValid
Determines whether the AcroExch.AVDoc is still valid. This method only checks if the document has been closed or deleted; it does not check the internal structure of the document.
Syntax
VARIANT_BOOL IsValid();
Returns
-1 if the document can still be used, 0 otherwise.
Related methods
data-id=50532405_13863
data-id=maximize-1
data-id=id3
Maximize
Maximizes the window if bMaxSize is a positive number.
Syntax
VARIANT_BOOL Maximize(long bMaxSize);
Parameters
Returns
-1 if a document is open, 0 otherwise.
Related methods
data-id=50532405_23963
data-id=open
Open
Opens a file. A new instance of AcroExch.AVDoc must be created for each displayed PDF file.
Note
An application must explicitly close any
AVDocthat it opens by callingAVDoc.Close (the destructor for theAcroExch.AVDocclass does not callAVDoc.Close).
Syntax
VARIANT_BOOL Open(BSTR szFullPath, BSTR szTempTitle);
Parameters
szTempTitle is NULL or the empty string, it is ignored. Otherwise, szTempTitle is used as the window title.Returns
-1 if the file was opened successfully, 0 otherwise.
Related methods
App.CloseAllDocsAVDoc.CloseAVDoc.GetTitleAVDoc.OpenInWindowAVDoc.OpenInWindowExAVDoc.SetTitlePDDoc.ClosePDDoc.OpenPDDoc.OpenAVDoc
data-id=50532405_40575
data-id=openinwindow
OpenInWindow
Note
As of Acrobat 3.0, this method simply returns
false. Use the methodAVDoc.OpenInWindowEx instead.
Syntax
VARIANT_BOOL OpenInWindow(BSTR fileName, short hWnd);
Parameters
Returns
-1
Related methods
App.CloseAllDocsAVDoc.CloseAVDoc.OpenAVDoc.OpenInWindowExPDDoc.ClosePDDoc.OpenPDDoc.OpenAVDoc
data-id=50532405_22014
data-id=openinwindowex
OpenInWindowEx
Opens a PDF file and displays it in a user-specified window. The default Windows file system is used to open the file.
Note
Acrobat uses only its built-in implementation of the file opening code—not any replacement file system version that a developer might have added with a plug-in.
An application must explicitly close any AVDoc that it opens by calling AVDoc. Close (the destructor for the AcroExch.AVDoc class does not call AVDoc. Close).
Do not set the view mode to Close with AVDoc. SetViewMode when using AVDoc. OpenInWindowEx ; this will cause the viewer and application to hang.
If you use a view mode of AV_PAGE_VIEW, the pagemode parameter will be ignored.
See AVApp. Lock for a discussion of whether to lock the viewer before making this call.
Syntax
VARIANT_BOOL OpenInWindowEx(LPCTSTR szFullPath, long hWnd,
long openFlags, long useOpenParams
long pgNum, short pageMode,
short zoomType, long zoom, short top,
short left);
Parameters
AV_EXTERNAL_VIEW: Display the AVPageView, scrollbars, toolbar, and bookmark or thumbnails pane. Annotations are active. AV_DOC_VIEW: Display the AVPageView, scrollbars, and bookmark or thumbnails pane. Annotations are active. AV_PAGE_VIEW: Display only the AVPageView (the window that displays the PDF file). Do not display scrollbars, the toolbar, and bookmark or thumbnails pane. Annotations are active. - Use either AV_DOC_VIEW or AV_PAGE_VIEW whenever possible. Use AV_EXTERNAL_VIEW only if you do not want the application to display its own toolbar. Use AV_PAGE_VIEW to open the file with no scrollbars and no status window at the bottom of the page.0 indicates that the open action of the file is used; a positive number indicates that the action is overridden with the parameters that follow.useOpenParams is a positive number. The first page is zero.useOpenParams is a positive number. Possible values: PDDontCare: 0: leave the view mode as it is PDUseNone: 1: display without bookmarks or thumbnails PDUseThumbs: 2: display using thumbnails PDUseBookmarks: 3: display using bookmarks PDFullScreen: 4: display in full screen modeuseOpenParams is a positive number. Possible values are: AVZoomFitHeight: Fits the page’s height in the window. AVZoomFitPage: Fits the page in the window. AVZoomFitVisibleWidth: Fits the page’s visible content into the window. AVZoomFitWidth: Fits the page’s width into the window. AVZoomNoVary: A fixed zoom, such as 100%.AVZoomNoVary if useOpenParams is a positive number.AVZoomNoVary) if useOpenParams is a positive number. See the PDF Reference for information on views.AVZoomNoVary) if useOpenParams is a positive number. See the PDF Reference for information on views.Returns
-1 if the document was opened successfully, 0 otherwise.
Related methods
App.CloseAllDocsAVDoc.CloseAVDoc.OpenAVDoc.OpenInWindowPDDoc.ClosePDDoc.OpenPDDoc.OpenAVDoc
data-id=50532405_30920
data-id=printpages
PrintPages
Prints a specified range of pages displaying a print progress dialog box. PrintPages always uses the default printer setting. It is possible to create custom dialog boxes as shown in the ActiveViewVB sample. Such custom dialog boxes could be used in place of the print progress dialog box or any other dialog box.
Syntax
VARIANT_BOOL PrintPages(long nFirstPage,
long nLastPage,long nPSLevel,
long bBinaryOk, long bShrinkToFit);
Parameters
PDDoc object is page 0.2 and 3. If 2, PostScript Level 2 operators are used. If 3, PostScript Language Level 3 operators are also used.0, all data is encoded as 7-bit ASCII.0, it is not.Returns
0 if there were any exceptions while printing or if no document was open, -1 otherwise.
Related methods
AVDoc.PrintPagesExAVDoc.PrintPagesSilentAVDoc.PrintPagesSilentEx
data-id=50532405_37344
data-id=printpagesex
PrintPagesEx
Prints a specified range of pages, displaying a print progress dialog box. PrintPagesEx has more parameters than PrintPages. PrintPagesEx always uses the default printer setting. It is possible to create custom dialog boxes as shown in the ActiveViewVB sample. Such custom dialog boxes could be used in place of the print progress dialog box or any other dialog box.
Syntax
VARIANT_BOOL printPagesEx(long nFirstPage,long nLastPage,
long nPSLevel, long bBinaryOk,
long bShrinkToFit, long bReverse,
long bFarEastFontOpt, long bEmitHalftones,
long iPageOption);
Parameters
PDDoc object is page 0.2, PostScript Level 2 operators are used. If 3, PostScript Language Level 3 operators are also used.0, all data is encoded as 7-bit ASCII.0, it is not.0 otherwise.0, do not.PDAllPages, PDEvenPagesOnly, or PDOddPagesOnly.Returns
0 if there were any exceptions while printing or if no document was open, -1 otherwise.
Related methods
AVDoc.PrintPagesAVDoc.PrintPagesSilentAVDoc.PrintPagesSilentEx
data-id=50532405_16535
data-id=printpagessilent
PrintPagesSilent
Prints a specified range of pages without displaying any dialog box. This method is identical to AVDoc. PrintPages except for not displaying the dialog box. PrintPagesSilent always uses the default printer setting.
Syntax
VARIANT_BOOL PrintPagesSilent(long nFirstPage, long nLastPage,
long nPSLevel, long bBinaryOk,
long bShrinkToFit);
Parameters
PDDoc object is page 0.2, PostScript Level 2 operators are used. If 3, PostScript Language Level 3 operators are also used.0, all data is encoded as 7-bit ASCII.0, it is not.Returns
0 if there were any exceptions while printing or if no document was open, -1 otherwise.
Related methods
AVDoc.PrintPagesAVDoc.PrintPagesExAVDoc.PrintPagesSilentEx
data-id=50532405_38114
data-id=printpagessilentex
PrintPagesSilentEx
Prints a specified range of pages without displaying any dialog box. This method is identical to AVDoc. PrintPagesEx except for not displaying the dialog box. PrintPagesSilentEx has more parameters than PrintPagesSilent. PrintPagesSilentEx always uses the default printer setting.
Syntax
VARIANT_BOOL PrintPagesSilentEx(long nFirstPage,
long nLastPage,
long nPSLevel, long bBinaryOk,
long bShrinkToFit, long bReverse,
long bFarEastFontOpt,
long bEmitHalftones,
long iPageOption);
Parameters
2, PostScript Level 2 operators are used. If 3, PostScript Language Level 3 operators are also used.0, all data is encoded as 7-bit ASCII.0, it is not.0 otherwise.0, do not.PDAllPages, PDEvenPagesOnly, or PDOddPagesOnly.Returns
0 if there were any exceptions while printing, -1 otherwise.
Related methods
AVDoc.PrintPagesAVDoc.PrintPagesExAVDoc.PrintPagesSilentEx
data-id=50532405_14434
data-id=setframe-1
data-id=id4
SetFrame
Sets the window’s size and location.
Syntax
VARIANT_BOOL SetFrame(LPDISPATCH iAcroRect);
Parameters
LPDISPATCH for an AcroExch.Rect specifying the window frame. iAcroRect's instance variable m_lpDispatch contains this LPDISPATCH.Returns
Always returns -1.
Related methods
AVDoc.GetFrame
data-id=50532405_34749
data-id=settextselection
SetTextSelection
Sets the document’s selection to the specified text selection. Before calling this method, use one of the following to create the text selection:
PDDoc.CreateTextSelect : Creates from a rectangle.PDPage.CreatePageHilite : Creates from a list of character offsets and counts.PDPage.CreateWordHilite : Creates from a list of word offsets and counts.
After calling this method, use AVDoc. ShowTextSelect to show the selection.
Syntax
VARIANT_BOOL SetTextSelection(LPDISPATCH iAcroPDTextSelect);
Parameters
LPDISPATCH for the text selection to use. iAcroPDTextSelect contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
Returns -1 if successful. Returns 0 if no document is open or the LPDISPATCH is not a PDTextSelect object.
Related methods
AVDoc.ClearSelectionAVDoc.ShowTextSelectPDDoc.CreateTextSelectPDPage.CreatePageHilitePDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_28000
data-id=settitle
SetTitle
Sets the window’s title.
Syntax
VARIANT_BOOL SetTitle(BSTR szTitle);
Parameters
Returns
Returns 0 if no document is open, -1 otherwise.
Related methods
data-id=50532405_37022
data-id=setviewmode
SetViewMode
Sets the mode in which the document will be viewed (pages only, pages and thumbnails, or pages and bookmarks).
Syntax
VARIANT_BOOL SetViewMode(long nType);
Parameters
PDDontCare: 0: leave the view mode as it is PDUseNone: 1: display without bookmarks or thumbnails PDUseThumbs: 2: display using thumbnails PDUseBookmarks: 3: display using bookmarks.. note:: Do not set the view mode to Close with AVDoc.SetViewMode when using AVDoc.OpenInWindowEx ; this will cause the viewer and application to hang.Returns
0 if an error occurred while setting the view mode or if no document was open, -1 otherwise.
Related methods
AVDoc.GetAVPageViewAVDoc.GetViewMode
data-id=50532405_27147
data-id=showtextselect
ShowTextSelect
Changes the view so that the current text selection is visible.
Syntax
VARIANT_BOOL ShowTextSelect();
Returns
Returns 0 if no document is open, -1 otherwise.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionPDDoc.CreateTextSelectPDPage.CreatePageHilitePDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_13484
data-id=acroexch-avpageview
AcroExch.AVPageView
The area of the Acrobat application’s window that displays the contents of a document’s page. This is a non-creatable interface. Every AVDoc object has an AVPageView object and vice versa. The object provides access to the PDDoc and PDPage objects for the document being displayed.
data-id=methods-2
data-id=id5
Methods
The AVPageView object has the following methods.
AcroExch.AVDoc associated with the current page.AcroExch.PDDoc corresponding to the current page.AcroExch.PDPage corresponding to the current page.data-id=50532405_34128
data-id=devicepointtopage
DevicePointToPage
Converts the coordinates of a point from device space to user space.
Syntax
LPDISPATCH DevicePointToPage(LPDISPATCH iAcroPoint);
Parameters
LPDISPATCH for the AcroExch.Point whose coordinates are converted. iAcroPoint contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
The LPDISPATCH for an AcroExch.Point containing the converted coordinates.
Related methods
AVPageView.PointToDevice
data-id=50532405_27205
data-id=dogoback
DoGoBack
Goes to the previous view on the view history stack, if any.
Syntax
VARIANT_BOOL DoGoBack();
Returns
Always returns -1.
Related methods
AVPageView.DoGoForward
data-id=50532405_15639
data-id=dogoforward
DoGoForward
Goes to the next view on the view history stack, if any.
Syntax
VARIANT_BOOL DoGoForward();
Returns
Always returns -1.
Related methods
AVPageView.DoGoBack
data-id=50532405_17623
data-id=getaperture
GetAperture
Gets the aperture of the specified page view. The aperture is the rectangular region of the window in which the document is drawn, measured in device space units.
Syntax
CAcroRect* GetAperture();
Returns
A pointer to the aperture rectangle. Its coordinates are specified in device space.
Related methods
AVDoc.GetAVPageViewAVPageView.GetAVDocAVPageView.GetDocAVPageView.GetPageAVPageView.GetZoomType
data-id=50532405_35267
data-id=getavdoc-1
data-id=id6
GetAVDoc
Gets the AcroExch.AVDoc associated with the current page.
Syntax
LPDISPATCH GetAVDoc();
Returns
The LPDISPATCH for the AcroExch.AVDoc.
Related methods
AVDoc.GetAVPageViewAVDoc.GetPDDocAVPageView.GetDoc
data-id=50532405_11484
data-id=getdoc
GetDoc
Gets the AcroExch.PDDoc corresponding to the current page.
Syntax
LPDISPATCH GetDoc();
Returns
The LPDISPATCH for the AcroExch.PDDoc.
Related methods
AVDoc.GetAVPageViewAVDoc.GetPDDocAVPageView.GetAVDoc
data-id=50532405_11673
data-id=getpage
GetPage
Gets the AcroExch.PDPage corresponding to the current page.
Syntax
LPDISPATCH GetPage();
Returns
The LPDISPATCH for the AcroExch.PDPage.
Related methods
AVPageView.GetPageNumPDDoc.AcquirePagePDDoc.GetNumPagesPDPage.GetDocPDPage.GetNumberPDPage.GetRotatePDPage.GetSizePDTextSelect.GetPage
data-id=50532405_19046
data-id=getpagenum
GetPageNum
Gets the page number of the current page. The first page in a document is page zero.
Syntax
long GetPageNum();
Returns
The current page’s page number.
Related methods
AVPageView.GetPagePDDoc.AcquirePagePDDoc.GetNumPagesPDPage.GetDocPDPage.GetNumberPDPage.GetRotatePDPage.GetSizePDTextSelect.GetPage
data-id=50532405_27016
data-id=getzoom
GetZoom
Gets the current zoom factor, specified as a percent. For example, 100 is returned if the magnification is 1.0.
Syntax
long GetZoom();
Returns
The current zoom factor.
Related methods
App.GetPreferenceAVPageView.GetZoomTypeAVPageView.ZoomTo
data-id=50532405_24520
data-id=getzoomtype
GetZoomType
Gets the current zoom type.
Syntax
short GetZoomType();
Returns
Zoom type. The value is one of the following:
AVZoomFitHeight: Fits the page’s height in the window.AVZoomFitPage: Fits the page in the window.AVZoomFitVisibleWidth: Fits the page’s visible content into the window.AVZoomFitWidth: Fits the page’s width into the window.AVZoomNoVary: A fixed zoom, such as 100%.
Related methods
App.GetPreferenceAVPageView.GetZoomTypeAVPageView.ZoomTo
data-id=50532405_19981
data-id=goto
Goto
Goes to the specified page.
Syntax
VARIANT_BOOL GoTo(long nPage);
Parameters
PDDoc object is page 0.Returns
-1 if the Acrobat application successfully went to the page, 0 otherwise.
Related methods
AVPageView.DoGoBackAVPageView.DoGoForwardAVPageView.ReadPageDownAVPageView.ReadPageUpAVPageView.ScrollToAVPageView.ZoomTo
data-id=50532405_19347
data-id=pointtodevice
PointToDevice
Converts the coordinates of a point from user space to device space.
Note
Deprecated. Do not use this method.
Syntax
LPDISPATCH PointToDevice(LPDISPATCH iAcroPoint);
Parameters
LPDISPATCH for the AcroExch.Point whose coordinates are converted. iAcroPoint contains the instance variable m_lpDispatch, which contains this LPDISPATCH.Returns
The LPDISPATCH for an AcroExch.Point containing the converted coordinates.
Related methods
AVPageView.DevicePointToPage
data-id=50532405_20099
data-id=readpagedown
ReadPageDown
Scrolls forward through the document by one screen area.
Syntax
VARIANT_BOOL ReadPageDown();
Returns
Always returns -1.
Related methods
AVPageView.DoGoBackAVPageView.DoGoForwardAVPageView.GotoAVPageView.ReadPageUpAVPageView.ScrollToAVPageView.ZoomTo
data-id=50532405_41587
data-id=readpageup
ReadPageUp
Scrolls backward through the document by one screen area.
Syntax
VARIANT_BOOL ReadPageUp();
Returns
Always returns -1.
Related methods
AVPageView.DoGoBackAVPageView.DoGoForwardAVPageView.GotoAVPageView.ReadPageDownAVPageView.ScrollToAVPageView.ZoomTo
data-id=50532405_28175
data-id=scrollto
ScrollTo
Scrolls to the specified location on the current page.
Syntax
VARIANT_BOOL ScrollTo(short nX, short nY);
Parameters
Returns
-1 if the Acrobat application successfully scrolled to the specified location, 0 otherwise.
Related methods
AVPageView.DoGoBackAVPageView.DoGoForwardAVPageView.GotoAVPageView.ReadPageDownAVPageView.ReadPageUpAVPageView.ZoomTo
data-id=50532405_19513
data-id=zoomto
ZoomTo
Zooms to the specified magnification.
Syntax
VARIANT_BOOL ZoomTo(short nType, short nScale);
Parameters
AVZoomFitHeight: Fits the page’s height into the window. AVZoomFitPage: Fits the page into the window. AVZoomFitVisibleWidth: Fits the page’s visible content into the window. AVZoomFitWidth: Fits the page’s width into the window. AVZoomNoVary: A fixed zoom, such as 100%.Returns
-1 if the magnification was set successfully, 0 otherwise.
Related methods
AVPageView.GetZoomTypeAVPageView.GotoAVPageView.ScrollTo
data-id=50532405_39171
data-id=acroexch-hilitelist
AcroExch.HiliteList
A highlighted region of text in a PDF document, which may include one or more contiguous groups of characters or words on a single page. This is a creatable interface. This object has a single method, Add, and is used by the PDPage object to create PDTextSelect objects.
data-id=50532405_30712
data-id=add
Add
Adds the highlight specified by nOffset and nLength to the current highlight list. Highlight lists are used to highlight one or more contiguous groups of characters or words on a single page.
Highlight lists are used both for character-based and word-based highlighting, although a single highlight list cannot contain a mixture of character and word highlights. After creating a highlight list, use PDPage. CreatePageHilite or PDPage. CreateWordHilite (depending on whether the highlight list is used for characters or words) to create a text selection from the highlight list.
Syntax
VARIANT_BOOL Add(short nOffset, short nLength);
Parameters
Returns
Always returns -1.
Related methods
PDPage.CreatePageHilitePDPage.CreateWordHilite
data-id=50532405_42349
data-id=acroexch-pdannot
AcroExch.PDAnnot
An annotation on a page in a PDF file. This is a non-creatable interface. Acrobat applications have two built-in annotation types: PDTextAnnot and PDLinkAnnot. The object provides access to the physical attributes of the annotation. Plugins may add movie and Widget (form field) annotations, and developers can define new annotation subtypes by creating new annotation handlers.
data-id=methods-3
data-id=id7
Methods
The PDAnnot object has the following methods.
data-id=50532405_37589
data-id=getcolor
GetColor
Gets an annotation’s color.
Syntax
long GetColor();
Returns
The annotation’s color, a long value of the form 0x00BBGGRR where the first byte from the right (RR) is a relative value for red, the second byte (GG) is a relative value for green, and the third byte (BB) is a relative value for blue. The high-order byte must be 0.
Related methods
PDAnnot.SetColor
data-id=50532405_16450
data-id=getcontents
GetContents
Gets a text annotation’s contents.
Syntax
BSTR GetContents();
Returns
The annotation’s contents.
Related methods
PDAnnot.SetContentsPDAnnot.GetDatePDAnnot.GetRectPDAnnot.GetSubtypePDAnnot.GetTitle
data-id=50532405_41515
data-id=getdate
GetDate
Gets an annotation’s date.
Syntax
LPDISPATCH GetDate();
Returns
The LPDISPATCH for an AcroExch.Time object containing the date.
Related methods
PDAnnot.GetContentsPDAnnot.GetRectPDAnnot.GetSubtypePDAnnot.GetTitlePDAnnot.SetDate
data-id=50532405_19800
data-id=getrect
GetRect
Gets an annotation’s bounding rectangle.
Syntax
LPDISPATCH GetRect();
Returns
The LPDISPATCH for an AcroExch.Rect containing the annotation’s bounding rectangle.
Related methods
PDAnnot.GetContentsPDAnnot.GetDatePDAnnot.GetSubtypePDAnnot.GetTitlePDAnnot.SetRect
data-id=50532405_17093
data-id=getsubtype
GetSubtype
Gets an annotation’s subtype.
Syntax
BSTR GetSubtype();
Returns
The annotation’s subtype. The built-in subtypes are Text and Link.
Related methods
PDAnnot.GetContentsPDAnnot.GetDatePDAnnot.GetRectPDAnnot.GetTitle
data-id=50532405_14780
data-id=gettitle-1
data-id=id8
GetTitle
Gets a text annotation’s title.
Syntax
BSTR GetTitle();
Returns
The annotation’s title.
Related methods
PDAnnot.GetContentsPDAnnot.GetDatePDAnnot.GetRectPDAnnot.GetSubtypePDAnnot.SetTitle
data-id=50532405_41878
data-id=isequal
IsEqual
Determines whether an annotation is the same as the specified annotation.
Syntax
VARIANT_BOOL IsEqual(LPDISPATCH PDAnnot);
Parameters
LPDISPATCH for the AcroExch.PDAnnot to be tested. PDAnnot contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
-1 if the annotations are the same, 0 otherwise.
Related methods
PDAnnot.GetContentsPDAnnot.GetDatePDAnnot.GetRectPDAnnot.GetSubtypePDAnnot.GetTitlePDAnnot.IsOpenPDAnnot.IsValid
data-id=50532405_24800
data-id=isopen
IsOpen
Tests whether a text annotation is open.
Syntax
VARIANT_BOOL IsOpen();
Returns
-1 if open, 0 otherwise.
Related methods
PDAnnot.GetContentsPDAnnot.GetDatePDAnnot.GetRectPDAnnot.GetSubtypePDAnnot.GetTitlePDAnnot.IsEqualPDAnnot.IsValidPDAnnot.SetOpen
data-id=50532405_21326
data-id=isvalid-1
data-id=id9
IsValid
Tests whether an annotation is still valid. This method is intended only to test whether the annotation has been deleted, not whether it is a completely valid annotation object.
Syntax
VARIANT_BOOL IsValid();
Returns
-1 if the annotation is valid, 0 otherwise.
Related methods
PDAnnot.GetContentsPDAnnot.GetDatePDAnnot.GetRectPDAnnot.GetSubtypePDAnnot.GetTitlePDAnnot.IsEqualPDAnnot.IsOpen
data-id=50532405_37155
data-id=perform
Perform
Performs a link annotation’s action.
Syntax
VARIANT_BOOL Perform(LPDISPATCH iAcroAVDoc);
Parameters
LPDISPATCH for the AcroExch.AVDoc in which the annotation is located. iAcroAVDoc contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
-1 if the action was executed successfully, 0 otherwise.
Related methods
PDAnnot.IsValid
data-id=50532405_39464
data-id=setcolor
SetColor
Sets an annotation’s color.
Syntax
VARIANT_BOOL SetColor(long nRGBColor);
Parameters
Returns
-1 if the annotation’s color was set, 0 if the Acrobat application does not support editing.
nRGBColor is a long value with the form 0x00BBGGRR where the first byte from the right (RR) is a relative value for red, the second byte (GG) is a relative value for green, and the third byte (BB) is a relative value for blue. The high-order byte must be 0.
Related methods
PDAnnot.GetColorPDAnnot.SetContentsPDAnnot.SetDatePDAnnot.SetOpenPDAnnot.SetRectPDAnnot.SetTitle
data-id=50532405_22402
data-id=setcontents
SetContents
Sets a text annotation’s contents.
Syntax
VARIANT_BOOL SetContents(BSTR szContents);
Parameters
Returns
0 if the Acrobat application does not support editing, -1 otherwise.
Related methods
PDAnnot.GetContentsPDAnnot.SetColorPDAnnot.SetDatePDAnnot.SetOpenPDAnnot.SetRectPDAnnot.SetTitle
data-id=50532405_40644
data-id=setdate
SetDate
Sets an annotation’s date.
Syntax
VARIANT_BOOL SetDate(LPDISPATCH iAcroTime);
Parameters
LPDISPATCH for the date and time to use for the annotation. iAcroTime's instance variable m_lpDispatch contains this LPDISPATCH.Returns
-1 if the date was set, 0 if the Acrobat application does not support editing.
Related methods
PDAnnot.GetTitlePDAnnot.SetColorPDAnnot.SetContentsPDAnnot.SetOpenPDAnnot.SetRectPDAnnot.SetTitle
data-id=50532405_27381
data-id=setopen
SetOpen
Opens or closes a text annotation.
Syntax
VARIANT_BOOL SetOpen(long bIsOpen);
Parameters
0, the annotation is closed.Returns
Always returns -1.
Related methods
PDAnnot.IsOpenPDAnnot.SetColorPDAnnot.SetContentsPDAnnot.SetDatePDAnnot.SetRectPDAnnot.SetTitle
data-id=50532405_16563
data-id=setrect
SetRect
Sets an annotation’s bounding rectangle.
Syntax
VARIANT_BOOL SetRect(LPDISPATCH iAcroRect);
Parameters
LPDISPATCH for the bounding rectangle (AcroExch.Rect) to set. iAcroRect contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
-1 if a rectangle was supplied, 0 otherwise.
Related methods
PDAnnot.GetRectPDAnnot.SetColorPDAnnot.SetContentsPDAnnot.SetDatePDAnnot.SetOpenPDAnnot.SetTitle
data-id=50532405_37671
data-id=settitle-1
data-id=id10
SetTitle
Sets a text annotation’s title.
Syntax
VARIANT_BOOL SetTitle(BSTR szTitle);
Parameters
Returns
-1 if the title was set, 0 if the Acrobat application does not support editing.
Related methods
PDAnnot.GetByTitlePDAnnot.SetColorPDAnnot.SetContentsPDAnnot.SetDatePDAnnot.SetOpenPDAnnot.SetRect
data-id=50532405_29095
data-id=acroexch-pdbookmark
AcroExch.PDBookmark
A bookmark for a page in a PDF file. This is a creatable interface. Each bookmark has a title that appears on screen, and an action that specifies what happens when a user clicks on the bookmark.
Bookmarks can either be created interactively by the user through the Acrobat application’s user interface or programmatically generated. The typical action for a user-created bookmark is to move to another location in the current document, although any action can be specified. It is not possible to create a bookmark with OLE—only to destroy one.
data-id=methods-4
data-id=id11
Methods
The PDBookmark object has the following methods.
data-id=50532405_26583
data-id=destroy
Destroy
Destroys a bookmark.
Syntax
VARIANT_BOOL Destroy();
Returns
0 if the Acrobat application does not support editing (making it impossible to delete the bookmark), -1 otherwise.
Related methods
PDBookmark.IsValid
data-id=50532405_32270
data-id=getbytitle
GetByTitle
Gets the bookmark that has the specified title. The AcroExch.PDBookmark object is set to the specified bookmark as a side effect of the method; it is not the method’s return value. You cannot enumerate bookmark titles with this method.
Syntax
VARIANT_BOOL GetByTitle(LPDISPATCH iAcroPDDoc,
BSTR bookmarkTitle);
Parameters
LPDISPATCH for the document (AcroExch.PDDoc object) containing the bookmark. iAcroPDDoc contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
-1if the specified bookmark exists (the method determines this using thePDBookmark.IsValid method),0otherwise.
Related methods
Example
CAcroPDBookmark* bookmark = new CAcroPDBookmark;
bookmark->CreateDispatch("AcroExch.PDBookmark");
bookmark->GetByTitle(m_pAcroAVDoc->GetPDDoc(), "Name of Bookmark");
if (bookmark->IsValid())
bookmark->Perform(m_pAcroAVDoc->m_lpDispatch);
else
AfxMessageBox("Bookmark not valid");
data-id=50532405_15243
data-id=gettitle-2
data-id=id12
GetTitle
Gets a bookmark’s title.
Syntax
BSTR GetTitle();
Returns
The title.
Related methods
PDBookmark.GetByTitlePDBookmark.SetTitle
data-id=50532405_11084
data-id=isvalid-2
data-id=id13
IsValid
Determines whether the bookmark is valid. This method only checks whether the bookmark has been deleted; it does not thoroughly check the bookmark’s data structures.
Syntax
VARIANT_BOOL IsValid();
Returns
-1 if the bookmark is valid, 0 otherwise.
Related methods
PDBookmark.Destroy
Syntax
data-id=50532405_22695
data-id=perform-1
data-id=id14
Perform
Performs a bookmark’s action.
Syntax
VARIANT_BOOL Perform(LPDISPATCH iAcroAVDoc);
Parameters
LPDISPATCH for the AcroExch.AVDoc in which the bookmark is located. iAcroAVDoc contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
-1 if the action was executed successfully, 0 otherwise.
Related methods
PDBookmark.IsValid
data-id=50532405_16583
data-id=settitle-2
data-id=id15
SetTitle
Sets a bookmark’s title.
Syntax
VARIANT_BOOL SetTitle(BSTR szNewTitle);
Parameters
Returns
0 if the Acrobat application does not support editing, -1 otherwise.
Related methods
PDBookmark.GetByTitlePDBookmark.GetTitle
data-id=50532405_34812
data-id=acroexch-pddoc
AcroExch.PDDoc
The underlying PDF representation of a document. This is a creatable interface. There is a correspondence between a PDDoc object and an ASFile object (an opaque representation of an open file made available through an interface encapsulating Acrobat’s access to file services), and the PDDoc object is the hidden object behind every AVDoc object. An ASFile object may have zero or more underlying files, so a PDF file does not always correspond to a single disk file. For example, an ASFile object may provide access to PDF data in a database.
Through PDDoc objects, your application can perform most of the Document menu items from Acrobat (delete pages, replace pages, and so on), create and delete thumbnails, and set and retrieve document information fields.
data-id=methods-5
data-id=id16
Methods
The PDDoc object has the following methods.
AcroExch.PDDoc.AcroExch.PDDoc.Info dictionary.Info dictionary.data-id=50532405_25809
data-id=acquirepage
AcquirePage
Acquires the specified page.
Syntax
LPDISPATCH AcquirePage(long nPage);
Parameters
Returns
The LPDISPATCH for the AcroExch.PDPage object for the acquired page. Returns NULL if the page could not be acquired.
Related methods
AVPageView.GetPageAVPageView.GetPageNumPDDoc.GetNumPagesPDPage.GetDocPDPage.GetNumberPDPage.GetRotatePDPage.GetSizePDTextSelect.GetPage
data-id=50532405_39995
data-id=clearflags
ClearFlags
Clears a document’s flags. The flags indicate whether the document has been modified, whether the document is a temporary document and should be deleted when closed, and the version of PDF used in the file. This method can be used only to clear, not to set, the flag bits.
Syntax
VARIANT_BOOL ClearFlags(long nFlags);
Parameters
PDDoc. GetFlags for a description of the flags. The flags PDDocWasRepaired, PDDocNewMajorVersion, PDDocNewMinorVersion, and PDDocOldVersion are read-only and cannot be cleared.Returns
Always returns -1.
Related methods
data-id=50532405_37346
data-id=close-1
data-id=id17
Close
Closes a file.
Note
If
PDDocandAVDocare constructed with the same file,PDDoc.Closedestroys both objects (which closes the document in the viewer).
Syntax
VARIANT_BOOL Close();
Returns
-1 if the document was closed successfully, 0 otherwise.
Related methods
App.CloseAllDocsAVDoc.CloseAVDoc.OpenAVDoc.OpenInWindowAVDoc.OpenInWindowExPDDoc.OpenPDDoc.OpenAVDoc
data-id=50532405_58029
data-id=create
Create
Creates a new AcroExch.PDDoc.
Syntax
VARIANT_BOOL Create();
Returns
-1 if the document is created successfully, 0 if it is not or if the Acrobat application does not support editing.
data-id=50532405_34819
data-id=createtextselect
CreateTextSelect
Creates a text selection from the specified rectangle on the specified page. After creating the text selection, use the AVDoc. SetTextSelection method to use it as the document’s selection, and use AVDoc. ShowTextSelect to show the selection.
Syntax
LPDISPATCH CreateTextSelect(long nPage, LPDISPATCH iAcroRect);
Parameters
PDDoc object is page 0.LPDISPATCH for the AcroExch.Rect enclosing the region to select. iAcroRect contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
The LPDISPATCH for an AcroExch.PDTextSelect containing the text selection. Returns NULL if the text selection was not created successfully.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectPDPage.CreatePageHilitePDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_27374
data-id=createthumbs
CreateThumbs
Creates thumbnail images for the specified page range in a document.
Syntax
VARIANT_BOOL CreateThumbs(long nFirstPage, long nLastPage);
Parameters
PDDoc object is page 0.Returns
-1 if thumbnail images were created successfully, 0 if they were not or if the Acrobat application does not support editing.
Related methods
PDDoc.DeleteThumbs
data-id=50532405_22406
data-id=croppages
CropPages
Crops the pages in a specified range in a document. This method ignores the request if either the width or height of the crop box is less than 72 points (one inch).
Syntax
VARIANT_BOOL CropPages(long nStartPage, long nEndPage,
short nEvenOrOddPagesOnly,
LPDISPATCH iAcroRect);
Parameters
PDDoc object is page 0.0: crop all pages in the range 1: crop only odd pages in the range 2: crop only even pages in the rangeLPDISPATCH for a CAcroRect specifying the cropping rectangle, which is specified in user space.Returns
-1 if the pages were cropped successfully, 0 otherwise.
Related methods
PDPage.CropPages
data-id=50532405_13365
data-id=deletepages
DeletePages
Deletes pages from a file.
Syntax
VARIANT_BOOL DeletePages(long nStartPage, long nEndPage);
Parameters
PDDoc object is page 0.Returns
-1 if the pages were successfully deleted. Returns 0 if they were not or if the Acrobat application does not support editing.
Related methods
PDDoc.AcquirePagePDDoc.DeletePagesPDDoc.GetNumPagesPDDoc.InsertPagesPDDoc.MovePagePDDoc.ReplacePages
data-id=50532405_37375
data-id=deletethumbs
DeleteThumbs
Deletes thumbnail images from the specified pages in a document.
Syntax
VARIANT_BOOL DeleteThumbs(long nStartPage, long nEndPage);
Parameters
PDDoc object is page 0.Returns
-1 if the thumbnails were deleted, 0 if they were not deleted or if the Acrobat application does not support editing.
Related methods
PDDoc.CreateThumbs
data-id=50532405_30617
data-id=getfilename
GetFileName
Gets the name of the file associated with this AcroExch.PDDoc.
Syntax
BSTR GetFileName();
Returns
The file name, which can currently contain up to 256 characters.
Related methods
PDDoc.Save
data-id=50532405_24732
data-id=getflags
GetFlags
Gets a document’s flags. The flags indicate whether the document has been modified, whether the document is a temporary document and should be deleted when closed, and the version of PDF used in the file.
Syntax
long GetFlags();
Returns
The document’s flags, containing an OR of the following:
PDSaveFull.Related methods
PDDoc.ClearFlagsPDDoc.SetFlags
data-id=50532405_19753
data-id=getinfo
GetInfo
Gets the value of a specified key in the document’s Info dictionary. A maximum of 512 bytes are returned.
Syntax
BSTR GetInfo(BSTR szInfoKey);
Parameters
Returns
The string if the value was read successfully. Returns an empty string if the key does not exist or its value cannot be read.
Related methods
PDDoc.SetInfo
data-id=50532405_27536
data-id=getinstanceid
GetInstanceID
Gets the instance ID (the second element) from the ID array in the document’s trailer.
Syntax
BSTR GetInstanceID();
Returns
A string whose maximum length is 32 characters, containing the document’s instance ID.
Related methods
PDDoc.GetPermanentID
data-id=50532405_28442
data-id=getjsobject
GetJSObject
Gets a dual interface to the JavaScript object associated with the PDDoc. This allows automation clients full access to both built-in and user-defined JavaScript methods available in the document.
Syntax
LDispatch* GetJSObject();
Returns
The interface to the JavaScript object if the call succeeded, NULL otherwise.
data-id=50532405_30052
data-id=getnumpages
GetNumPages
Gets the number of pages in a file.
Syntax
long GetNumPages();
Returns
The number of pages, or -1 if the number of pages cannot be determined.
Related methods
AVPageView.GetPageAVPageView.GetPageNumPDDoc.AcquirePagePDPage.GetNumberPDTextSelect.GetPage
data-id=50532405_27507
data-id=getpagemode
GetPageMode
Gets a value indicating whether the Acrobat application is currently displaying only pages, pages and thumbnails, or pages and bookmarks.
Syntax
long GetPageMode();
Returns
The current page mode. Will be one of the following values:
PDDontCare:0: leave the view mode as it isPDUseNone:1: display without bookmarks or thumbnailsPDUseThumbs:2: display using thumbnailsPDUseBookmarks:3: display using bookmarksPDFullScreen:4: display in full screen mode
Related methods
PDDoc.SetPageMode
data-id=50532405_36645
data-id=getpermanentid
GetPermanentID
Gets the permanent ID (the first element) from the ID array in the document’s trailer.
Syntax
BSTR GetPermanentID();
Returns
A string whose maximum length is 32 characters, containing the document’s permanent ID.
Related methods
PDDoc.GetInstanceID
data-id=50532405_16929
data-id=insertpages
InsertPages
Inserts the specified pages from the source document after the indicated page within the current document.
Syntax
VARIANT_BOOL InsertPages(long nInsertPageAfter,
LPDISPATCH iPDDocSource,long nStartPage,
long nNumPages, long bBookmarks);
Parameters
PDDoc object is page 0.LPDISPATCH for the AcroExch.PDDoc containing the pages to insert. iPDDocSource contains the instance variable m_lpDispatch, which contains the LPDISPATCH.iPDDocSource to be inserted into the current document.0, they are not.Returns
-1 if the pages were successfully inserted. Returns 0 if they were not or if the Acrobat application does not support editing.
Related methods
PDDoc.AcquirePagePDDoc.DeletePagesPDDoc.GetNumPagesPDDoc.MovePagePDDoc.ReplacePages
data-id=50532405_35068
data-id=movepage
MovePage
Moves a page to another location within the same document.
Syntax
VARIANT_BOOL MovePage(long nMoveAfterThisPage,
long nPageToMove);
Parameters
PDDoc object is page 0.Returns
0 if the Acrobat application does not support editing, -1 otherwise.
Related methods
PDDoc.AcquirePagePDDoc.DeletePagesPDDoc.GetNumPagesPDDoc.InsertPagesPDDoc.ReplacePages
data-id=50532405_41972
data-id=open-1
data-id=id18
Open
Opens a file. A new instance of AcroExch.PDDoc must be created for each open PDF file.
Syntax
VARIANT_BOOL Open(BSTR szFullPath);
Parameters
Returns
-1 if the document was opened successfully, 0 otherwise.
Related methods
App.CloseAllDocsAVDoc.CloseAVDoc.OpenAVDoc.OpenInWindowAVDoc.OpenInWindowExPDDoc.ClosePDDoc.OpenAVDoc
data-id=50532405_14888
data-id=openavdoc
OpenAVDoc
Opens a window and displays the document in it.
Syntax
LPDISPATCH OpenAVDoc(BSTR szTitle);
Parameters
szTitle is NULL or an empty string.Returns
The LPDISPATCH for the AcroExch.AVDoc that was opened, or NULL if the open fails.
Related methods
App.CloseAllDocsAVDoc.CloseAVDoc.GetTitleAVDoc.OpenAVDoc.OpenInWindowAVDoc.OpenInWindowExAVDoc.SetTitlePDDoc.ClosePDDoc.Open
data-id=50532405_40109
data-id=replacepages
ReplacePages
Replaces the indicated pages in the current document with those specified from the source document. No links or bookmarks are copied from iPDDocSource, but text annotations may optionally be copied.
Syntax
VARIANT_BOOL ReplacePages(long nStartPage,
LPDISPATCH iPDDocSource,
long nStartSourcePage, long nNumPages,
long bMergeTextAnnotations);
Parameters
PDDoc object is page 0.LPDISPATCH for the AcroExch.PDDoc containing the new copies of pages that are replaced. iPDDocSource contains the instance variable m_lpDispatch, which contains the LPDISPATCH.iPDDocSource to use as a replacement page.iPDDocSource are copied. If 0, they are not.Returns
-1 if the pages were successfully replaced. Returns 0 if they were not or if the Acrobat application does not support editing.
Related methods
PDDoc.AcquirePagePDDoc.DeletePagesPDDoc.GetNumPagesPDDoc.InsertPagesPDDoc.MovePage
data-id=50532405_28634
data-id=save
Save
Saves a document.
Syntax
VARIANT_BOOL Save(short nType, BSTR szFullPath);
Parameters
nType is a logical OR of one or more of the following flags: PDSaveIncremental: Write changes only, not the complete file. This will always result in a larger file, even if objects have been deleted. PDSaveFull: Write the entire file to the filename specified by szFullPath. PDSaveCopy: Write a copy of the file into the file specified by szFullPath, but keep using the old file. This flag can only be specified if PDSaveFull is also used. PDSaveCollectGarbage: Remove unreferenced objects; this often reduces the file size, and its usage is encouraged. This flag can only be specified if PDSaveFull is also used. PDSaveLinearized: Save the file optimized for the web, providing hint tables. This allows the PDF file to be byte-served. This flag can only be specified if PDSaveFull is also used. - If you save a file optimized for the web using the PDSaveLinearized flag, you must follow this sequence: 1. Open the PDF file with PDDoc. Open. 2. Call PDDoc. Save using the PDSaveLinearized flag. 3. Call PDDoc. Close. This allows batch optimization of files.Returns
-1 if the document was successfully saved. Returns 0 if it was not or if the Acrobat application does not support editing.
Related methods
PDDoc.GetFileName
data-id=50532405_31111
data-id=setflags
SetFlags
Sets a document’s flags indicating whether the document has been modified, whether the document is a temporary document and should be deleted when closed, and the version of PDF used in the file. This method can be used only to set, not to clear, the flag bits.
Syntax
VARIANT_BOOL SetFlags(long nFlags);
Parameters
PDDoc. GetFlags for a description of the flags. The flags PDDocWasRepaired, PDDocNewMajorVersion, PDDocNewMinorVersion, and PDDocOldVersion are read-only and cannot be set.Returns
Always returns -1.
Related methods
PDDoc.ClearFlagsPDDoc.GetFlags
data-id=50532405_42162
data-id=setinfo
SetInfo
Sets the value of a key in a document’s Info dictionary.
Syntax
VARIANT_BOOL SetInfo(BSTR szInfoKey, BSTR szBuffer);
Parameters
Returns
-1 if the value was added successfully, 0 if it was not or if the Acrobat application does not support editing.
Related methods
PDDoc.GetInfo
data-id=50532405_34412
SetPageMode
Sets the page mode in which a document is to be opened: display only pages, pages and thumbnails, or pages and bookmarks.
Syntax
VARIANT_BOOL SetPageMode(long nPageMode);
Parameters
PDDontCare: 0: leave the view mode as it is PDUseNone: 1: display without bookmarks or thumbnails PDUseThumbs: 2: display using thumbnails PDUseBookmarks: 3: display using bookmarksReturns
Always returns -1.
Related methods
PDDoc.GetPageModePDDoc.SetPageMode
data-id=50532405_28781
data-id=acroexch-pdpage
AcroExch.PDPage
A single page in the PDF representation of a document. This is a non-creatable interface. Just as PDF files are partially composed of their pages, PDDoc objects are composed of PDPage objects. A page contains a series of objects representing the objects drawn on the page (PDGraphic objects), a list of resources used in drawing the page, annotations (PDAnnot objects), an optional thumbnail image of the page, and the threads used in any articles that occur on the page. The first page in a PDDoc object is page 0.
data-id=methods-6
data-id=id19
Methods
The PDPage object has the following methods.
hWnd or hDC from the client.AcroExch.PDDoc associated with the page.data-id=50532405_29239
data-id=addannot
AddAnnot
Adds a specified annotation at a specified location in the page’s annotation array.
Syntax
VARIANT_BOOL AddAnnot(long nIndexAddAfter,
LPDISPATCH iPDAnnot);
Parameters
LPDISPATCH for the AcroExch.PDAnnot to add. iPDAnnot contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
0 if the Acrobat application does not support editing, -1 otherwise.
Related methods
PDPage.AddNewAnnotPDPage.RemoveAnnot
data-id=50532405_27501
data-id=addnewannot
AddNewAnnot
Creates a new text annotation and adds it to the page.
The newly-created text annotation is not complete until PDAnnot. SetContents has been called to fill in the /Contents key.
Syntax
LPDISPATCH AddNewAnnot(long nIndexAddAfter, BSTR szSubType,
LPDISPATCH iAcroRect);
Parameters
LPDISPATCH for the AcroExch.Rect bounding the annotation’s location on the page. iAcroRect contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
The LPDISPATCH for an AcroExch.PDAnnot object, or NULL if the annotation could not be added.
Related methods
PDAnnot.SetContentsPDPage.AddAnnotPDPage.RemoveAnnot
data-id=50532405_24289
data-id=copytoclipboard
CopyToClipboard
Copies a PDF image to the clipboard without requiring an hWnd or hDC from the client. This method is only available on 32-bit systems.
Syntax
VARIANT_BOOL CopyToClipboard(LPDISPATCH boundRect,
short nXOrigin,short nYOrigin,
short nZoom);
Parameters
LPDISPATCH for the AcroExch.Rect bounding rectangle in device space coordinates. boundRect contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
-1 if the page is successfully copied, 0 otherwise.
Related methods
PDPage.DrawEx
data-id=50532405_37822
data-id=createpagehilite
CreatePageHilite
Creates a text selection from a list of character offsets and character counts on a single page. The text selection can then be set as the current selection using AVDoc. SetTextSelection, and the view can be set to show the selection using AVDoc. ShowTextSelect.
Syntax
LPDISPATCH CreatePageHilite(LPDISPATCH iAcroHiliteList);
Parameters
LPDISPATCH for the highlight list for which a text selection is created. iAcroHiliteList contains the instance variable m_lpDispatch, which contains the LPDISPATCH. Use HiliteList. Add to create a highlight list.Returns
The LPDISPATCH for the AcroExch.PDTextSelect containing the text selection, or NULL if the selection could not be created.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectHiliteList.AddPDDoc.CreateTextSelectPDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_14477
data-id=createwordhilite
CreateWordHilite
Creates a text selection from a list of word offsets and word counts on a single page. The text selection can then be set as the current selection using AVDoc. SetTextSelection, and the view can be set to show the selection using AVDoc. ShowTextSelect.
Syntax
LPDISPATCH CreateWordHilite(LPDISPATCH iAcroHiliteList);
Parameters
LPDISPATCH for the highlight list for which a text selection is created. iAcroHiliteList contains the instance variable m_lpDispatch, which contains the LPDISPATCH. Use HiliteList. Add to create a highlight list.Returns
The LPDISPATCH for the AcroExch.PDTextSelect, or NULL if the selection could not be created.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectHiliteList.AddPDDoc.CreateTextSelectPDPage.CreatePageHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_26025
data-id=croppage
CropPage
Crops the page. This method ignores the request if either the width or height of the crop box is less than 72 points (one inch).
Syntax
VARIANT_BOOL CropPage(LPDISPATCH iAcroRect);
Parameters
LPDISPATCH for a CAcroRect specifying the cropping rectangle, which is specified in user space.Returns
-1 if the page was cropped successfully, 0 otherwise.
Related methods
PDDoc.CropPages
data-id=50532405_24561
data-id=draw
Draw
Note
Deprecated. As of Acrobat 3.0, this method simply returns
false. Use the methodAVDoc.DrawEx instead.
Syntax
VARIANT_BOOL Draw(short window, short displayContext,
short XOrigin,short YOrigin, short zoom);
Parameters
HWND into which the page is to be drawn.hDC to use for drawing. If NULL, the HDC for window is used. displayContext cannot be reliably used as the hDC for a printer device. In particular, Visual Basic applications cannot use Draw to print.Returns
-1 if the page is successfully drawn, 0 otherwise.
Related methods
PDPage.CopyToClipboardPDPage.DrawEx
data-id=50532405_35894
data-id=drawex
DrawEx
Draws page contents into a specified window.
You can use PDPage. CopyToClipboard to copy page contents to the clipboard without an hWnd or hDC from the client.
Syntax
VARIANT_BOOL DrawEx(long window, long displayContext,
LPDISPATCH updateRect, short xOrigin,
short yOrigin, short zoom);
Parameters
HWND) into which the page is drawn.NULL value. If it is not assigned NULL, an exception is thrown. - displayContext cannot be reliably used as the hDC for a printer device. In particular, Visual Basic applications cannot use DrawEx to print.LPDISPATCH for an AcroExch.Rect to be drawn with user space coordinates. updateRect contains the instance variable m_lpDispatch, which contains the LPDISPATCH. Any objects outside of updateRect are not drawn. All objects are drawn if updateRect is NULL. Use methods in the CAcroRect class to set the size of the rectangle. For example: CAcroRect* rect = new CAcroRect; rect->CreateDispatch("AcroExch.Rect", &e); if (rect) { /* Set values for rect - increases from right to left and bottom to top */ rect->SetLeft(100); rect->SetTop(400); rect->SetRight(400); rect->SetBottom(100); }Returns
A positive number if the page is successfully drawn, 0 otherwise.
Related methods
PDPage.CopyToClipboard
data-id=50532405_15604
data-id=getannot
GetAnnot
Gets the specified annotation from the page’s array of annotations.
Syntax
LPDISPATCH GetAnnot(long nIndex);
Parameters
Returns
The LPDISPATCH for the AcroExch.PDAnnot object.
Related methods
PDPage.GetAnnotIndexPDPage.GetNumAnnots
data-id=50532405_12469
data-id=getannotindex
GetAnnotIndex
Gets the index (within the page’s annotation array) of the specified annotation.
Syntax
long GetAnnotIndex(LPDISPATCH iPDAnnot);
Parameters
LPDISPATCH for the AcroExch.PDAnnot whose index is obtained. iPDAnnot contains the instance variable m_lpDispatch, which contains the LPDISPATCH.Returns
The annotation’s index.
Related methods
PDPage.GetAnnotPDPage.GetNumAnnots
data-id=50532405_40890
data-id=getdoc-1
data-id=id20
GetDoc
Gets the AcroExch.PDDoc associated with the page.
Syntax
LPDISPATCH GetDoc();
Returns
The LPDISPATCH for the page’s AcroExch.PDDoc.
Related methods
AVPageView.GetPageAVPageView.GetPageNumPDDoc.AcquirePagePDDoc.GetNumPagesPDPage.GetNumberPDPage.GetRotatePDPage.GetSizePDTextSelect.GetPage
data-id=50532405_24017
data-id=getnumannots
GetNumAnnots
Gets the number of annotations on the page.
Annotations that have associated pop-up windows, such as a strikeout, count as two annotations. Also note that widget annotations (Acrobat form fields) are included.
Syntax
long GetNumAnnots();
Returns
The number of annotations on the page.
Related methods
PDPage.GetAnnotPDPage.GetAnnotIndex
data-id=50532405_32146
data-id=getnumber
GetNumber
Gets the page number of the current page. The first page in a document is page zero.
Syntax
long GetNumber();
Returns
The page number of the current page. The first page in a PDDoc object is page 0.
Related methods
AVPageView.GetPageAVPageView.GetPageNumPDDoc.AcquirePagePDDoc.GetNumPagesPDPage.GetDocPDPage.GetRotatePDPage.GetSizePDTextSelect.GetPage
data-id=50532405_14436
data-id=getrotate
GetRotate
Gets the rotation value, in degrees, for the current page.
Syntax
short GetRotate();
Returns
Rotation value.
Related methods
AVPageView.GetPageAVPageView.GetPageNumPDDoc.AcquirePagePDPage.GetNumberPDPage.GetSizePDPage.SetRotatePDTextSelect.GetPage
data-id=50532405_37312
data-id=getsize
GetSize
Gets a page’s width and height in points.
Syntax
LPDISPATCH GetSize();
Returns
The LPDISPATCH for an AcroExch.Point containing the width and height, measured in points. Point x contains the width, point y the height.
Related methods
AVPageView.GetPageAVPageView.GetPageNumPDDoc.AcquirePagePDPage.GetNumberPDPage.GetRotatePDTextSelect.GetPage
data-id=50532405_26919
data-id=removeannot
RemoveAnnot
Removes the specified annotation from the page’s annotation array.
Syntax
VARIANT_BOOL RemoveAnnot(long nIndex);
Parameters
Returns
0 if the Acrobat application does not support editing, a positive number otherwise.
Related methods
PDPage.AddAnnotPDPage.AddNewAnnotPDPage.GetAnnotIndex
data-id=50532405_33224
data-id=setrotate
SetRotate
Sets the rotation, in degrees, for the current page.
Syntax
VARIANT_BOOL SetRotate(short nRotate);
Parameters
Returns
0 if the Acrobat application does not support editing, -1 otherwise.
Related methods
PDPage.GetRotate
data-id=50532405_33981
data-id=acroexch-pdtextselect
AcroExch.PDTextSelect
A selection of text on a single page that may contain more than one disjointed group of words. This is a non-creatable interface. A text selection is specified by one or more ranges of text, with each range containing the word numbers of the selected words. Each range specifies a start and end word, where “start” is the number of the first word of a series of selected words and “end” is the number of the next word after the last word in the selection.
data-id=methods-7
data-id=id21
Methods
The PDTextSelect object has the following methods.
data-id=50532405_15686
data-id=destroy-1
data-id=id22
Destroy
Destroys a text selection object.
Syntax
VARIANT_BOOL Destroy();
Returns
Always returns -1.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectPDDoc.CreateTextSelectPDPage.CreatePageHilitePDPage.CreateWordHilitePDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_15335
data-id=getboundingrect
GetBoundingRect
Gets a text selection’s bounding rectangle.
Syntax
LPDISPATCH GetBoundingRect();
Returns
The LPDISPATCH for an AcroExch.Rect corresponding to the text selection’s bounding rectangle.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectPDDoc.CreateTextSelectPDPage.CreatePageHilitePDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetNumTextPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_40099
data-id=getnumtext
GetNumText
Gets the number of text elements in a text selection. Use this method to determine how many times to call the PDTextSelect. GetText method to obtain all of a text selection’s text.
Note
A text element is not necessarily a word. A text element consists of characters of the same font, size and style; therefore, there may be more than one text element in a word.
Syntax
long GetNumText();
Returns
The number of elements in the text selection.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectPDDoc.CreateTextSelectPDPage.CreatePageHilitePDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetPagePDTextSelect.GetText
data-id=50532405_34289
data-id=getpage-1
data-id=id23
GetPage
Gets the page number on which the text selection is located.
Syntax
long GetPage();
Returns
The text selection’s page number. The first page in a PDDoc object is page 0.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectAVPageView.GetPageAVPageView.GetPageNumPDDoc.CreateTextSelectPDDoc.GetNumPagesPDPage.CreatePageHilitePDPage.CreateWordHilitePDPage.GetNumberPDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetText
data-id=50532405_24003
data-id=gettext
GetText
Gets the text from the specified element of a text selection. To obtain all the text within the text selection, use PDTextSelect. GetNumText to determine the number of elements in the text selection, then call this method in a loop to obtain each of the elements.
Syntax
BSTR GetText(long nTextIndex);
Parameters
Returns
The text, or an empty string if nTextIndex is greater than the number of elements in the text selection.
Related methods
AVDoc.ClearSelectionAVDoc.SetTextSelectionAVDoc.ShowTextSelectPDPage.CreatePageHilitePDDoc.CreateTextSelectPDPage.CreateWordHilitePDTextSelect.DestroyPDTextSelect.GetBoundingRectPDTextSelect.GetNumTextPDTextSelect.GetPage
data-id=50532405_76536
data-id=acroexch-point
AcroExch.Point
Defines the location of an AcroPoint.
Properties
The Point object has the following properties.
AcroPoint.AcroPoint.data-id=50532405_14799
data-id=x
X
Gets or sets the x-coordinate of an AcroPoint.
Syntax
[get/set] Short
Returns
The x-coordinate of the AcroPoint.
data-id=50532405_33201
data-id=y
Y
Gets or sets the y-coordinate of an AcroPoint.
Syntax
[get/set] Short
Returns
The y-coordinate of the AcroPoint.
data-id=50532405_39836
data-id=acroexch-rect
AcroExch.Rect
Defines the location of an AcroRect.
The Rect object has the following properties.
Properties
AcroRect.AcroRect.AcroRect.AcroRect.data-id=50532405_51838
data-id=bottom
Bottom
Gets or sets the bottom y-coordinate of an AcroRect.
Syntax
[get/set] Short
Returns
The y-coordinate of the bottom of the AcroRect.
data-id=50532405_44078
data-id=left
Left
Gets or sets left x-coordinate of an AcroRect.
Syntax
[get/set] Short
Returns
The x-coordinate of the left side of the AcroRect.
data-id=50532405_59707
data-id=right
Right
Gets or sets the right x-coordinate of an AcroRect.
Syntax
[get/set] Short
Returns
The x-coordinate of the right side of the AcroRect.
data-id=50532405_28094
data-id=top
Top
Gets or sets the top y-coordinate of an AcroRect.
Syntax
[get/set] Short
Returns
The y-coordinate of the top of the AcroRect.
data-id=50532405_86731
data-id=acroexch-time
AcroExch.Time
Defines a specified time, accurate to the millisecond.
Properties
The Time object has the following properties.
AcroTime.AcroTime.AcroTime.AcroTime.AcroTime.AcroTime.AcroTime.data-id=50532405_19244
data-id=date
Date
Gets or sets the date from an AcroTime.
Syntax
[get/set] Short
Returns
The date from the AcroTime. The date runs from 1 to 31.
data-id=50532405_34062
data-id=hour
Hour
Gets or sets the hour from an AcroTime.
Syntax
[get/set] Short
Returns
The hour from the AcroTime. The hour runs from 0 to 23.
data-id=50532405_89313
data-id=millisecond
Millisecond
Gets or sets the milliseconds from an AcroTime.
Syntax
[get/set] Short
Returns
The milliseconds from the AcroTime. Milliseconds run from 0 to 999.
data-id=50532405_71117
data-id=minute
Minute
Gets or sets the minutes from an AcroTime.
Syntax
[get/set] Short
Returns
The minutes from the AcroTime. Minutes run from 0 to 59.
data-id=50532405_57342
data-id=month
Month
Gets or sets the month from an AcroTime.
Syntax
[get/set] Short
Returns
The month from the AcroTime. The month runs from 1 to 12, where 1 is January and 12 is December.
data-id=50532405_73027
data-id=second
Second
Gets or sets the seconds from an AcroTime.
Syntax
[get/set] Short
Returns
The seconds from the AcroTime. Seconds run from 0 to 59.
data-id=50532405_58044
data-id=year
Year
Gets or sets the year from an AcroTime.
Syntax
[get/set] Short
Returns
The year from the AcroTime. The Year runs from 1 to 32767.
data-id=50532405_76583
data-id=axacropdflib-axacropdf
AxAcroPDFLib.AxAcroPDF
An object containing a set of methods that provide access to PDF browser controls. This is a creatable interface. This object makes it possible to load a file, move to various pages within the file, and specify various display and print options.
data-id=methods-8
data-id=id24
Methods
The AxAcroPDF object has the following methods.
Properties
The AxAcroPDF object has the following property.
data-id=50532405_36441
data-id=getversions
GetVersions
Note
Deprecated. This method is no longer available.
Syntax
VARIANT GetVersions();
data-id=50532405_27582
data-id=gobackwardstack
GoBackwardStack
Goes to the previous view on the view stack, if the previous view exists. The previous view may be in a different document.
Syntax
void GoBackwardStack();
Related methods
AcroPDF.GoForwardStack
data-id=50532405_83885
data-id=goforwardstack
GoForwardStack
Goes to the next view on the view stack, if the next view exists. The next view may be in a different document.
Syntax
void GoForwardStack();
Related methods
AcroPDF.GoBackwardStack
data-id=50532405_37358
data-id=gotofirstpage
GotoFirstPage
Goes to the first page in the document, maintaining the current location within the page and the current zoom level.
Syntax
void gotoFirstPage();
Related methods
AcroPDF.GotoLastPageAcroPDF.GotoNextPageAcroPDF.GotoPreviousPageAcroPDF.SetCurrentPage
data-id=50532405_56061
data-id=gotolastpage
GotoLastPage
Goes to the last page in the document, maintaining the current location within the page and the current zoom level.
Syntax
void gotoLastPage();
Related methods
AcroPDF.GotoFirstPageAcroPDF.GotoNextPageAcroPDF.GotoPreviousPageAcroPDF.SetCurrentPage
data-id=50532405_61327
data-id=gotonextpage
GotoNextPage
Goes to the next page in the document, if it exists. Maintains the current location within the page and the current zoom level.
Syntax
void gotoNextPage();
Related methods
AcroPDF.GotoFirstPageAcroPDF.GotoLastPageAcroPDF.GotoPreviousPageAcroPDF.SetCurrentPage
data-id=50532405_38257
data-id=gotopreviouspage
GotoPreviousPage
Goes to the previous page in the document, if it exists. Maintains the current location within the page and the current zoom level.
Syntax
void gotoPreviousPage();
Related methods
AcroPDF.GotoFirstPageAcroPDF.GotoLastPageAcroPDF.GotoNextPageAcroPDF.SetCurrentPage
data-id=50532405_77539
data-id=loadfile
LoadFile
Opens and displays the specified document within the browser.
Syntax
VARIANT_BOOL LoadFile(BSTR fileName);
Parameters
Returns
0 if the file could not be opened, -1 otherwise.
data-id=50532405_80023
data-id=print
Prints the document according to the options selected in a user dialog box. The options include embedded printing (printing within a bounding rectangle on a given page), as well as interactive printing to a specified printer. This method returns immediately, even if the printing has not completed.
Note
If security settings do not allow printing, this method is ignored.
Syntax
void Print();
Related methods
AcroPDF.PrintAllAcroPDF.PrintAllFitAcroPDF.PrintPagesAcroPDF.PrintPagesFitAcroPDF.PrintWithDialog
data-id=50532405_67867
data-id=printall
PrintAll
Prints the entire document without displaying a user dialog box. The current printer, page settings, and job settings are used. This method returns immediately, even if the printing has not completed.
Note
If security settings do not allow printing, this method is ignored.
Syntax
void printAll();
Related methods
AcroPDF.PrintAcroPDF.PrintAllFitAcroPDF.PrintPagesAcroPDF.PrintPagesFitAcroPDF.PrintWithDialog
data-id=50532405_87648
data-id=printallfit
PrintAllFit
Prints the entire document without displaying a user dialog box, and the pages are shrunk, if necessary, to fit into the imageable area of a page in the printer. The current printer, page settings, and job settings are used. This method returns immediately, even if the printing has not completed.
Note
If security settings do not allow printing, this method is ignored.
Syntax
void printAllFit(VARIANT_BOOL bOn);
Parameters
0 indicates that no scaling should be used, and a positive value indicates that the pages are shrunk, if necessary, to fit into the imageable area of a page in the printer.Related methods
AcroPDF.PrintAcroPDF.PrintAllAcroPDF.PrintPagesAcroPDF.PrintPagesFitAcroPDF.PrintWithDialog
data-id=50532405_35579
data-id=printpages-1
data-id=id25
PrintPages
Prints the specified pages without displaying a user dialog box. The current printer, page settings, and job settings are used.This method returns immediately, even if the printing has not completed.
Note
If security settings do not allow printing, this method is ignored.
Syntax
void printPages( Long nFrom, Long nTo);
Parameters
0.Related methods
AcroPDF.PrintAcroPDF.PrintAllAcroPDF.PrintAllFitAcroPDF.PrintPagesFitAcroPDF.PrintWithDialog
data-id=50532405_72769
data-id=printpagesfit
PrintPagesFit
Prints the specified pages without displaying a user dialog box. The current printer, page settings, and job settings are used. A parameter specifies whether to shrink pages, if necessary. This method returns immediately, even if the printing has not completed.
Note
If security settings do not allow printing, this method is ignored.
Syntax
void printPagesFit( Long nFrom, Long nTo,
VARIANT_BOOL bShrinkToFit);
Parameters
0.Related methods
AcroPDF.PrintAcroPDF.PrintAllAcroPDF.PrintAllFitAcroPDF.PrintPagesAcroPDF.PrintWithDialog
data-id=50532405_48290
data-id=printwithdialog
PrintWithDialog
Prints the document according to the options selected in a user dialog box. The options include embedded printing (printing within a bounding rectangle on a given page), as well as interactive printing to a specified printer. This method returns immediately, even if the printing has not completed.
Note
If security settings do not allow printing, this method is ignored.
Syntax
void printWithDialog();
Related methods
AcroPDF.PrintAcroPDF.PrintAllAcroPDF.PrintAllFitAcroPDF.PrintPagesAcroPDF.PrintPagesFit
data-id=50532405_42701
data-id=setcurrenthighlight
SetCurrentHighlight
Highlights the text selection within the specified bounding rectangle on the current page.
Syntax
void setCurrentHighlight(LONG nLeft, LONG nTop,
LONG nRight, LONG nBottom);
Parameters
data-id=50532405_60750
data-id=setcurrentpage
SetCurrentPage
Goes to the specified page in the document. Maintains the current location within the page and the current zoom level.
Syntax
void setCurrentPage(LONG nPage);
Parameters
0.Related methods
AcroPDF.GotoFirstPageAcroPDF.GotoLastPageAcroPDF.GotoNextPageAcroPDF.GotoPreviousPage
data-id=50532405_65913
data-id=setlayoutmode
SetLayoutMode
Sets the layout mode for a page view according to the specified string.
Syntax
void setLayoutMode(BSTR szLayoutMode);
Parameters
DontCare: use the current user preference SinglePage: use single page mode (as it would have appeared in pre-Acrobat 3.0 viewers) OneColumn: use one-column continuous mode TwoColumnLeft: use two-column continuous mode with the first page on the left TwoColumnRight: use two-column continuous mode with the first page on the rightRelated methods
AcroPDF.SetNamedDestAcroPDF.SetViewAcroPDF.SetViewRectAcroPDF.SetViewScroll
data-id=50532405_95088
data-id=setnameddest
SetNamedDest
Changes the page view to the named destination in the specified string.
Syntax
void setNamedDest(BSTR szNamedDest);
Parameters
Related methods
AcroPDF.SetLayoutModeAcroPDF.SetViewAcroPDF.SetViewRectAcroPDF.SetViewScroll
data-id=50532405_17156
data-id=setpagemode
SetPageMode
Sets the page mode according to the specified string.
Syntax
void setPageMode(BSTR szPageMode);
Parameters
none: displays the document, but does not display bookmarks or thumbnails (default) bookmarks: displays the document and bookmarks thumbs: displays the document and thumbnailsRelated methods
AcroPDF.SetShowScrollbarsAcroPDF.SetShowToolbar
data-id=50532405_92910
data-id=setshowscrollbars
SetShowScrollbars
Determines whether scrollbars will appear in the document view.
Syntax
void setShowScrollbars(VARIANT_BOOL bOn);
Parameters
0 indicates that they will not.Related methods
AcroPDF.SetPageModeAcroPDF.SetShowToolbar
data-id=50532405_48320
data-id=setshowtoolbar
SetShowToolbar
Determines whether a toolbar will appear in the viewer.
Syntax
void setShowToolbar(VARIANT_BOOL bOn);
Parameters
0 indicates that it will not.Related methods
AcroPDF.SetPageModeAcroPDF.SetShowScrollbars
data-id=50532405_82737
data-id=setview
SetView
Sets the view of a page according to the specified string.
Syntax
void setView(BSTR szViewMode);
Parameters
Fit: Fits the entire page within the window both vertically and horizontally. FitH: Fits the entire width of the page within the window. FitV: Fits the entire height of the page within the window. FitB: Fits the bounding box within the window both vertically and horizontally. FitBH: Fits the entire width of the bounding box within the window. FitB: Fits the entire height of the bounding box within the window.Related methods
AcroPDF.SetLayoutModeAcroPDF.SetNamedDestAcroPDF.SetViewRectAcroPDF.SetViewScroll
data-id=50532405_50198
data-id=setviewrect
SetViewRect
Sets the view rectangle according to the specified coordinates.
Syntax
void setViewRect(FLOAT left, FLOAT top,
FLOAT width, FLOAT height);
Parameters
Related methods
AcroPDF.SetLayoutModeAcroPDF.SetNamedDestAcroPDF.SetViewAcroPDF.SetViewScroll
data-id=50532405_41219
data-id=setviewscroll
SetViewScroll
Sets the view of a page according to the specified string. Depending on the view mode, the page is either scrolled to the right or scrolled down by the amount specified in offset.
Syntax
void setViewRect(BSTR szViewMode, FLOAT offset);
Parameters
Fit: Fits the entire page within the window both vertically and horizontally. FitH: Fits the entire width of the page within the window. FitV: Fits the entire height of the page within the window. FitB: Fits the bounding box within the window both vertically and horizontally. FitBH: Fits the entire width of the bounding box within the window. FitBV: Fits the entire height of the bounding box within the window.Related methods
AcroPDF.SetLayoutModeAcroPDF.SetNamedDestAcroPDF.SetViewAcroPDF.SetViewRect
data-id=50532405_17296
data-id=setzoom
SetZoom
Sets the magnification according to the specified value.
Syntax
void setZoom(FLOAT percent);
Parameters
Related methods
AcroPDF.SetZoomScroll
data-id=50532405_23108
data-id=setzoomscroll
SetZoomScroll
Sets the magnification according to the specified value, and scrolls the page view both horizontally and vertically according to the specified amounts.
Syntax
void setZoomScroll(FLOAT percent, FLOAT left, FLOAT top);
Parameters
Related methods
AcroPDF.SetZoom
data-id=50532405_53488
data-id=src
Src
Gets or sets the URL for the document.
Syntax
[get/set] src
Returns
The URL for the document, formatted as a string.