1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::bindgen::{
FPDF_ERR_FILE, FPDF_ERR_FORMAT, FPDF_ERR_PAGE, FPDF_ERR_PASSWORD, FPDF_ERR_SECURITY,
FPDF_ERR_UNKNOWN,
};
#[derive(Debug)]
pub enum PdfiumInternalError {
Unknown = FPDF_ERR_UNKNOWN as isize,
FileError = FPDF_ERR_FILE as isize,
FormatError = FPDF_ERR_FORMAT as isize,
PasswordError = FPDF_ERR_PASSWORD as isize,
SecurityError = FPDF_ERR_SECURITY as isize,
PageError = FPDF_ERR_PAGE as isize,
}
#[derive(Debug)]
pub enum PdfiumError {
#[cfg(target_arch = "wasm32")]
PdfiumWASMModuleNotConfigured,
#[cfg(not(target_arch = "wasm32"))]
LoadLibraryError(libloading::Error),
PageIndexOutOfBounds,
UnknownBitmapFormat,
UnknownBitmapRotation,
UnknownFormType,
UnknownFormFieldType,
UnknownActionType,
PageObjectIndexOutOfBounds,
PageAnnotationIndexOutOfBounds,
UnknownPdfPageObjectType,
UnknownPdfPageTextRenderMode,
UnknownPdfAnnotationType,
PdfiumLibraryInternalError(PdfiumInternalError),
}