Zeon PDFReaderOCX 7.x Help library
General Description

DocuCom PDF Reader OCX is an ActiveX control for Windows developers. This is the easiest way to deploy PDF technology in other Windows applications. Based on our DocuCom PDF Reader, the PDF 1.4/1.5 specification conforming Reader OCX 6.x fully supports PDF browsing and printing. This document describes the programming interfaces of the DocuCom PDF Reader OCX module for Microsoft Windows 95, 98, ME, and Windows NT, 2000.

Coordinate Systems

UC - User Coordinate System
PDF contents are defined in a "Device-Independent" coordinate system that always bears the same relationship to the current page, regardless of the output device on which the printing or displaying will occur. This device -independent coordinate system is called "User Coordinate System".The lower-left corner of each PDF page is initialized to "0, 0" as the default state, while X coordinate increases rightward and Y coordinate increases upward subject to alteration by the "Rotate" entry in the page dictionary. The unit of measurement is 1/72 inch.The "CropBox" in the page dictionary specifies the rectangle of user space corresponding to the visible area of the intended output device - such as screen display or printed page.

DC - Device Coordinate System (Device Space)
This is the coordinate system of a raster output device such as a display or a printer. For our discussion in the document, Device Coordinate System (or Device Space) is referring to the "Screen Display" device coordinate system, with "0, 0" at the top-left corner and X coordinate extended to right, and Y coordinate extended downward. Finally, different devices have different resolutions; some even have resolutions that differ in the horizontal and vertical directions.

Window Coordinate System (Window Space)
This is the device space of the "Window Pane" to display PDF pages. The left-top corner of the Window Pane is the origin.

Page Coordinate System (Page Space)
Origin is the left-top corner of the "On Screen Page Bitmap" and X extended to right and Y extended downward.

Transform UC to DC, or DC to UC
You can freely convert coordinates between User Space and Device Space. Since Reader OCX support different viewing layout ¨C Single Page, Continuous Page, and Facing Page, you should also specify the "Current Page" before the conversion. See SetCurrentPage().

Limitation

When the application handles the events invoked from PDFReaderOCX, it CAN'T use the 'DoEvents' statement in Visual Basic, the 'Message Loop Mechanism' in Visual C++ and something similarly in other programming environments.

Send feedback to Zeon Corporation © 2005 Zeon Corporation. All rights reserved.


Untitled Document

PDF Reader OCX Release Note
Must Read!
Important API modification
  • znsl.dll renamed as znsl6.dll (this may affect installation/activation codes)
  • Avoid lunching Windows' default viewer
  • Goto and GotoR events modified
  • Release Note 7.79
  • Release Note 7.78R1
  • Release Note 7.65R1
  • Release Note 7.62R1
  • Release Note 6.52R2
  • Release Note 6.52
  • Release Note 6.51R3
  • Release Note 6.51R2
  • Release Note 6.51
  • Release Note 6.18
  • Release Note 6.17
  • Release Note 6.16
  • Release Note 6.15
  • Release Note 6.14 R4
  • Release Note 6.14 R3
  • Release Note6.14R1
  • Release Note6.13R3
  • Release Note 6.13R2
    • Release Note 7.79 (2005-6-9)
    • Fixed the bug of displaying certain Unicode characters.
    • Fixed the bug of con-current "Print".
    • Fixed the bug of enabling the product with earlier (7.x) serial numbers.
    Release Note 7.78R1 (2005-5-27)
    • Added OCX_CommentOnly flag to print only PDF comments.
      Description:
      enum{
      OCX_ContentAndComment = 0,
      OCX_ContentOnly = 1,
      OCX_CommentOnly = 2
      } OCX_PrintContent;
    • Fixed the problem of showing correct information in About dialog.
    • Fixed a rendering problem of showing some traditional Chinese characters.
    • Fixed the Action bug of "Show/Hide Fields".
    Release Note 7.65R1 (2005-2-4)
    • Supporting for Form and Javascript has been included.
    • Some character display errors have been fixed.
    • Text field display problem has been fixed.
    • Corrected bug of Link plug-in registration in previous version.
    • Compatibility for use under Delphi has been optimized.
    • Fixed bug of method "PDFReaderEvent:ExecuteBook".
    • Fixed bug of viewing specific PDF document.
    • Support viewing documents with unknown extensions as PDF files.
    Release Note 7.62R1 (2004-12-8)
    • Add a new event "EnumWord2" with a new parameter "Word Attr" -- please ready the latest chm help file. Please use this event to replace "EnumWord". You can break lines by checking the WordAttr.
    • Correct the document error of "CopySelection".
    • Correct the document error of "HideNavigationPalette".
    • Improve the "HightSelectedWords" method -- allow scrolling.
    • Correct the problem of co-existence with other DocuCom products.
    • Correct a potential problem of multiple activation of the "Initialize()"method.
    • Solve the display problem related to some specific PDF files.
    Release Note 6.52R2 (2004-10-19)
    • 1. Solved the problem of opening PDF files with in-consistent "/EncryptMetadata" flag.
    Release Note 6.52 (2004-10-11)
    • Solve the display problem of certain dual screen system.
    • Improve the quality of reduced image.
    Release Note 6.51 R3 (2004-9-17)
    • Improve CMYK to RGB color conversion.
    • Change back to "Smooth Thin Line". (will have better results in most cases)
    • Fixed a minor bug of pattern boundary.
    Release Note 6.51 R2 (2004-9-16)
    • Disable Ctrl+W and Ctrl+O.
    • Add one API to selectively disable Hot Keys.
    • Fixed a bug of Copy/Paste under Win9x.
    • Fixed a minor bug in path rendering.
    • Fixed a minor bug in Unicode edit field when using "tab" key.
    Release Note 6.51 (2004-9-15)
    • Fixed the bug of Nup and Copies.
    • Remove Ctrl+P and Ctrl+O.
    • Improve scroll and control bar.
    • Add "remove margin" in print control
    • Fixed the bug of finding special punctuation marks.
    • Greately improved print speed and quality, as well as other bugs.
    Release Note 6.18 (2004-7-30)
    • Optimize the GetWord() API
    • Solve a new crash problem in 6.17
    Release Note 6.17 (2004-7-30)
    • Modified Event: ActionGotoRLinkGetDestFile
      Change the parameter "LPDISPATCH *ppIStream" to "LPVARIANT *pStream" .
    • Speed up image rendering.
    • Support "next", "previous" buttons on vertical scroll bar under "Single Page" mode.
    • Correct a zoom factor related bug.
    • Correct a default zoom factor bug
    • Correct a bug related to hot key and mouse wheel when switching between page views.
    • Correct a bug related to Zoom In and Zoom Out tool.

    Release Note 6.16 (2004-7-22)
    • Improve the compatibility in Copy and Paste operations.

    Release Note 6.15 (2004-7-9)
    • Improved rendering.
    • Correct a bug related to Loupe tool.
    • Show more meaningful error message when exception occurs.
    • Can copy NULL character now.
    • Correct a bug related to printing -- missing characters happens in certain rare cases.
    • Display correct page size on screen -- using monitor DPI.
    • Correct a bug related to wrongly displayed Japanese characters.
    • Modify and Add events to process Goto and GotoR actions.
    Release Note 6.14R4 (2004-7-7)
    • Correct a bug in GotoR action (action to display a page view of another PDF document.).
    • Add "Page Size" information on horrizontal scroll bar.Add "Unit" setting in "Preferences-> General" group.
    • Improve the device CMYK to RGC conversion.
    • Right click on "Viewbar" to switch between large or small view bar.
    • Click to terminate "Popup" window will not auto-scroll the page.
    Release Note 6.14R3 (2004-7-6)
    • More natural handling of the Click to Scroll behavior under "Single Page Mode".
    • Can select and find phrases created by "Text Box" tool.
    Release Note 6.14 (2004-6-25)
    • Improve Graphics Rendering.
    • Find tool improved.
    Release Note 6.13 R3 (2004-6-11)
    • Mis-alignment when printing certain images.
    • Solved the Installation conflicts between PDF Plus and Reader OCX.
    • Print As Image should not be supported in PS printing.
    • Correct the dead-lock in a special dash rendering case.
      Improve "Find" and "Zoom".
    Release Note 6.13 R2 (2004-6-5)
    In rare cases, IE may fail to dispaly PDF files.


Untitled Document

ZSNL.DLL renamed as ZNSL6.DLL

Phenomenon:
If you are using activation API to enable the Reader OCX and experienced the "cannot load znsl.dll" error message

Solution:
Since 6.12, we have renamed the ZNSL.DLL to ZNSL6.DLL -- to avoid possible conflict with other products installed. Therefore, if you load znsl.dll in your codes previously, please change it to znsl6.dll.
Avoid lunching Windows' default viewer

Phenomenon:
Acrobat(tm) Reader will be launched when click the "open file" link to open another PDF document

