ShowToolbar method
This method can be used to control the visibility of the toolbar contained in the control element.
Depending on the document type and configuration by other methods, some buttons may be deactivated.
For information about the button that activates and deactivates form field mode, see the section on Form Field Mode.
void ShowToolbar(int nShow);
void ShowToolbar(int nShow);
|
Parameter
|
In |
Out |
Possible Values |
Description |
|---|---|---|---|---|
|
nShow |
✔️ |
|
0 |
Hide toolbar |
|
1 |
Show toolbar |
ZoomIn method
This method zooms in on the displayed document. The zoom factor remains unchanged when switching between documents.
sbyte ZoomIn();
char ZoomIn();
|
Return value |
Description |
|---|---|
|
0 |
Zooming in was not successful |
|
1 |
Zooming in was successful |
CanZoomIn method
This method can be used to check whether zooming in is possible using ZoomIn().
sbyte CanZoomIn();
char CanZoomIn();
|
Return value |
Description |
|---|---|
|
0 |
Zooming in is not possible |
|
1 |
Zooming in is possible |
ZoomOut method
This method zooms out of the displayed document. The zoom factor remains unchanged when switching between documents.
sbyte ZoomOut();
char ZoomOut();
|
Return value |
Description |
|---|---|
|
0 |
Zooming out was unsuccessful |
|
1 |
Zooming out was successful |
CanZoomOut method
This method zooms out of the displayed document. The zoom factor remains unchanged when switching between documents.
sbyte CanZoomOut();
char CanZoomOut();
|
Return value |
Description |
|---|---|
|
0 |
Zooming out is not possible |
|
1 |
Zooming out is possible |
FitTo method
This method makes it possible to adjust the document in the display window.
The adjustment is realised by adjusting the zoom factor. The zoom factor remains unchanged when switching between documents. A document with different dimensions is zoomed accordingly without being adjusted automatically.
void FitTo(short nFormat);
void FitTo(short nFormat);
|
Parameter
|
In |
Out |
Possible Values |
Description |
|---|---|---|---|---|
|
nFormat |
✔️ |
|
0 |
The display window is set to the width of the current document |
|
1 |
The display window is set to the height of the current document |
|||
|
2 |
Page scroll mode; the document’s height is adjusted. For multi-page PDF documents, a scroll bar allows you to scroll through the pages. |
GetPageDimensions method
This method returns the size of one page of the loaded document. The values are rounded to three decimal places. If one of the two output parameters is a null pointer, only the other one is assigned.
int GetPageDimensions(int nPage, float* pnWidth, float* pnHeight, int nOptions);
long GetPageDimensions(long nPage, float* pnWidth, float* pnHeight, long nOptions);
|
Parameter
|
In |
Out |
Possible Values |
Description |
|---|---|---|---|---|
|
nPage |
✔️ |
|
>0 |
Page whose size is to be output |
|
-1 |
The size of the currently loaded page is returned. |
|||
|
pnWidth |
|
✔️ |
>0 |
Width of the page |
|
pnHeight |
|
✔️ |
>0 |
Height of the page |
|
nOptions |
✔️ |
0 - 2 |
Unit in which width and height are to be output |
|
|
|
0 |
Points (PDF) / pixels (image) |
||
|
1 |
Millimeters (only valid for PDF) |
|||
|
2 |
Inch (only valid for PDF) |
|||
|
Return value |
Description |
|
|---|---|---|
|
0 |
Method was executed successfully |
|
|
<0 |
An error has occurred |
|
|
|
-1 |
No document loaded |
|
|
-2 |
Invalid input |
|
|
-3 |
Invalid option |
BorderStyle property
This property can be used to set and read the style of the window frame of the control element.
short BorderStyle;
short BorderStyle;
|
In |
Out |
Possible Values |
Description |
|---|---|---|---|
|
✔️ |
✔️ |
0 |
Frame with a simple line |
|
1 |
Three-dimensional frame (standard) |
PageCount property
This property can be used to query the total number of pages.
int PageCount;
long PageCount;
|
In |
Out |
Possible Values |
Description |
|---|---|---|---|
|
|
✔️ |
>=1 |
Number of pages in the document |
|
0 |
No document loaded |
Page property
This property can be used to set the page to be displayed or query its number. If a transferred page number is not available, the call is ignored.
int Page;
long Page;
|
In |
Out |
Possible Values |
Description |
|---|---|---|---|
|
✔️ |
✔️ |
>=1 <= PageCount |
Current page or page to be set |
|
0 |
No document loaded |
UpdatePage event
This event signals that a page change has occurred or that the current page view has been refreshed. It is triggered once the displayed page changes and it outputs the new page number.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
public class _DSTImgCtlEvents_UpdatePageEvent
{
public short nPage;
public _DSTImgCtlEvents_UpdatePageEvent(short nPage)
{
this.nPage = nPage;
}
}
this.%COMPONENT_NAME%.UpdatePage += new AxSTIMGCTLLib._DSTImgCtlEvents_UpdatePageEventHandler(this.%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, AxSTIMGCTLLib._DSTImgCtlEvents_UpdatePageEvent e);
BEGIN_EVENTSINK_MAP(%CLASS_NAME%, CDialogEx)
ON_EVENT(%CLASS_NAME%, %COMPONENT_ID%, 2, %CALLBACK_FUNCTION%, VTS_I2)
END_EVENTSINK_MAP()
void %CALLBACK_FUNCTION%(short nPage);
|
Parameter |
Possible values |
Description |
|---|---|---|
|
nPage |
>=1 |
Number of the currently displayed page |