Detailed Description
Header file for the asynchronous module.
Function Documentation
Create a document availability provider.
- Parameters:
-
| [in] | file_avail | - Pointer to the file availability interface to check availability of file data. |
| [in] | file | - Pointer to a file access interface for reading data from file. |
- Note:
- Application must call FPDFAvail_Destroy when done with the availability provider.
- Return values:
-
| A | handle to the document availability provider or NULL to indicate an error occurred. |
| DLLEXPORT void STDCALL FPDFAvail_Destroy |
( |
FPDF_AVAIL |
avail | ) |
|
Destroy a document availability provider.
- Parameters:
-
| [in] | avail | - Handle to document availability provider returned by FPDFAvail_Create. |
- Return values:
-
| DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument |
( |
FPDF_AVAIL |
avail | ) |
|
Get document from the availability provider.
- Parameters:
-
| [in] | avail | - Handle to the document availability provider returned by FPDFAvail_Create. |
- Note:
- After FPDFAvail_IsDocAvail() returns TRUE, the application should call this function to get the document handle. To close the document, use the FPDF_CloseDocument function.
- Return values:
-
| Handle | to the document or NULL if an error occurs. |
| DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum |
( |
FPDF_DOCUMENT |
document | ) |
|
Get the page number of the first available page in a linearized PDF.
- Parameters:
-
| [in] | document | - A document handle returned by FPDFAvail_GetDocument. |
- Note:
- For most linearized PDFs, the first available page would be just the first page. However, there are some PDFs that set the first available page to be a page other than the first page. For non-linearized PDF, this function will always return zero.
- Return values:
-
| Zero-based | index for the first available page. |
| DLLEXPORT int STDCALL FPDFAvail_IsDocAvail |
( |
FPDF_AVAIL |
avail, |
|
|
FX_DOWNLOADHINTS * |
hints |
|
) |
| |
Check whether the document is ready for loading, if not, get download hints.
- Parameters:
-
| [in] | avail | - Handle to document availability provider returned by FPDFAvail_Create. |
| [in] | hints | - Pointer to a download hints structure that will receive generated hints. |
- Note:
- The application should call this function whenever new data arrives. It should process all the generated download hints, if any, until the function returns a non-zero value. Then the application can call FPDFAvail_GetDocument() to get a document handle.
- Return values:
-
| Non-zero | indicates the page is fully available, 0 indicates the page not yet available. |
| DLLEXPORT int STDCALL FPDFAvail_IsFormAvail |
( |
FPDF_AVAIL |
avail, |
|
|
FX_DOWNLOADHINTS * |
hints |
|
) |
| |
Check whether form data is ready for initialization, if not, get download hints.
- Parameters:
-
| [in] | avail | - Handle to document availability provider returned by FPDFAvail_Create. |
| [out] | hints | - Pointer to a download hints interface structure that receives generated hints. |
- Note:
- This function can only be called after FPDFAvail_GetDocument is called. The application should call this function whenever new data arrives. The application should process all the generated download hints, if any, until the function returns a non-zero value. Then the application can perform page loading. FPDFDOC_InitFormFillEnviroument should be called after the function returns a non-zero value.
- Return values:
-
| Non-zero | value indicates form data is fully available, 0 indicates form data is not yet available. Details: -1 - Error, the input parameter is not correct (e.g. hints is NULL). 0 - Data is not available. 1 - Data is available. 2 - No form data. |
| DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized |
( |
FPDF_AVAIL |
avail | ) |
|
_FPDFAVAIL_H_
Check whether a document is a Linearized PDF.
- Parameters:
-
| [in] | avail | - Handle to document availability provider returned by FPDFAvail_Create. |
- Note:
- Returns TRUE/FALSE as soon as the first 1K chunk of data is received. The function must recive at least 1K to determine if the document is a linearized PDF.
- Return values:
-
| Return | TRUE means the document is a linearized PDF; otherwise it is not a linearized PDF. FSDK_IS_LINEARIZED is a linearized PDF. FSDK_NOT_LINEARIZED is not a linearized PDF. FSDK_UNKNOW_LINEARIZED can't deterine whether the file is a linearized PDF. |
| DLLEXPORT int STDCALL FPDFAvail_IsPageAvail |
( |
FPDF_AVAIL |
avail, |
|
|
int |
page_index, |
|
|
FX_DOWNLOADHINTS * |
hints |
|
) |
| |
Check whether a page is ready for loading, if not, get download hints.
- Parameters:
-
| [in] | avail | - Handle to document availability provider returned by FPDFAvail_Create. |
| [in] | page_index | - Index number of the page. 0 for the first page. |
| [out] | hints | - Pointer to a download hints interface structure that receives generated hints. |
- Note:
- This function can only be called after FPDFAvail_GetDocument is called. The application should call this function whenever new data arrives. It should process all the generated download hints, if any, until the function returns a non-zero value. Then the application can perform page loading.
- Return values:
-
| Non-zero | value indicates a page is fully available, 0 indicates a page is not yet available. |