FPDFAVAIL

Classes

struct  _FX_FILEAVAIL
 A struct that provides an interface for checking whether the specified section of a PDF file is available. More...
struct  _FX_DOWNLOADHINTS
 An interface for receiving download hints. Use to receive hints for further downloading. More...

Files

file  fpdfavail.h
 

Header file for the asynchronous module - allows reading and downloading of a PDF file to occur at the same time. For example, an application can display the first page of the document while the other pages are still downloading.


Typedefs

typedef struct _FX_FILEAVAIL FX_FILEAVAIL
 A struct that provides an interface for checking whether the specified section of a PDF file is available.
typedef void * FPDF_AVAIL
typedef struct _FX_DOWNLOADHINTS FX_DOWNLOADHINTS
 An interface for receiving download hints. Use to receive hints for further downloading.

Functions

DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create (FX_FILEAVAIL *file_avail, FPDF_FILEACCESS *file)
DLLEXPORT void STDCALL FPDFAvail_Destroy (FPDF_AVAIL avail)
DLLEXPORT int STDCALL FPDFAvail_IsDocAvail (FPDF_AVAIL avail, FX_DOWNLOADHINTS *hints)
DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument (FPDF_AVAIL avail)
DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum (FPDF_DOCUMENT document)
DLLEXPORT int STDCALL FPDFAvail_IsPageAvail (FPDF_AVAIL avail, int page_index, FX_DOWNLOADHINTS *hints)
DLLEXPORT int STDCALL FPDFAvail_IsFormAvail (FPDF_AVAIL avail, FX_DOWNLOADHINTS *hints)
DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized (FPDF_AVAIL avail)
 _FPDFAVAIL_H_

The result of the process which check linearized PDF.

#define FSDK_IS_LINEARIZED   1
 Indicates PDF is linearized.
#define FSDK_NOT_LINEARIZED   0
 Indicates PDF is not linearized.
#define FSDK_UNKNOW_LINEARIZED   -1
 Unknown.

Detailed Description

Header file for the asynchronous module.


Function Documentation

DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create ( FX_FILEAVAIL file_avail,
FPDF_FILEACCESS file 
)

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:
Ahandle 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:
None
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:
Handleto 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-basedindex 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-zeroindicates 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-zerovalue 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:
ReturnTRUE 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-zerovalue indicates a page is fully available, 0 indicates a page is not yet available.