Solution:
Use following codes to avoid the launch of Acrobat(tm) Reader .(You have configured "Acrobat(tm) Reader" as Windows' PDF default viewer.)

Set pbHandled as true (*pbHandled = TRUE) in ActionFileLinkClicked event handling codes

Also, add following codes to open the specified file:

===========scource code example================

TCHAR *srcfile = (TCHAR*)filename ;
TCHAR buffer[MAX_PATH] = {0} ;
if (filename[1] != _T(':'))
{
   CString root = m_strFileName.Left( m_strFileName.ReverseFind(_T('\\')) ) ;
   if (SearchPath( root, filename, NULL, MAX_PATH, buffer, NULL ) > 0)
       srcfile = buffer ;
}
m_pdfreader.OpenFile( srcfile, NULL );

==========scource code example=================

Please read the latest API documents always that go together with the each new release.
If necessary, please purchase the Reader OCX SDK Edition. Container source codes are included in the SDK edition.

Goto and GotoR events modified

Phenomenon:
(Important: The modifications here apply to all Goto and GotoR events -- not only for IStream.)
To solve the problem In IStream inteface that the GotoR action may fail when using relative filename. Since IStream is a memory object, therefore it is not possible for Reader OCX to resovle a "relative filename" (relative to memory?).

Solution:
To support "GotoR" link type in "IStream" interface, we have modified "Goto" and "GotoR" as follow:

==== A. Goto : show a page view of the same document
We fire one event:
GotoLinkClicked, and pass the page no, fit type, .. etc.

==== B. GotoR: go to the page view of another document
We fire 2 events in sequence.

The First Event
GotoRLinkGetDestFile : pass the file location (could be relative path) to client.
Client must returns either the "Absolute" pathname and optionally a password, or an IStream.
Reader OCX will then open the file or IStream returned, and fire the second event:

See sample codes below to learn how to handle the ActionGotoRLinkGetDestFile event correctly.

The Second Event
GotoRLinkClicked, and pass page no, fit type, etc. to client.

===========scource code example================

void OnActionGotoRLinkGetDestFile(LPCTSTR filename, BOOL *pbIStream,
    LPVARIANT *pStream, BSTR *destfile, BSTR *password, BOOL *pbHandled)
{
    TRACE( "Event: OnFire_ActionGotoRLinkGetDestFile\n") ;
    TCHAR *srcfile = (TCHAR*)filename ;
    TCHAR buffer[MAX_PATH] = {0} ;
    if (filename[1] != _T(':'))
    {
       CString root = m_strFileName.Left( m_strFileName.ReverseFind(_T('\\'))) ;
       if (SearchPath( root, filename, NULL, MAX_PATH, buffer, NULL) > 0)
           srcfile = buffer ;
       else
       {
           *pbHandled = FALSE ;
           return ;
       }
    }
#if 0 // return Stream
    *pbIStream = TRUE ;
    LoadFileIntoStream( srcfile, (IStream**)&pIStream->punkVal ) ;
#else // return fullpath
    *pbIStream = FALSE ;
#ifdef UNICODE
    *destfile = SysAllocString( srcfile ) ;
#else
    int len = (strlen(srcfile)+1) * 2 ;
    WCHAR *str = new WCHAR[len] ;
    memset( str, 0, len ) ;
    if (str)
    {
        MultiByteToWideChar( GetACP(), 0, srcfile, -1, str, len ) ;
        *destfile = SysAllocString( str ) ;
        delete[] str ;
    }
#endif
#endif
    *pbHandled = TRUE ;
}

===========scource code example================

Please read the latest API documents always that go together with the each new release.
If necessary, please purchase the Reader OCX SDK Edition. Container source codes are included in the SDK edition.


Typedef Overview

OCX_FitType | Enum.Define the constants for FitType.
OCX_PageLayout | Enum.Define the constants for Page Layout.
OCX_PDFVersion | Enum.Define the constants for PDF Version.
OCX_PrintPageRange | Enum.Define the constants for PageRange when printing.
OCX_PrintUpSelector | Enum.Define the constants for nUP type when printing.
OCX_PrintOddEvenRange | Enum.Define the constants for EvenOdd type when printing.
OCX_PrintContent | Enum.Define the constants for Content range to be printed.
OCX_PrintPageScaling | Enum.Define the constants for page scaling type when printing.
OCX_PrintCutMarks | Enum.Define the CutMasks Constants for Tile page when printing.
OCX_WordAttr | Enum.Define the constants for word attributes.
OCX_ZoomType | Enum.Define the constants for ZoomType.


Typedef

Enum.Define the constants for view destination Fit Types.

enum {
    OCX_XYZ         = 0,   // Destination specified as upper-left corner point and a zoom factor.
    OCX_Fit         = 1,   // Fits the page into the window.
    OCX_FitH        = 2,   // Fits the page width into the window.
    OCX_FitV        = 3,   // Fits the page height into the window.
    OCX_FitR        = 4,   // Fits the rectangle specified by its upper-left and lower-right corner points into the window.
    OCX_FitB        = 5,   // Fits the bounding box into the window.
    OCX_FitBH       = 6,   // Fits the width of the bounding box into the window.
    OCX_FitBV       = 7,   // Fits the height of the bounding box into the window.
} OCX_FitType ;


Typedef

Enum.Define the constants for Page Layout.

enum {
    OCX_LayoutDontCare         = 0,	// Use default page layout.
    OCX_LayoutSinglePage       = 1,	// Use single-page mode.
    OCX_LayoutOneColumn        = 2,	// Use one-column continuous mode.
    OCX_LayoutTwoColumnLeft    = 3,	// Use two-column continuous mode with first page on left.
    OCX_LayoutTwoColumnRight   = 4,	// Use two-column continuous mode with first page on right.
    OCX_LayoutEBook            = 5,	// Use E-Book layout.
} OCX_PageLayout ;


Typedef

Enum.Define the constants for PDF Version.

enum {
    OCX_PDF13         = 0,	// PDF 1.3
    OCX_PDF14         = 1,	// PDF 1.4
    OCX_PDF15         = 2,	// PDF 1.5
} OCX_PDFVersion ;


Typedef

Enum.Define the constants for Content range to be printed.

enum {
    OCX_ContentAndComment   = 0,
    OCX_ContentOnly         = 1,
    OCX_CommentOnly         = 2,
} OCX_PrintContent ;


Typedef

Enum.Define the CutMasks Constants for Tile page when printing.

enum {
    OCX_CutMark_None           = 0,
    OCX_CutMark_WesternStyle   = 1,
    OCX_CutMark_EasternStyle   = 2,
} OCX_PrintCutMarks ;


Typedef

Enum.Define the constants for EvenOdd type when printing.

enum {
    OCX_OddEven     = 0,
    OCX_OddOnly     = 1,
    OCX_EvenOnly    = 2,
} OCX_PrintOddEvenRange ;


Typedef

Enum.Define the constants for PageRange when printing.

enum {
    OCX_PrintPageRangeAll          = 0,
    OCX_PrintPageRangeCurrentPage  = 1,
    OCX_PrintPageRangeFromTo       = 2,
    OCX_PrintPageRangeSelected     = 3,
    OCX_PrintPageRangeCurrentView  = 4,
} OCX_PrintPageRange ;


Typedef

Enum.Define the constants for page scaling type when printing.

enum {
    OCX_None             = 0,
    OCX_FitToPaper       = 1,
    OCX_ShrinkLargePage  = 2,
    OCX_TileLargePage    = 3,
    OCX_Nup              = 4,
    OCX_ChooseByPageSize = 5,
} OCX_PrintPageScaling ;


Typedef

Enum.Define the constants for nUP type when printing.

enum {
    OCX_2UP     = 0,	// x 2
    OCX_4Up     = 1,	// x 4
    OCX_6Up     = 2,	// x 6
    OCX_8Up     = 3,	// x 8
    OCX_16UP    = 4,	// x 16
} OCX_PrintUpSelector ;


Typedef

Enum.Define the constants for Word Attributes.

enum {
    WA_ADJACENT_TO_SPACE = 0x800,    // the character following the end of the word is a space
    WA_LAST_WORD_ON_LINE = 0x8000,   // the word is followed by a line break
} OCX_WordAttr ;


Typedef

Enum.Define the constants for ZoomType.

enum {
    OCX_ZoomPercent         = 0,   // Zoom the page view according to lPercent.
    OCX_ZoomFitPage         = 1,   // Fits the page to the window.
    OCX_ZoomFitWidth        = 2,   // Fits the page width to the window.
    OCX_ZoomFitHeight       = 3,   // Fits the page height to the window.
    OCX_ZoomFitVisibleWidth = 4,   // Fits the width of the portion of the page upon which marks are made to the window.
} OCX_ZoomType ;


dispinterface _DPDFReader Overview

CanCopySelection | Can copy the selection into the clipboard?
CanFindSysFont | Whether the original font can be available from system.
CloseFile | Close the opened PDF file.
CopySelection | Copy the current selection into the clipboard.
DCToUC | Transform "Window Device Coordinates (pixels)" to "User Coordinates (points)".
ExecuteBookmark | Execute the action(s) associated with the specified bookmark title.
Find | Find the text in current document.
GetHighlightedWords | Get the currently highlighted text on PDF page.
GetPageInfoDispatch | Get the IDispatch pointer to the IPDFReaderInfo interface.
GetPrintDispatch | Get the IDispatch pointer to the IPDFReaderPrint interface.
GetWords | Get text from the current PDF document.
GetZoomScroll | Get current zoom scale and scroll position.
GoBackward | Retrace to previous viewing step.
GoForward | Forward to the next viewing step.
GotoFirstPage | Go to first page of the PDF document.
GotoLastPage | Go to last page of the PDF document.
GotoNextPage | Go to next page of the current page.
GotoPage | Go to the specified page.
GotoPrevPage | Go to previous page of the current page.
HideNavigationPalette | Hide specified navigation panel.
HighlightSelectedWords | Highlight the selected words.
Initialize | Initialize the DocuCom pdf core library.
IsSupportVersion | Whether the PDf version is supported or not.
OnHandTool | Activate the Hand tool.
OnSelectImageTool | Activate the Select Image tool.
OnSelectTextTool | Activate the Select Text tool.
OnZoomInTool | Activate the Zoom In tool.
OnZoomOutTool | Activate the Zoom Out tool.
OpenFile | Open the specified PDF file.
OpenFileFromIStream | Open the PDF file from an IStream.
OpenFileFromURL | Open the PDF file from a URL.
Refresh | Refresh the view of the current document.
RemoveHighlight | Remove the highligh.
RemoveSelection | Deselect all the words selected by the "SelectXXX" functions of OCX.
RotatePageLeft | Rotate the page view 90 degrees counter clockwise.
RotatePageRight | Rotate the page view 90 degrees clockwise.
SaveFileAs | Saves the document with a new name.
SelectAll | Select all of the text.
SelectWordByOffset | Select the word by its offset.
SelectWords | Select the words in a range.
SelectWordsByArray | Select the words in the index array.
SelectWordsInRect | Select the words in a specified rectangle.
SetEbookOptions | Set options for Ebook page layout.
SetFlipAnimationSpeed | Set the speed to flip a page.
SetGreekText | Whether to draw "Gray" boxes for characters below specified pixels.
SetPageLayout | Set page layout for viewing document pages.
SetSmoothImage | Whether to smooth images.
SetSmoothLineArt | Whether to smooth line art.
SetSmoothText | Whether to smooth text.
SetZoom | Set the zoom scale for document page view.
SetZoomScroll | Set the "Zoom" scale and the "Scroll To" position in Page Device Coordinate system.
ShowExternButton | Whether to show the "extern button" located on the right top of the viewer.
ShowNavigationPane | Whether to tear off the Navigation Pane. The splitter bar will also be removed altogether.
ShowPageViewControlBar | Whether to show the "Control Bar" located under "Page View" to the right of "Scroll Bar".
ShowPageViewScrollBar | Whether to show the scroll bar located on the right of the pageview.
ShowScrollBarAlways | Whether to show the scroll bar located on the right of the navigation panel always.
ShowTooltip | Whether to show the tooltip.
SwitchHotkey | Enables or disables the OCX's hotkeys.
UCToDC | Transform"User Coordinates (points)"to either"Window Device Coordinates (pixels)"or"Page Device Coordinates (pixels)".
UpdateView | Repaint page contents within the specified rectangle.


_DPDFReader Methods

Can copy the selection into the clipboard ?

long CanCopySelection(BOOL *pbCanCopy);

Parameters

pbCanCopy
[out]TRUE if it has text or image selected currently and has the permission to copy contents, FALSE otherwise.

Return Values
  0      =  Normal
 -1      =  Parameter Invalid
-15    =  Busy
-16    =  Other errors
Remarks


_DPDFReader Methods

Whether the original font can be available from system.

long CanFindSysFont(BSTR szFontName, BSTR szFontType);

Parameters

szFontName
[in] original font's name.

szFontType
[in] original font's type. if this parameter is NULL, it's treated as "truetype" default.

Return Values
  0    =  not available
  1    =  available


_DPDFReader Methods

Close the opened PDF file.

long CloseFile();

Parameters

None

Return Values
  0      =  Normal
-15    =  Busy
-16    =  Other errors


_DPDFReader Methods

Copy the current selection into the clipboard

long CopySelection();

Parameters

None

Return Values
  0      =  Normal
 -15    =  Busy
-16    =  Other errors


_DPDFReader Methods

Transform "Window Device Coordinates (pixels)" to "User Coordinates (points)".

long DCToUC(long xDC, long yDC, long *xUC, long *yUC);

Parameters

xDC
[in] x-coordinate of the current page in "Window Device Coordinate" system.

yDC
[in] y-coordinate of the current page in "Window Device Coordinate" system.

xUC
[out] x-coordinate of the current page in "User Coordinate" system.

yUC
[out] y-coordinate of the current page in "User Coordinate" system.

Return Values
  0      =  Normal
-1      =  Parameter error.
-15    =  Busy
-16    =  Other errors
Remarks

You should specify current page using the method -- SetPageNum(), before calling this function.
Window Device Coordinate: Left-top corner of current "Window Pane" is the origin and X-axis increases rightward, Y-axis increases downward ¨C both in "pixel" unit. See Coordinate Systems for more information.
User Coordinate: The standard PDF coordinate system; left-bottom corner of the "Page" is the origin and X-axis increases rightward, Y-axis increases upward ¨C both in "point" unit.


_DPDFReader Methods

Execute the action(s) associated with the specified bookmark title.

long ExecuteBookmark(BSTR bookmark, long index);

Parameters

bookmark
[in] bookmark title, which is case insensitive and not whole phrase match.

index
[in] zero-based index of the bookmark.

Return Values
  0    =  Normal
-16   =  Other errors


_DPDFReader Methods

Find the text in current document.

long Find(BSTR text, BOOL bAgain, BOOL bForward, BOOL bWholeWord, BOOL bMatchCase);

Parameters

text
[in] The phrase to find, in Unicode format.

bAgain
[in] Whether to continue last search if true, otherwise start a new search.

bForward
[in] Starts the search from the current page and goes forward through the document if true, otherwise search backward through the document pages.

bWholeWord
[in] Finds only occurrences of the complete word specified in the "text"(true).

bMatchCase
[in] Finds only words that contain exactly the same capitalization in the "text"(true).

Return Values
  0      =  Normal (found)
  1      =  Normal (not found)
 16     =  User abort
-1      =  Parameter error.
-15    =  Busy
-16    =  Other errors
Remarks

This method will start the finding from the next position to the current and end to the previous position to the current.
In addition to, the method also fires 3 events "FindStart,"FindFinishAPage and "FindFinish". You can hook your own functions there, such as a possible ¡°Find Next¡± dialog box.


_DPDFReader Methods

Get the currently highlighted text on PDF page.

long GetHighlightedWords(long nPageNo);

Parameters

nPageNo
[in] zero-based index of the page to be enumerated.
-1: all currently highlighted words are returned.

Return Values
  0      =  Normal
-15    =  Busy
-16    =  Other errors
Remarks

Words are returned using Event one by one.
After the 'BeginEnumWords' event, the 'SelectedWordRange' or 'SelectedWordArray' event will be fired, according to the selection type.
See the events "BeginEnumWords", "EnumSelectedWord" and "EndEnumWords" also.


_DPDFReader Methods

Get the IDispatch pointer to the IPDFReaderInfo interface.

long GetPageInfoDispatch(LPDISPATCH *lppDisp);

Parameters

lppDisp
[out] pointer to the IPDFReaderInfo interface.

Return Values
  0    =  Normal
-1    =  Parameter error
Remarks

The IPDFReaderInfo interface is used to get some kinds of the information, such as the document info, page view's info, etc.The client code should invoke the Release method after using it.


_DPDFReader Methods

Get the IDispatch pointer to the IPDFReaderPrint interface.

long GetPrintDispatch(LPDISPATCH *lppDisp);

Parameters

lppDisp
[out] pointer to the IPDFReaderPrint interface.

Return Values
  0    =  Normal
-1    =  Parameter error
Remarks

The IPDFReaderPrint interface is used to retrieve and set the print parameters, and print. The client code should invoke the Release method after using it.


_DPDFReader Methods

Get text from the current PDF document.

long GetWords(long nPageNo, long left, long bottom, long right, long top, BOOL bOnlyInRect);

Parameters

nPageNo
[in] zero-based index of the page to be enumerated.
-1£ºall text of the document are returned.

left,bottom,right,top
[in] Specify the containing rectangle in PDF "page coordinate system".(left-bottm, right-top)

bOnlyInRect
[in] True £ºretrieve only text within the specified rectangle.
False £ºretrieve all of the text in the page, and the 'left'¡¢'bottom'¡¢'right' and 'top' are unused.

Return Values
  0    =  Normal
-1    =  Parameter error
-15   =  Busy
Remarks

Words are returned using Event one by one. See the event "BeginEnumWords", "EnumWord" and "EndEnumWords".


_DPDFReader Methods

Get current zoom scale and scroll position.

long GetZoomScroll(long *percent, long *left, long *top);

Parameters

percent
[out] the scale factor in percentage.

left
[out] x-coordinate (pixels) of the left-top corner of current display in "Window Device Coordinate".

top
[out] y-coordinate (pixels) of the left-top corner of current display in "Window Device Coordinate".

Return Values
  0    =  Normal
-1    =  Parameter error
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Retrace to previous viewing step.

long GoBackward();

Parameters

None

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Forward to the next viewing step.

long GoForward();

Parameters

None

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Go to first page of the PDF document.

long GotoFirstPage();

Parameters

None

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Go to last page of the PDF document.

long GotoLastPage();

Parameters

None

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Go to next page of the PDF document.

long GotoNextPage();

Parameters

None

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Go to the specified page.

long GotoPage(long nPageNo);

Parameters

nPageNo
[in] zero-based index of the page.

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Go to previous page of the current page.

long GotoPrevPage();

Parameters

None

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors


_DPDFReader Methods

Hide specified navigation panel.

long HideNavigationPalette(BSTR palette);

Parameters

palette
[in] The palette name to be hidden, which must be one of the some predefined strings currently: "Note", "Properties", "Bookmarks" and "Pages", and is case sensitive.

Return Values
  0      =  Normal
Remarks

This method must be invoked before calling OpenFile and OpenFileFromIStream.


_DPDFReader Methods

Highlight the selected words.

long HighlightSelectedWords();

Parameters

None

Return Values
  0    =  Normal
-15   =  Busy
-16   =  Other errors
Remarks

Before invoking this method, you should have selected some texts already by one of the following "SelectXXX" functions -- "SelectAll", "SelectWords", "SelectWordByOffset" and "SelectWordsInRect" .

This method is NOT used in current versions!


_DPDFReader Methods

Initialize the DocuCom pdf core library.

long Initialize(BSTR szSerialNumber);

Parameters

szSerialNumber
[in] SN, got it from zeon corporation.
szSerialNumber

Return Values
  0     =  Success
-1      =  Fail
-2      =  Trail version
Remarks

You should invoke this function before Opening the file. If the SN is not corrent, the product is for trial version and a watermark will be added in every page of the document.


_DPDFReader Methods

Whether the PDf version is supported or not.

long IsSupportVersion(OCX_PDFVersion pdfVersion);

Parameters

pdfVersion
[in] PDF Version. see OCX_PDFVersion

Return Values
  0    =  not support
  1    =  support


_DPDFReader Methods

Activate the Hand tool.

long OnHandTool(VARIANT flags);

Parameters

flags
[in, optional] unused currently.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Activate the Select Image tool.

long OnSelectImageTool(VARIANT flags);

Parameters

flags
[in, optional] unused currently.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Activate the Select Text tool.

long OnSelectTextTool(VARIANT flags);

Parameters

flags
[in, optional] unused currently.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Activate the Zoom In tool.

long OnZoomInTool(VARIANT flags);

Parameters

flags
[in, optional] unused currently.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Activate the Zoom Out tool.

long OnZoomOutTool(VARIANT flags);

Parameters

flags
[in, optional] unused currently.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Open the specified PDF file.

long OpenFile(BSTR szFileName, BSTR szPassword);

Parameters

szFileName
[in] the path name of the PDF file.

szPassword
[in] password to open the file. "NULL" means no password.

Return Values
  0      =  Normal
 -1      =  The file does not exist or is not accessible .
-15     =  Busy
-16     =  Other errors
-17     =  Password is needed
-18     =  The file is invalid
Remarks

You should invoke Initialize with correct serial number first, or will be the trial version.If the file has been opened already, do nothing and return 0.

The evnet "CryptGetPassword" will be issued if the password is incorrect. See the "CryptGetPassword" for the details.


_DPDFReader Methods

Open the PDF file from an IStream.

long OpenFileFromIStream(LPUNKNOWN pIUnknown, BSTR szPassword);

Parameters

pIUnknown
[in] the pointer to the IStream.

szPassword
[in] password to open the file. "NULL" means no password.

Return Values
  0      =  Normal
 -1      =  Parameter error
-15      =  Busy
-16      =  Other errors
Remarks

You should invoke Initialize with correct serial number first, or will be the trial version.

The evnet "CryptGetPassword" will be issued if the password is incorrect. See the "CryptGetPassword" for the details.


_DPDFReader Methods

Open the PDF file from a URL.

long OpenFileFromURL(BSTR szURL, BSTR szPassword, BOOL bDownloadTotal);

Parameters

szURL
[in] The URL address of the pdf document to be opened.

szPassword
[in] password to open the file. "NULL" means no password.

bDownloadTotal
[in] whether to download the entire file. If set to "False", Reader OCX will try to do "page-at-a-time" downloading provides the target PDF file is linearized.

Return Values
  0      =  Normal
 -1      =  Parameter error
-15      =  Busy
-16      =  Other errors
Remarks

You should invoke Initialize with correct serial number first, or will be the trial version.


_DPDFReader Methods

Refresh the view of the current document.

long Refresh();

Parameters

None

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Remove the highligh.

long RemoveHighlight();

Parameters

None

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors
Remarks

This method will clear the all kinds of the selection, not only what you have selected by the "SelectXXX" functions, but also selections done by the "SelectTextTool", "SelectImageTool", etc.


_DPDFReader Methods

Remove the Selection.

long RemoveSelection();

Parameters

None

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors
Remarks

This method will clear the all kinds of the selection, not only what you have selected by the "SelectXXX" functions, but also selections done by the "SelectTextTool", "SelectImageTool", etc.

This method is SAME with "RemoveHighlight" now !


_DPDFReader Methods

Rotate the page view 90 degrees counter clockwise.

long RotatePageLeft(long nPageNo);

Parameters

nPageNo
[in] -1 means rotate all pages, otherwise rotate the special page only.

Return Values
  0      =  Normal
 -1      =  Parameter error
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Rotate the page view 90 degrees clockwise.

long RotatePageRight(long nPageNo);

Parameters

nPageNo
[in] -1 means rotate all pages, otherwise rotate the special page only.

Return Values
  0      =  Normal
 -1      =  Parameter error
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Saves the document with a new name.

long SaveFileAs(BSTR szFileName);

Parameters

szFileName
[in] the path name of the PDF file.

Return Values
  0      =  Success
-1       =  Failed
Remarks

This method is NOT supported in current version for some reasons!


_DPDFReader Methods

Select all of the text.

long SelectAll();

Parameters

None

Return Values
  0      =  Normal
-15    =  Busy
-16    =  Other errors
Remarks

If current page layout mode is "SinglePage", select the text of the current page only. Otherwise select the text of all of the pages in the document.


_DPDFReader Methods

Select the word by its offset.

long SelectWordByOffset(long nPageNo, long offset, long wordLength, BOOL bContinue);

Parameters

nPageNo
[in] zero-based index of the page to be selected.

offset
[in] character offset -- zero-based -- the first character in page.

wordLength
[in] word length(how many characters).

bContinue
[in] True: select multiple words using this method repeatedly.
False : new selection.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors
Remarks

This method is NOT supported in current version for some reasons!


_DPDFReader Methods

Select the words in a range.

long SelectWords(long nPageFrom, long nWordFrom, long nPageTo, long nWordTo);

Parameters

nPageFrom
[in] zero-based index of the page to be selected from.

nWordFrom
[in] sequence number(zero-based) of the first word you want to select in the start page.

nPageTo
[in] zero-based index of the page to be selected to.

nWordTo
[in] sequence number(zero-based) of the last word you want to select in the end page.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Select the words in the index array.

long SelectWordsByArray(long nPageNo, long *word, long count);

Parameters

nPageNo
[in] zero-based index of the page to be selected.

word
[in] Points to an array which include the zero-based indices of the selected words in the page.

count
[in] size of the word index array.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Select the words in a specified rectangle.

long SelectWordsInRect(long nPageNo, long left, long bottom, long right, long top);

Parameters

nPageNo
[in] zero-based index of the page to be selected.

left,bottom,right,top
[in] the containing rectangle, in PDF page coordinate system (left-bottom, right-top).

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Set options for Ebook page layout.

long SetEbookOptions(long options);

Parameters

options
[in] This parameter can be any combination of the following values:
0x00000001: Hide the page borders.
0x00000002: Fit width with double pages.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Set the speed to flip a page.

long SetFlipAnimationSpeed(float fFlipAngle, long lSleepInterval);

Parameters

fFlipAngle
[in] the angle to be flipped in each time interval, in degrees. From 1 to 90, default is 10.0.

lSleepInterval
[in] time internal in milliseconds. Must has a value greater than 1.

Return Values
  0    =  Normal
-16   =  Other errors


_DPDFReader Methods

Whether to draw "Gray" boxes for characters below specified pixels.

long SetGreekText(BOOL bGreek, long level);

Parameters

bGreek
[in] whether to greek the text.

level
[in] character size in pixel, below which the text box will be gray out.

Return Values
  0      =  Normal
-1       =  Parameter error
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Set page layout for viewing document pages.

long SetPageLayout(OCX_PageLayout layoutMode);

Parameters

layoutMode
[in] see OCX_PageLayout

Return Values
  0      =  Normal
-1       =  Parameter error
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to smooth images.

long SetSmoothImage(BOOL bSmooth, long level);

Parameters

bSmooth
[in] whether to smooth image.

level
[in] Reserved

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to smooth line art.

long SetSmoothLineArt(BOOL bSmooth, long level);

Parameters

bSmooth
[in] whether to smooth ine art.

level
[in] Reserved

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to smooth text or not.

long SetSmoothText(BOOL bSmooth, long level);

Parameters

bSmooth
[in] whether to smooth text.

level
[in] Reserved

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Set the zoom scale for document page view.

long SetZoom(OCX_ZoomType zoomType, long percent);

Parameters

zoomType
[in] see OCX_ZoomType.

percent
[in] the zoom factor in precent.

Return Values
  0      =  Normal
-1       =  Parameter error
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Set the "Zoom" scale and the "Scroll To" position in Window Coordinate system.

long SetZoomScroll(long percent, long left, long top);

Parameters

percent
[in] zoom factor in percentage. Specify "0" to keep the existing zoom factor unchanged.

left
[in] x-coordinate of the left-top corner of current display to scroll to in "Window Device Coordinate".

top
[in] y-coordinate of the left-top corner of current display to scroll to in "Window Device Coordinate".

Return Values
  0      =  Normal
-1       =  Parameter error
-15      =  Busy
-16      =  Other errors
Remarks

The left and top member is relative to the upper-left corners of the OCX Window client area, which has the different means to the GetZoomScroll function. The result of GetZoomScroll can't be used to SetZoomScroll directly.The following example codes is to restore the previous scrolling position:

long percent, left, top ;
GetZoomScroll( &percent, &left, &top ) ; // remember the scrolling position
...............
long percent2, left2, top2 ;
SetZoom( OCX_ZoomPercent, percent ) ; // restore the zoom
GetZoomScroll( &percent2, &left2, &top2 ) ; // get current position
SetZoomScroll( 0, left-left2, top-top2 ) ; // restore the old position


_DPDFReader Methods

Whether to show the "extern button" located on the right top of the viewer.

long ShowExternButton(BOOL bShow);

Parameters

bShow
[in] True to show the button, false to remove it.
Default is false.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to tear off the Navigation Pane. The splitter bar will also be removed altogether.

long ShowNavigationPane(BOOL bShow, [optional] VARIANT flags);

Parameters

bShow
[in] True to show the navigation pane, false to remove it.

flags
[in] Reserved, unused currently.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to show the "Control Bar" located under "Page View" to the right of "Scroll Bar".

long ShowPageViewControlBar(BOOL bShow);

Parameters

bShow
[in] True to show the control bar, false to remove it.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to show the scroll bar located on the right of the pageview.

long ShowPageViewScrollBar(BOOL bShow);

Parameters

bShow
[in] True to show the scroll bar, false to remove it.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to show the scroll bar located on the right of the navigation panel always.

long ShowScrollBarAlways(BOOL bAlways);

Parameters

bAlways
[in] True to show the scroll bar always, False to other.
Default is false.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Whether to show the tooltip.

long ShowTooltip(BOOL bShow);

Parameters

bShow
[in] True to show the tooltip.
Default is true.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


_DPDFReader Methods

Enables or disables the OCX's hotkeys.

long SwitchHotkey(BSTR hotkey, BOOL bEnable);

Parameters

hotkey
[in] OCX's hotkey, which is one of the strings defined below:
Ctrl+P: Print.
Ctrl+C: Copy.
Ctrl+A: Select All.
Ctrl+D: Deselect All.
Ctrl+PageUp: Goto First Page.
PageUp: Goto Previous Page.
PageDown: Goto Next Page.
Ctrl+PageDown: Goto Last Page.
Alt+<-: Go Back.
Alt+->: Go Forward.
Ctrl++: Zoom In.
Ctrl+-: Zoom Out.
Ctrl+1: Actual Size(100%).
Ctrl+2: Fit Page.
Ctrl+3: Fit Width.
Ctrl+4: Fit Height.
Alt+1: Single Page.
Alt+2: Continuous.
Alt+3: Continuous-Facing.
Shift++: Rotate Clockwise.
Shift+-: Rotate CounterClockwise.
ArrowUp: Scroll View - Up.
ArrowDown: Scroll View - Down.
<-: Scroll View - Left.
->: Scroll View - Right.
F10: Show/Hide Window Control.

bEnable
[in] Specifies whether to enable or disable the hotkey.

Return Values
  0    =  Normal
-16   =  Other errors


_DPDFReader Methods

Transform"User Coordinates (points)"to either "Window Device Coordinates (pixels)" or "Page Device Coordinates (pixels)".

long UCToDC(long type, long xUC, long yUC, long *xDC, long *yDC);

Parameters

type
[in] 0: "xDC, yDC" returned are "Window Device Coordinate".
1: "xDC, yDC" returned are "Page Device Coordinate".

xUC
[in] x-coordinate of the current page in "User Coordinate" system.

yUC
[in] y-coordinate of the current page in "User Coordinate" system.

yDC
[out] x-coordinate transformed.

yDC
[out] y-coordinate transformed.

Return Values
  0      =  Normal
-1       =  Parameter error
-15      =  Busy
-16      =  Other errors
Remarks

Transform "User Coordinates (points)" to either "Window Device Coordinates (pixels)" or "Page Device Coordinates (pixels)" according to the "Type" setting. See "Coordinate System" section for more information. You should specify current page using the method -- SetCurrentPage, before calling this function.


_DPDFReader Methods

Repaint page contents within the specified rectangle.

long UpdateView(long left, long top, long right, long bottom);

Parameters

left,top,right,bottom
[in] the update rectangle in Page Device coordinates.

Return Values
  0      =  Normal
-15      =  Busy
-16      =  Other errors


interface IPDFReaderInfo Overview

canCopy | Retrieves whether can to copy the contents into the clipboard.
canEditDoc | Retrieves whether can to edit the document.
canEditNote | Retrieves whether can to add, modify or delete the notes.
canPrint | Retrieves whether can to print.
GetCurrentPage | Returns the zero-based index of the current page.
GetDocumentInfo | Retrieve the standard "Document Info" fields of the current PDF document.
GetFontCount | Get the font counts in the PDF document.
GetFontInfo | Get the font information of specified index in the PDF document.
GetPageBitmap | Generate bitmap for the specified page.
GetPageCount | Get the total number of pages of the PDF document.
GetPageCropBox | Retrieve the "Crop Box" of the specified page.
GetPageView | Get the window handle of current page view.
GetPDFVersion | Get the pdf's version.
IsAllFontsAvailable | Retrieves whether all the fonts of the PDF document are available or not.
securityMethod | Retrieves the security method.
SetCurrentPage | Set the current page index.


IPDFReaderInfo Methods

Retrieves whether can to copy the contents into the clipboard.

HRESULT get_canCopy(BOOL *pVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether can to copy the contents into the clipboard.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Retrieves whether can to edit the document.

HRESULT get_canEditDoc(BOOL *pVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether can to edit the document.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Retrieves whether can to add, modify or delete the notes.

HRESULT get_canEditNote(BOOL *pVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether can to add, modify or delete the notes.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Retrieves whether can to print.

HRESULT get_canPrint(BOOL *pVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether can to print.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Returns the zero-based index of the current page.

HRESULT GetCurrentPage(long *curPageNo);

Parameters

curPageNo
[out] zero-based index of the current page.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Retrieve the standard "Document Info" fields of the current PDF document.

HRESULT GetDocumentInfo(BSTR *pTitle, BSTR *pSubject, BSTR *pAuthor, BSTR *pKeywords, BSTR *pCreator, BSTR *pProducer, BSTR *pCreatedDate, BSTR *pModifiedDate);

Parameters

pTitle
[out] The document's title, can be NULL.

pSubject
[out] The subject of the document, can be NULL.

pAuthor
[out] The name of the person who created the document, can be NULL.

pKeywords
[out] Keywords associated with the document, can be NULL.

pCreator
[out] If the document was converted to PDF from another format, the name of the application (for example, Adobe FrameMaker) that created the original document from which it was converted, can be NULL.

pProducer
[out] If the document was converted to PDF from another format, the name of the application (for example, Acrobat Distiller) that converted it to PDF, can be NULL.

pCreatedDate
[out] The date and time the document was created, can be NULL.

pModifiedDate
[out] The date and time the document was most recently modified, can be NULL.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors
Remarks

Application must call SysFreeString function to release these strings.


IPDFReaderInfo Methods

Get the font counts in the PDF document.

HRESULT GetFontCount(long *pCount);

Parameters

pCount
[out] The number of fonts count in the document.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Get the font information of specified index in the PDF document.

HRESULT GetFontInfo(long index, BSTR *pFontName, BSTR *pFontType, BOOL *pbEmbedded, BSTR *pUseFontName, BSTR *pUseFontType, BSTR *pEncoding);

Parameters

index
[in] Specify which font info to be obtained.

pFontName
[out] The font's name, can be NULL.

pFontType
[out] The font's type, can be NULL.

pbEmbedded
[out] whether this font is embedded, can be NULL.

pUseFontName
[out] The name of actual font used if it's not embedded, can be NULL.

pUseFontType
[out] The type of actual font used if it's not embedded, can be NULL.

pEncoding
[out] The font's encoding, can be NULL.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Generate bitmap for the specified page.

HRESULT GetPageBitmap(long nPageNo, float scale, long *pImage);

Parameters

nPageNo
[in] zero-based index of the page.

scale
[in] the scale to render the page bitmap.

pImage
[out] pointer to a bitmap handle to be generated by this method. If there is anything wrong, ¡°NULL¡± is returned.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors
Remarks

Application must call DeleteObject function to release this bitmap handle.


IPDFReaderInfo Methods

Get the total number of pages of the PDF document.

HRESULT GetPageCount(long *pageNum);

Parameters

pageNum
[out] The number of pages of the document.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Retrieve the "Crop Box" of the specified page.

HRESULT GetPageCropBox(long nPageNo, long *left, long *top, long *width, long *height);

Parameters

nPageNo
[in] zero-based index of the page.

left
[out] x-coordinates (in points) of the lower-left corner of the page crop box in User Space.

top
[out] y-coordinates (in points) of the lower-left corner of the page crop box in User Space.

width
[out] width of the page crop box.

height
[out] height of the page crop box.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors
Remarks

Note: page contents outside of the crop box are invisible.


IPDFReaderInfo Methods

Get the window handle of current page view.

HRESULT GetPageView(long *phwnd);

Parameters

phwnd
[out] window handle of the pageview.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Get the pdf's version.

HRESULT GetPDFVersion(OCX_PDFVersion *pVersion);

Parameters

pVersion
[out] PDF's version. see OCX_PDFVersion.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Retrieves whether all the fonts of the PDF document are available or not.

HRESULT IsAllFontsAvailable(BOOL *pVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether all the fonts of the PDF document are available or not.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Retrieves the security method.

HRESULT get_securityMethod(BSTR *pVal);

Parameters

pVal
[out] Pointer to a variable of type BSTR that indicate the security method. NULL if no security. You should free it by using SysFreeString.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderInfo Methods

Set the current page index.

HRESULT SetCurrentPage(long curPageNo);

Parameters

curPageNo
[in] zero-based index of the page.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors
Remarks

Since Reader OCX support 3 different kinds of viewing layout ¨C Single Page, Continuous Page, and Facing Page, multiple pages can be displayed on screen. Therefore, it is necessary to tell the viewer which page you are working on. For example, before calling UC2DC or DC2UC methods, you must set ¡°Current Page¡± first, and then restore original ¡°Current Page¡± ¨C returned by previous ¡°SetCurrentPage¡±, right after conversion. ¡°Set Current Page¡± -- ¡°Do Coordinates Conversion¡± -- ¡°Restore Current Page¡±
Note: The Current Page might not be the same as the ¡°Page Number¡± displayed on the ¡°Control Bar¡±. You should avoid causing any major changes to the page view ¨C such as scrolling, to ensure that you end up restoring the page to the correct value.


interface IPDFReaderPrint Overview

AbortPrint | Abort the print if is printing.
IsPrinting | Whether is printing.
Print | Print the PDF document according to the property settings in IPDFReaderPrint.
PrintWithHandle | Print the PDF document according to the opened printer handle and the property settings in IPDFReaderPrint.
autoRotateAndCenter | Sets or retrieves whether to rotate and center the page automatically.
collate | Sets or retrieves whether to collate document pages if the "nCopies" value is more than one.
content | Sets or retrieves the Content type to print.
copies | Sets or retrieves the number of hard copies to be printed.
evenOdd | Sets or retrieves whether to print all pages, or odd pages only, or, even pages only.
firstPage | Sets or retrieves the first page to print.
lastPage | Sets or retrieves the last page to print.
Nup | Sets or retrieves the N-up printing type¨C print multiple pages in one paper.
pageRange | Sets or retrieves the page range to print -- All page, Current page, FromTo, etc.
pageScaling | Sets or retrieves the PageScaling type to print.
portName | Sets or retrieves the Port name to print.
printDC | Sets or retrieves the handle of printer device context.
printerName | Sets or retrieves the printer name.
removeWhiteMargin | Sets or retrieves whether to remove white margins when printing.
reverse | Sets or retrieves whether to print document pages in reverse order.
showCancelDialog | Sets or retrieves whether to show a Cancel dialog.
showPrintDialog | Sets or retrieves whether to show a Print dialog.
tileCutMarks | Sets or retrieves the CutMarks type for tile page.
tileLabels | Sets or retrieves whether to show the label for tile page.
tileOverlap | Sets or retrieves the overlap for tile page.
tileScale | Sets or retrieves the scale for tile page.
waitForComplete | Sets or retrieves whether to print in the foreground.
printAsImage | Sets or retrieves whether to print as image.


IPDFReaderPrint Methods

Abort the print if is printing.

HRESULT AbortPrint();

Parameters

None

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to rotate and center the page automatically.

HRESULT get_autoRotateAndCenter(BOOL *pVal);
HRESULT put_autoRotateAndCenter(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to rotate and center the page automatically.

newVal
[in] BOOL that indicate whether to rotate and center the page automatically. Default is TRUE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to collate document pages if the "nCopies" value is more than one.

HRESULT get_collate(BOOL *pVal);
HRESULT put_collate(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to collate document pages.

newVal
[in] BOOL that indicate whether to collate document pages. Default is TRUE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to roate and center the page automatically.

HRESULT get_content(OCX_PrintContent *pVal);
HRESULT put_content(OCX_PrintContent newVal);

Parameters

pVal
[out] Pointer to a variable of type OCX_PrintContent that indicate whether to print comment, or content only.

newVal
[in] OCX_PrintContent that indicate whether to print comment, or content only. Default is OCX_ContentAndComment.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the number of hard copies to be printed.

HRESULT get_copies(int *pVal);
HRESULT put_copies(int newVal);

Parameters

pVal
[out] Pointer to a variable of type int that indicate the number of hard copies to be printed.

newVal
[in] int that indicate the number of hard copies to be printed. Default is 1.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to print all pages, or odd pages only, or, even pages only.

HRESULT get_evenOdd(OCX_PrintOddEvenRange *pVal);
HRESULT put_evenOdd(OCX_PrintOddEvenRange newVal);

Parameters

pVal
[out] Pointer to a variable of type OCX_PrintOddEvenRange that indicate whether to print all pages, or odd pages only, or, even pages only.

newVal
[in] OCX_PrintOddEvenRange that indicate whether to print all pages, or odd pages only, or, even pages only. Default is OCX_OddEven.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the first page to print.

HRESULT get_firstPage(int *pVal);
HRESULT put_firstPage(int newVal);

Parameters

pVal
[out] Pointer to a variable of type int that indicate the first page to print.

newVal
[in] int that indicate the first page to print, which is zero-based index. Default is 0.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Whether is printing.

HRESULT IsPrinting(BOOL *bPrinting);

Parameters

bPrinting
[out] Pointer to a variable of type BOOL that indicate whether is printing.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the last page to print.

HRESULT get_lastPage(int *pVal);
HRESULT put_lastPage(int newVal);

Parameters

pVal
[out] Pointer to a variable of type int that indicate the last page to print.

newVal
[in] int that indicate the last page to print, which is zero-based index. Default is 0.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the N-up printing type¨C print multiple pages in one paper.

HRESULT get_Nup(int *pVal);
HRESULT put_Nup(int newVal);

Parameters

pVal
[out] Pointer to a variable of type OCX_PrintUpSelector that indicate the N-up printing type.

newVal
[in] OCX_PrintUpSelector that indicate the N-up printing type. Default is OCX_2UP.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the page range to print -- All page, Current page, FromTo, etc.

HRESULT get_pageRange(OCX_PrintPageRange *pVal);
HRESULT put_pageRange(OCX_PrintPageRange newVal);

Parameters

pVal
[out] Pointer to a variable of type OCX_PrintPageRange that indicate the page range to print.

newVal
[in] OCX_PrintPageRange that indicate the page range to print. Default is OCX_PrintPageRangeAll.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the PageScaling type to print.

HRESULT get_pageScaling(OCX_PrintPageScaling *pVal);
HRESULT put_pageScaling(OCX_PrintPageScaling newVal);

Parameters

pVal
[out] Pointer to a variable of type OCX_PrintPageScaling that indicate the PageScaling type to print.

newVal
[in] OCX_PrintPageScaling that indicate the PageScaling type to print. Default is OCX_None.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the Port name to print.Not supported currently.

HRESULT get_portName(BSTR *pVal);
HRESULT put_portName(BSTR newVal);

Parameters

pVal
[out] Pointer to a variable of type BSTR that indicate the Port name to print.You should free it by using SysFreeString.

newVal
[in] BSTR that indicate the Port name to print.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Print the PDF document according to the property settings in IPDFReaderPrint.

HRESULT Print();

Parameters

None

Return Values
S_OK             =  Normal
S_FALSE      =  Other errors
0x80FF9527 =  The PDF document isn't opened yet
0x80FF9528 =  The OCX is printing another PDF document
0x80FF9529 =  The PDF document cannot be printed because of no security permission


IPDFReaderPrint Methods

Print the PDF document according to the opened printer handle and the property settings in IPDFReaderPrint.

HRESULT PrintWithHandle(long hPrinter);

Parameters

hPrinter
[in] The handle of the printer object. Use Windows API OpenPrinter or AddPrinter function to retrieve a printer handle.

Return Values
S_OK             =  Normal
S_FALSE      =  Other errors
0x80FF9527 =  The PDF document isn't opened yet
0x80FF9528 =  The OCX is printing another PDF document
0x80FF9529 =  The PDF document cannot be printed because of no security permission
Remarks

After you get the printer handle with the OpenPrinter function, you can use the DocumentProperties and SetPrinter functions to modify the printer settings. The modification will be effective during the printing process.


IPDFReaderPrint Methods

Sets or retrieves whether to print as image.

HRESULT get_printAsImage(BOOL *pVal);
HRESULT put_printAsImage(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to print as image.

newVal
[in] BOOL that indicate whether to print as image..Default is FALSE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the handle of printer device context.

HRESULT get_printDC(long *pVal);
HRESULT put_printDC(long newVal);

Parameters

pVal
[out] Pointer to a variable of type long that indicate the handle of printer device context.

newVal
[in] long that indicate the handle of printer device context.Default is NULL.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the printer name.

HRESULT get_printerName(BSTR *pVal);
HRESULT put_printerName(BSTR newVal);

Parameters

pVal
[out] Pointer to a variable of type BSTR that indicate the Printer name to print.You should free it by using SysFreeString.

newVal
[in] BSTR that indicate the Printer name to print.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors
Remarks

You must specify the printer name when using the OCX_ChooseByPageSize as the page scaling. In other situations, it's not required.


IPDFReaderPrint Methods

Sets or retrieves whether to remove white margins when printing.

HRESULT get_removeWhiteMargin(BOOL *pVal);
HRESULT put_removeWhiteMargin(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to remove white margin.

newVal
[in] BOOL that indicate whether to remove white margin.Default is FALSE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to print document pages in reverse order.

HRESULT get_reverse(BOOL *pVal);
HRESULT put_reverse(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to print document pages in reverse order.

newVal
[in] BOOL that indicate whether to print document pages in reverse order.Default is FALSE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to show a Cancel dialog.

HRESULT get_showCancelDialog(BOOL *pVal);
HRESULT put_showCancelDialog(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to show a Cancel dialog.

newVal
[in] BOOL that indicate whether to show a Cancel dialog.Default is TRUE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to show a Print dialog.

HRESULT get_showPrintDialog(BOOL *pVal);
HRESULT put_showPrintDialog(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to show a Print dialog.

newVal
[in] BOOL that indicate whether to show a Print dialog.Default is TRUE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors
Remarks

If choose not to show a Print dialog, the printDC mustn't be NULL.


IPDFReaderPrint Methods

Sets or retrieves the CutMarks type for tile page.

HRESULT get_tileCutMarks(OCX_PrintCutMarks *pVal);
HRESULT put_tileCutMarks(OCX_PrintCutMarks newVal);

Parameters

pVal
[out] Pointer to a variable of type OCX_PrintCutMarks that indicate the CutMarks type to print.

newVal
[in] OCX_PrintCutMarks that indicate the CutMarks type to print.Default is OCX_CutMark_None.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to show the label for tile page.

HRESULT get_tileLabels(BOOL *pVal);
HRESULT put_tileLabels(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to show the label.

newVal
[in] BOOL that indicate whether to show the label.Default is FALSE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the overlap for tile page.

HRESULT get_tileOverlap(float *pVal);
HRESULT put_tileOverlap(float newVal);

Parameters

pVal
[out] Pointer to a variable of type float that indicate the overlap.

newVal
[in] float that indicate the overlap.Default is 0.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves the scale for tile page.

HRESULT get_tileScale(long *pVal);
HRESULT put_tileScale(long newVal);

Parameters

pVal
[out] Pointer to a variable of type long that indicate the scale for tile page.

newVal
[in] long that indicate the scale for tile page.Default is 100.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


IPDFReaderPrint Methods

Sets or retrieves whether to print in the foreground.

HRESULT get_waitForComplete(BOOL *pVal);
HRESULT put_waitForComplete(BOOL newVal);

Parameters

pVal
[out] Pointer to a variable of type BOOL that indicate whether to print in the foreground.

newVal
[in] BOOL that indicate whether to print in the foreground.Default is FALSE.

Return Values
S_OK        =  Normal
S_FALSE =  Other errors


dispinterface _DPDFReaderEvents Overview

ActionFileLinkClicked | The event is fired whenever user clicks on a "OpenFile Link" annotation.
ActionGotoLinkClicked | The event is fired whenever user clicks on a "Goto Link" annotation.
ActionGotoRLinkGetDestFile | The event is fired whenever user clicks on a "GotoR Link" annotation.
ActionGotoRLinkClicked | The event is fired whenever user clicks on a "GotoR Link" annotation.
ActionWebLinkClicked | The event is fired whenever user clicks on a "Web Link" annotation.
BeginEnumWords | The event is fired before enumerating words in PDF document.
ContextMenu | The event is fired whenever user right-click mouse button in Reader OCX.
CryptGetPassword | The event is fired to let a user give a password.
EndEnumWords | The event is fired after completing the word enumeration.
EnumSelectedWord | The event is fired to emit words selected previously.
EnumWord | The event is fired to emit a word in the pdf file.
EnumWord2 | The event is fired to emit a word in the pdf file.
FindFinish | The event is fired when completing the "Find" operation.
FindFinishAPage | The event is fired after finishing the search on a page each.
FindStart | The event is fired when starting the "Find" operation.
FlipStart | The event is fired before the flipping.
FlipEnd | The event is fired after the flipping.
LButtonDblClk | The event is fired whenever user double-clicks the left mouse button in Reader OCX.
LButtonDown | The event is fired whenever user presses the left mouse button in Reader OCX.
LButtonUp | The event is fired whenever user releases the left mouse button in Reader OCX.
MouseMove | The event is fired whenever cursor moves in Reader OCX window.
PageViewDidChanged | The event is fired whenever the "Page View" is changed.
PageViewDidDraw | The event is fired whenever redrawing occurred in the page view section of the window.
PageViewWillDraw | The event is fired whenever redrawing will occur in the page view section of the window.
PDFDidPrintDoc | The event is fired after the printing.
PDFDidPrintPage | The event is fired after per page that is printed.
PDFWillPrintDoc | The event is fired before the printing.
PDFWillPrintPage | The event is fired before per page that is printed.
RButtonDblClk | The event is fired whenever user double-clicks the right mouse button in Reader OCX.
RButtonDown | The event is fired whenever user presses the right mouse button in Reader OCX.
RButtonUp | The event is fired whenever user releases the right mouse button in Reader OCX.
SelectedWordRange | The event is fired to notify which range the selected words are in.
SelectedWordArray | The event is fired to notify what the indices of the selected words are.


DPDFReaderEvents Methods

The event is fired whenever user clicks on a "OpenFile Link" annotation.

[id(41)] void ActionFileLinkClicked(BSTR filename, BSTR operation, BSTR parameters, BSTR directory, BOOL* pbHandled);

Parameters

filename
[in] the full path of the file to be opened.

operation
[in] specifies the action to be performed.for example "open".

parameters
[in] specifies the parameters to be passed to the application.

directory
[in] specifies the default directory.

pbHandled
[out] true: tell the viewer the event is handled, the viewer will do nothing ;
false: the viewer will do its default action.

Return Values
None
Remarks

OCX will call the function ShellExecute by default, if this event isn't handled.


DPDFReaderEvents Methods

The event is fired whenever user clicks on a "Goto" annotation.

[id(44)] void ActionGotoLinkClicked(long pageno, OCX_FitType fitType, long left, long right, long top, long bottom, long zoom, VARIANT_BOOL* pbHandled);

Parameters

pageno
[in] The page number of the destination view.

fitType
[in] The fit type of the destination view. See OCX_FitType.

left, right, top, bottom
[in] A rectangle enclosing the destination view in Page Device coordinates.

zoom
[in] the zoom factor in precent.

pbHandled
[out] true: the event is handled and no action is taken; return false if OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user clicks on a "GotoR" annotation.

[id(44)] void ActionGotoRLinkGetDestFile(BSTR filename, VARIANT_BOOL* pbIStream, LPVARIANT *pStream, BSTR *destfile, BSTR *password, VARIANT_BOOL* pbHandled);

Parameters

filename
[in] Thje pathname stored in the link, either absolute or relative.

pbIStream
[out] TRUE: return a IStream interface pointer containing the target page view, the ppIStream is used.
FALSE: return A re-solved pathname which the OCX will use, and the destfile and password are used.

pStream
[out] A IStream interface pointer containing the target page view through the 'punkVal' member.

destfile
[out] A re-solved pathname which the OCX will use to open and view.

password
[out] password to open the file. "NULL" means no password.

pbHandled
[out] true: the event is handled and no action is taken; return false if OCX will handle the event.

Return Values
None
Remarks

When a GotoR action is activated, two events are sent to client. First is the 'ActionGotoRLinkGetDestFile', then is the 'ActionGotoRLinkClicked'.The OCX should get the resolved pathname or a IStream about the link from the client through the first event, then OCX will open the target document and resolve the destination page view, and fire the second event with "page number", "fit type", ..etc.


DPDFReaderEvents Methods

The event is fired whenever user clicks on a "GotoR" annotation.

[id(43)] void ActionGotoRLinkClicked(long pageno, OCX_FitType fitType, long left, long right, long top, long bottom, long zoom, VARIANT_BOOL* pbHandled);

Parameters

pageno
[in] The page number of the destination view.

fitType
[in] The fit type of the destination view. See OCX_FitType.

left, right, top, bottom
[in] A rectangle enclosing the destination view in Page Device coordinates.

zoom
[in] the zoom factor in precent.

pbHandled
[out] true: the event is handled and no action is taken; return false if OCX will handle the event.

Return Values
None
Remarks

See the first event 'ActionGotoRLinkGetDestFile'.


DPDFReaderEvents Methods

The event is fired whenever user clicks on a "Web Link" annotation.

[id(40)] void ActionWebLinkClicked(BSTR slinkText, BOOL* pbHandled);

Parameters

slinkText
[in] specifies the hyperlink string.

pbHandled
[out] true: the event is handled and no action is taken; return false if OCX will handle the event.

Return Values
None
Remarks

OCX will call the function ShellExecute by default, if this event isn't handled.


DPDFReaderEvents Methods

The event is fired before enumerating words in PDF document.

[id(10)] void BeginEnumWords();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user right-click mouse button in Reader OCX.

[id(20)] void ContextMenu(long hwnd, long x, long y, BOOL* pbHandled);

Parameters

hwnd
[in]Handle to the window in which user right-clicked the mouse button.

x,y
[in] Cursor position in the window¡¯s device coordinates, at the time of the mouse clicking.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false:(Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired to let a user give a password.

[id(70)] void CryptGetPassword(BSTR* password);

Parameters

password
[out] containing the password.

Return Values
None
Remarks

This event will be invoked three times if OCX needs the password during the process of opening the document, and the method OpenFile or OpenFileFromIStream will return -16 if no correct password given after three times.


DPDFReaderEvents Methods

The event is fired after completing the word enumeration.

[id(13)] void EndEnumWords();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired to emit words selected previously.

[id(12)] void EnumSelectedWord(BSTR word, BOOL *bContinue);

Parameters

word
[in] The word emitted.

bContinue
[out] true: (Default) to continue the enumeration.
false:to stop.

Return Values
None


DPDFReaderEvents Methods

The event is fired to emit a word in the pdf file.

[id(11)] void EnumWord(long nPageNo, BSTR word, long offset, long wordlength, BOOL *bContinue);

Parameters

nPageNo
[in] the number of the page in which the word is.

word
[in] The word emitted.

offset
[in] The word's character offset from the beginning of the page.

wordlength
[in] Number of characters in the word.

bContinue
[out] true: (Default) to continue the enumeration.
false:to stop.

Return Values
None


DPDFReaderEvents Methods

The event is fired to emit a word in the pdf file.

[id(11)] void EnumWord2(long nPageNo, BSTR word, long offset, long wordlength, OCX_WordAttr wa, BOOL *bContinue);

Parameters

nPageNo
[in] the number of the page in which the word is.

word
[in] The word emitted.

offset
[in] The word's character offset from the beginning of the page.

wordlength
[in] Number of characters in the word.

wa
[in] The word's attribute. See OCX_WordAttr.

bContinue
[out] true: (Default) to continue the enumeration.
false:to stop.

Return Values
None
Remarks

This event supersedes the EnumWord event.


DPDFReaderEvents Methods

The event is fired when completing the "Find" operation.

[id(3)] void FindFinish();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired after finishing the search on a page each.

[id(2)] void FindFinishAPage(long nPageNo, BOOL *pbStop);

Parameters

nPageNo
[in] zero-base index of the page.

pbStop
[out] true: to stop the searching.
false: (Default) to continue the searching.

Return Values
None


DPDFReaderEvents Methods

The event is fired when starting the "Find" operation.

[id(1)] void FindStart();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired before the flipping.

[id(63)] void FlipStart();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired after the flipping.

[id(63)] void FlipEnd();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user double-clicks the left mouse button in Reader OCX.

[id(24)] void LButtonDblClk(long x, long y, long flags, BOOL* pbHandled);

Parameters

x,y
[in] Cursor position in window¡¯s device coordinates.

flags
[in] Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL: The CTRL key is down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: The SHIFT key is down.
MK_XBUTTON1: Windows 2000/XP: The first X button is down.
MK_XBUTTON2: Windows 2000/XP: The second X button is down.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false: (Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user presses the left mouse button in Reader OCX.

[id(22)] void LButtonDown(long x, long y, long flags, BOOL* pbHandled);

Parameters

x,y
[in] Cursor position in window¡¯s device coordinates.

flags
[in] Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL: The CTRL key is down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: The SHIFT key is down.
MK_XBUTTON1: Windows 2000/XP: The first X button is down.
MK_XBUTTON2: Windows 2000/XP: The second X button is down.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false: (Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user releases the left mouse button in Reader OCX.

[id(23)] void LButtonUp(long x, long y, long flags, BOOL* pbHandled);

Parameters

x,y
[in] Cursor position in window¡¯s device coordinates.

flags
[in] Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL: The CTRL key is down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: The SHIFT key is down.
MK_XBUTTON1: Windows 2000/XP: The first X button is down.
MK_XBUTTON2: Windows 2000/XP: The second X button is down.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false: (Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever cursor moves in Reader OCX window.

[id(21)] void MouseMove(long x, long y, long flags, BOOL* pbHandled);

Parameters

x,y
[in] Cursor position in window¡¯s device coordinates, at the time of the mouse move.

flags
[in] Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL: The CTRL key is down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: The SHIFT key is down.
MK_XBUTTON1: Windows 2000/XP: The first X button is down.
MK_XBUTTON2: Windows 2000/XP: The second X button is down.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false: (Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever the "Page View" is changed.

[id(50)] void PageViewDidChanged(long lChangedIsssue);

Parameters

lChangedIsssue
[in] Indicates the kind of change has happened. This parameter can take one or more of the following values.
1: The vertical or horizontal scroll size or ranges are changed.
2: The page number is changed.
4: The page size is changed.
8: The zoom is changed

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever redrawing occurred in the page view section of the window.

[id(52)] void PageViewDidDraw ();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever redrawing will occur in the page view section of the window.

[id(51)] void PageViewWillDraw ();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired after the printing.

[id(63)] void PDFDidPrintDoc(long result);

Parameters

result
[in] Reserved.

Return Values
None


DPDFReaderEvents Methods

The event is fired after per page that is printed.

[id(62)] void PDFDidPrintPage(long nPageNo);

Parameters

nPageNo
[in] zero-based index of page which is printing.

Return Values
None


DPDFReaderEvents Methods

The event is fired before the printing.

[id(60)] void PDFWillPrintDoc();

Parameters

None

Return Values
None


DPDFReaderEvents Methods

The event is fired before per page that is printed.

[id(61)] void PDFWillPrintPage(long nPageNo);

Parameters

nPageNo
[in] zero-based index of page which is printing.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user double-clicks the right mouse button in Reader OCX window.

[id(27)] void RButtonDblClk(long x, long y, long flags, BOOL* pbHandled);

Parameters

x,y
[in] Cursor position in window¡¯s device coordinates.

flags
[in] Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL: The CTRL key is down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: The SHIFT key is down.
MK_XBUTTON1: Windows 2000/XP: The first X button is down.
MK_XBUTTON2: Windows 2000/XP: The second X button is down.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false: (Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user presses the right mouse button in Reader OCX.

[id(25)] void RButtonDown(long x, long y, long flags, BOOL* pbHandled);

Parameters

x,y
[in] Cursor position in window¡¯s device coordinates.

flags
[in] Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL: The CTRL key is down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: The SHIFT key is down.
MK_XBUTTON1: Windows 2000/XP: The first X button is down.
MK_XBUTTON2: Windows 2000/XP: The second X button is down.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false: (Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired whenever user releases the right mouse button in Reader OCX.

[id(26)] void RButtonUp(long x, long y, long flags, BOOL* pbHandled);

Parameters

x,y
[in] Cursor position in window¡¯s device coordinates.

flags
[in] Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL: The CTRL key is down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: The SHIFT key is down.
MK_XBUTTON1: Windows 2000/XP: The first X button is down.
MK_XBUTTON2: Windows 2000/XP: The second X button is down.

pbHandled
[out] true: Client will handle the event, Reader OCX will return directly;
false: (Default) OCX will handle the event.

Return Values
None


DPDFReaderEvents Methods

The event is fired to notify what the indices of the selected words are.

[id(16)] void SelectedWordArray(long nPageNo, long *word, long count);

Parameters

nPageNo
[in] the zero-based index of the page to be selected.

word
[in] Points to an array which include the zero-based indices of the selected words in the page. This pointer is temporary and should not be stored for later use.

count
[in] size of the word index array.

Return Values
None
Remarks

See the function "GetHighlightedWords".


DPDFReaderEvents Methods

The event is fired to notify which range the selected words are in.

[id(15)] void SelectedWordRange(long nPageFrom, long nWordFrom, long nPageTo, long nWordTo);

Parameters

nPageFrom
[in] the zero-based index of the page be selected from.

nWordFrom
[in] the zero-based index of the first selected word in the start page.

nPageTo
[in] the zero-based index of the page be selected to.

nWordTo
[in] the zero-based index of the last selected word in the end page.

Return Values
None
Remarks

See the function "GetHighlightedWords".