Latest news: September 2, 2010
Advanced WiFi-Manager v4.6 released!
June 18, 2010
Advanced WiFi-Manager v4.5 released!
June 9, 2010
WinI2C/DDC v3.71 released!
| | |
|
Advanced PDF Viewer: Developer's Guide
|
Advanced PDF Viewer API Reference
int EnableLog(char *Path, int RemoveOld, int DebugOut)
For debug purposes. This function enables the log file for Advanced PDF Viewer library.
Parameters:
| Path [IN] - Full path and filename of the log file. |
| RemoveOld [IN] - If not zero then remove old log file. |
| DebugOut [IN] - If not zero then enable output to system debug log that can be viewed by DbgView utility. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function EnableLog (ByVal path As String, RemoveOld As Long, DbgOut As Long) As Long
Delphi declaration:
function EnableLog(Path:pansichar; RemoveOld:integer; DebugOut: integer):integer; stdcall;
Unicode support: Unicode version of this function: EnableLogW
Top
int DisableLog()
For debug purposes. This function disables the log file for Advanced PDF Viewer library.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function DisableLog () As Long
Delphi declaration:
function DisableLog:integer; stdcall;
Top
int WriteLog(char *Str)
For debug purposes. This function appends string to the log file of Advanced PDF Viewer library.
Parameters:
| Str [IN] - String to append. |
Return value: Zero if success, otherwise
error code.
VB declaration:
VB declaration: Function WriteLog (ByVal Str As String) As Long
Delphi declaration:
function WriteLog(Str: pchar):integer; stdcall;
Unicode support: Unicode version of this function: WriteLogW
Top
int GotoFirstPage()
Opens the first page of loaded PDF document.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GotoFirstPage () As Long
Delphi declaration:
function GotoFirstPage:integer; stdcall;
Top
int GotoLastPage()
Opens the last page of loaded PDF document.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GotoLastPage () As Long
Delphi declaration:
function GotoLastPage:integer; stdcall;
Top
int GotoNextPage()
Opens next page of loaded PDF document.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GotoNextPage () As Long
Delphi declaration:
function GotoNextPage:integer; stdcall;
Top
int GotoPreviousPage()
Opens previous page of loaded PDF document.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GotoPreviousPage () As Long
Delphi declaration:
function GotoPreviousPage:integer; stdcall;
Top
int Print()
Prints loaded PDF document.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function Print () As Long
Delphi declaration:
function Print:integer; stdcall;
Top
int PrintWithDialog()
Prints loaded PDF document with print dialog.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function PrintWithDialog () As Long
Delphi declaration:
function PrintWithDialog:integer; stdcall;
Top
int PrintPages(int FromInd, int ToInd)
Prints range of pages of loaded PDF document.
Parameters: None
| FromInd [IN] - First page index to print. |
| ToInd [IN] - Last page index to print. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function PrintPages (ByVal FromInd As Long, ByVal ToInd As Long) As Long
Delphi declaration:
function PrintPages(FromInd, ToInd: integer):integer; stdcall;
Top
int PrintPagesFit(int FromInd, int ToInd, int ShrinkToFit)
Prints range of pages of loaded PDF document.
Parameters: None
| FromInd [IN] - First page index to print. |
| ToInd [IN] - Last page index to print. |
| ShrinkToFit [IN] - If not zero then shrink pages to fit. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function PrintPagesFit (ByVal FromInd As Long, ByVal ToInd As Long, ByVal ShrinkToFit As Long) As Long
Delphi declaration:
function PrintPagesFit(FromInd, ToInd: integer; ShrinkToFit: integer):integer; stdcall;
Top
int PrintAll()
Prints all pages of loaded PDF document.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function PrintAll () As Long
Delphi declaration:
function PrintAll:integer; stdcall;
Top
int PrintAllFit(int ShrinkToFit)
Prints all pages of loaded PDF document.
Parameters: None
| ShrinkToFit [IN] - If not zero then shrink pages to fit. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function PrintAllFit (ByVal ShrinkToFit As Long) As Long
Delphi declaration:
function PrintAllFit(ShrinkToFit: integer):integer; stdcall;
Top
int CheckAcrobatReader()
Checks if Acrobat Reader v9.0 or higher is installed and configured as default viewer for PDF files. Only under these conditions Advanced PDF Viewer can be used.
Parameters: None
Return value: Zero if success and Advanced PDF Viewer can be used, otherwise
error code that explains the problem.
VB declaration:
Function CheckAcrobatReader () As Long
Delphi declaration:
function CheckAcrobatReader: integer; stdcall;
Top
int AllowUpdate(int Allow)
Enables auto-update feature of Acrobat Reader (it starts "Adobe_Updater.exe" in about 20 seconds after starting Acrobat Reader).
By default this feature is disabled by Advanced PDF Viewer, but you can enable it.
Parameters: None
| Allow [IN] - If not zero then enable auto-updates for Acrobat Reader. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function AllowUpdate (ByVal Allow As Long) As Long
Delphi declaration:
function AllowUpdate(Allow: integer):integer; stdcall;
Top
int LoadFile(char * FileName)
Opens PDF file with Advanced PDF Viewer.
Parameters:
| FileName [IN] - Full file name of PDF document to load. |
Return value: Zero if success, otherwise
error code.
VB declaration:
VB declaration: Function LoadFile (ByVal FileName As String) As Long
Delphi declaration:
function LoadFile(FileName: pansichar):integer; stdcall;
Unicode support: Unicode version of this function: LoadFileW
Top
int GetFileName(char *FileName, int MaxLen)
Returns file name of opened PDF file or empty string if no PDF file opened.
Parameters:
| FileName [OUT] - Full filename of opened PDF file. |
| MaxLen [IN] - Buffer length for filename. |
Return value: Returned string length if success, otherwise
error code.
VB declaration:
VB declaration: Function GetFileName (ByVal FileName As String, ByVal MaxLen As Long) As Long
Delphi declaration:
function GetFileName(FileName:pansichar; MaxLen:integer):integer; stdcall;
Unicode support: Unicode version of this function: GetFileNameW
Top
int GetCurrentPage()
Retrieves current page number of opened PDF file.
Parameters: None
Return value: Current page number if success, otherwise
error code.
VB declaration:
Function GetCurrentPage () As Long
Delphi declaration:
function GetCurrentPage:integer; stdcall;
Top
int SetCurrentPage(int PageInd)
Sets current page number of opened PDF document.
Parameters: None
| PageInd [IN] - page index to display. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function SetCurrentPage (ByVal PageInd As Long) As Long
Delphi declaration:
function SetCurrentPage(PageInd: integer):integer; stdcall;
Top
int GetPagesCnt()
Retrieves number of pages of opened PDF document.
Parameters: None
Return value: Number of pages if success, otherwise
error code.
VB declaration:
Function GetPagesCnt () As Long
Delphi declaration:
function GetPagesCnt: integer; stdcall;
Top
int GetPageBmpSize(int * Width, int * Height)
Retrieves page bitmap size of opened PDF document. Note bitmap size is related to current zoom level used for page displaying.
Parameters:
| Width [OUT] - Page width, in pixels. |
| Height [OUT] - Page height, in pixels. |
Return value: Zero if success, otherwise
error code.
VB declaration:
VB declaration: Function GetPageBmpSize (ByRef Width As Long, ByRef Height As Long) As Long
Delphi declaration:
function GetPageBmpSize(var Width, Height: integer):integer; stdcall;
Top
int GetPageSizeStr(char * Str, int MaxLen)
Retrieves page size of opened PDF document.
Parameters:
| Str [OUT] - Page size string. |
| MaxLen [IN] Length of string buffer. |
Return value: Returned string length if success, otherwise
error code.
VB declaration:
VB declaration: Function GetPageSizeStr (ByVal Str As String, ByVal MaxLen As Long) As Long
Delphi declaration:
function GetPageSizeStr(Str:pansichar; MaxLen:integer):integer; stdcall;
Unicode support: Unicode version of this function: GetPageSizeStrW
Top
int SetZoom(int Zoom)
Sets new zoom level used for pages displaying. You must load PDF file before using this function. Default zoom level is 100.
Parameters:
| Zoom [IN] - New zoom level, in percents. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function SetZoom (ByVal Zoom As Long) As Long
Delphi declaration:
function SetZoom(Zoom: Integer):integer; stdcall;
Top
int GetZoom()
Retrieves current zoom level used for pages displaying. You must load PDF file before using this function.
Parameters: None
Return value: Zoom level, in percents, if success, otherwise
error code.
VB declaration:
Function GetZoom () As Long
Delphi declaration:
function GetZoom:integer; stdcall;
Top
int DrawPageToCanvas(HDC dc; int x; int y)
Draws current page of opened PDF document to specified device context (DC).
Parameters:
| dc [IN] - graphical device context. See MSDN for more information about DC. |
| x [IN] X-offset for painting. |
| y [IN] Y-offset for painting. |
Return value: Zero if success, otherwise
error code.
VB declaration:
VB declaration: Function DrawPageToBmp (ByVal dc As Long, ByVal x As Long, ByVal y As Long) As Long
Delphi declaration:
function DrawPageToBmp(dc: HDC; x, y: integer):integer; stdcall;
Top
int FreeAllResources()
Frees all memory resources allocated by Advanced PDF Viewer library. You must call this function after using Advanced PDF Viewer library.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function FreeAllResources () As Long
Delphi declaration:
function FreeAllResources:integer; stdcall;
Top
DWORD GetPDFViewerVersion()
Retrieves the version of Advanced PDF Viewer library.
Parameters: None
Return value: Version number if success, otherwise
error code.
VB declaration:
Function GetPDFViewerVersion () As Long
Delphi declaration:
function GetPDFViewerVersion: integer; stdcall;
Top
|
|