pub enum PdfiumError {
Show 77 variants
LoadLibraryError(Error),
LoadLibraryFunctionNameError(String),
UnrecognizedPath,
PageIndexOutOfBounds,
LinkIndexOutOfBounds,
UnknownBitmapFormat,
UnknownBitmapRotation,
UnknownFormType,
UnknownFormFieldType,
UnknownActionType,
UnknownAppearanceMode,
UnknownPageAnnotationVariableTextJustificationType,
PageObjectIndexOutOfBounds,
PageAnnotationIndexOutOfBounds,
OwnershipNotAttachedToDocument,
OwnershipNotAttachedToPage,
OwnershipAlreadyAttachedToDifferentPage,
OwnershipNotAttachedToAnnotation,
FormFieldOptionIndexOutOfBounds,
FormFieldAppearanceStreamUndefined,
PageFlattenFailure,
PageMissingEmbeddedThumbnail,
UnknownPdfPageObjectType,
UnknownPdfPageTextRenderMode,
UnknownPdfPagePathFillMode,
UnknownPdfAnnotationType,
UnknownPdfDestinationViewType,
UnknownPdfSecurityHandlerRevision,
UnknownPdfSignatureModificationDetectionPermissionLevel,
UnsupportedPdfPageObjectType,
TextSegmentIndexOutOfBounds,
TextSearchTargetIsEmpty,
CharIndexOutOfBounds,
NoCharsInPageObject,
NoCharsInAnnotation,
NoCharsInRect,
ImageObjectFilterIndexOutOfBounds,
ImageObjectFilterIndexInBoundsButFilterUndefined,
UnknownPdfColorSpace,
InvalidTransformationMatrix,
SignatureIndexOutOfBounds,
AttachmentIndexOutOfBounds,
NoDataInAttachment,
FontGlyphIndexOutOfBounds,
UnknownPathSegmentType,
NoPagesInDocument,
NoPageObjectsInCollection,
NoPageLinksInCollection,
NoAnnotationsInCollection,
PageObjectNotCopyable,
ImageObjectFiltersNotCopyable,
PathObjectBezierControlPointsNotCopyable,
PathObjectUnknownSegmentTypeNotCopyable,
GroupContainsNonCopyablePageObjects,
SourcePageIndexNotInCache,
NoUriForAction,
DestinationPageIndexNotAvailable,
DestinationPageLocationNotAvailable,
PageAnnotationAttachmentPointIndexOutOfBounds,
NoAttachmentPointsInPageAnnotation,
CoordinateConversionFunctionIndicatedError,
CannotMoveObjectAcrossDocuments,
PageObjectsCollectionIsImmutable,
PdfDestinationViewInvalidParameters,
ParseHexadecimalColorError(ParseIntError),
ParseHexadecimalColorUnexpectedLength,
ParseHexadecimalColorMissingLeadingHash,
CStringConversionError(IntoStringError),
DataBufferLengthMismatch,
EmptyPageObjectGroup,
PdfiumFunctionReturnValueIndicatedFailure,
UnableToConvertPdfiumColorValueToRustu8(TryFromIntError),
WebSysWindowObjectNotAvailable,
ImageError,
ImageSizeOutOfBounds,
IoError(Error),
PdfiumLibraryInternalError(PdfiumInternalError),
}Expand description
A wrapper enum for handling Pdfium errors as standard Rust Err values.
Variants§
LoadLibraryError(Error)
An error occurred during dynamic binding to an external Pdfium library.
LoadLibraryFunctionNameError(String)
An error occurred during dynamic binding while converting an FPDF_* function name to a C string. The wrapped string value contains more information.
UnrecognizedPath
PageIndexOutOfBounds
LinkIndexOutOfBounds
UnknownBitmapFormat
UnknownBitmapRotation
UnknownFormType
UnknownFormFieldType
UnknownActionType
UnknownAppearanceMode
UnknownPageAnnotationVariableTextJustificationType
PageObjectIndexOutOfBounds
PageAnnotationIndexOutOfBounds
OwnershipNotAttachedToDocument
OwnershipNotAttachedToPage
OwnershipAlreadyAttachedToDifferentPage
OwnershipNotAttachedToAnnotation
FormFieldOptionIndexOutOfBounds
FormFieldAppearanceStreamUndefined
PageFlattenFailure
PageMissingEmbeddedThumbnail
UnknownPdfPageObjectType
UnknownPdfPageTextRenderMode
UnknownPdfPagePathFillMode
UnknownPdfAnnotationType
UnknownPdfDestinationViewType
UnknownPdfSecurityHandlerRevision
UnknownPdfSignatureModificationDetectionPermissionLevel
UnsupportedPdfPageObjectType
TextSegmentIndexOutOfBounds
TextSearchTargetIsEmpty
CharIndexOutOfBounds
NoCharsInPageObject
NoCharsInAnnotation
NoCharsInRect
ImageObjectFilterIndexOutOfBounds
ImageObjectFilterIndexInBoundsButFilterUndefined
UnknownPdfColorSpace
InvalidTransformationMatrix
SignatureIndexOutOfBounds
AttachmentIndexOutOfBounds
NoDataInAttachment
FontGlyphIndexOutOfBounds
UnknownPathSegmentType
NoPagesInDocument
NoPageObjectsInCollection
NoPageLinksInCollection
NoAnnotationsInCollection
PageObjectNotCopyable
ImageObjectFiltersNotCopyable
PathObjectBezierControlPointsNotCopyable
PathObjectUnknownSegmentTypeNotCopyable
GroupContainsNonCopyablePageObjects
SourcePageIndexNotInCache
NoUriForAction
DestinationPageIndexNotAvailable
DestinationPageLocationNotAvailable
PageAnnotationAttachmentPointIndexOutOfBounds
NoAttachmentPointsInPageAnnotation
CoordinateConversionFunctionIndicatedError
CannotMoveObjectAcrossDocuments
Pdfium does not safely support moving page object ownership from one document to another.
PageObjectsCollectionIsImmutable
Pdfium does not support adding or removing page objects from the page objects collection inside a PdfPageXObjectFormObject object.
PdfDestinationViewInvalidParameters
A call to FPDFDest_GetView() returned a valid FPDFDEST_VIEW_* value, but the number
of view parameters returned does not match the PDF specification.
ParseHexadecimalColorError(ParseIntError)
A ParseIntError occurred while attempting to parse a PdfColor from a hexadecimal string
in PdfColor::from_hex().
ParseHexadecimalColorUnexpectedLength
The hexadecimal string given to PdfColor::from_hex() was not either exactly 7 or 9
characters long.
ParseHexadecimalColorMissingLeadingHash
The leading # character was not found while attempting to parse a PdfColor from
a hexadecimal string in PdfColor::from_hex().
CStringConversionError(IntoStringError)
An error occurred converting a byte stream into a CString.
DataBufferLengthMismatch
Two data buffers are expected to have the same size, but they do not.
EmptyPageObjectGroup
The setting cannot be returned because this PdfPageGroupObject is empty.
PdfiumFunctionReturnValueIndicatedFailure
A call to a internal Pdfium FPDF_* function returned a value indicating failure.
For Pdfium functions that return enumerations, this means the function returned a value of -1 rather than a valid enumeration constant.
For Pdfium functions that return C-style boolean integers, this means that the function
returned a value other than PdfiumLibraryBindings::TRUE.
UnableToConvertPdfiumColorValueToRustu8(TryFromIntError)
A call to a Pdfium function that returns a standard 8-bit color component value
(for example, FPDFPageObj_GetStrokeColor() and FPDFPageObj_GetStrokeColor())
successfully returned a value, but the value could not be converted from a c_int
to a standard Rust u8.
WebSysWindowObjectNotAvailable
The browser’s built-in Window object could not be retrieved.
ImageError
An error occurred during an image processing operation.
ImageSizeOutOfBounds
Dimensions of Image::Image are specified in u32, but bitmaps in Pdfium are sized in
c_int (i32), meaning that an Image::Image can have dimensions that overflow
the maximum size of a Pdfium bitmap. As a compromise, Image dimensions in pdfium-render
are limited to u16.
This error indicates that an Image::Image had a width or height larger than the maximum
u16 size allowed by pdfium-render.
IoError(Error)
An I/O error occurred during a Pdfium file operation.
PdfiumLibraryInternalError(PdfiumInternalError)
A wrapped internal library error from Pdfium’s FPDF_ERR_* constant values.
Trait Implementations§
Source§impl Debug for PdfiumError
impl Debug for PdfiumError
Source§impl Display for PdfiumError
impl Display for PdfiumError
Source§impl Error for PdfiumError
impl Error for PdfiumError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for PdfiumError
impl !RefUnwindSafe for PdfiumError
impl Send for PdfiumError
impl Sync for PdfiumError
impl Unpin for PdfiumError
impl !UnwindSafe for PdfiumError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more