Function: FPDF_GetLastError
Get last error code when a function fails.
Parameters:
None.
Return value:
A 32-bit integer indicating error code as defined above.
Comments:
If the previous SDK call succeeded, the return value of this
function is not defined.
Function: FPDF_GetPageCount
Get total number of pages in the document.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument.
Return value:
Total number of pages in the document.
PdfiumException getLastError() {
switch (nGetLastError()) {
case FPDF_ERR_SUCCESS:
fprintf(stderr, "Success");
break;
case FPDF_ERR_UNKNOWN:
fprintf(stderr, "Unknown error");
break;
case FPDF_ERR_FILE:
fprintf(stderr, "File not found or could not be opened");
break;
case FPDF_ERR_FORMAT:
fprintf(stderr, "File not in PDF format or corrupted");
break;
case FPDF_ERR_PASSWORD: [...]
Function: FPDF_LoadPage
Load a page inside the document.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument
page_index - Index number of the page. 0 for the first page.
Return value:
A handle to the loaded page, or NULL if page load fails.
Comments:
The loaded page can be rendered to devices using FPDF_RenderPage.
The loaded page can be closed using FPDF_ClosePage.