Enum PdfiumError

Source
pub enum PdfiumError {
Show 75 variants LoadLibraryError(Error), LoadLibraryFunctionNameError(String), UnrecognizedPath, PageIndexOutOfBounds, LinkIndexOutOfBounds, UnknownBitmapFormat, UnknownBitmapRotation, UnknownFormType, UnknownFormFieldType, UnknownActionType, UnknownAppearanceMode, PageObjectIndexOutOfBounds, PageAnnotationIndexOutOfBounds, OwnershipNotAttachedToDocument, OwnershipNotAttachedToPage, OwnershipAlreadyAttachedToDifferentPage, OwnershipNotAttachedToAnnotation, FormFieldOptionIndexOutOfBounds, FormFieldAppearanceStreamUndefined, PageFlattenFailure, PageMissingEmbeddedThumbnail, UnknownPdfPageObjectType, UnknownPdfPageTextRenderMode, UnknownPdfPagePathFillMode, UnknownPdfAnnotationType, UnknownPdfDestinationViewType, UnknownPdfSecurityHandlerRevision, UnknownPdfSignatureModificationDetectionPermissionLevel, UnsupportedPdfPageObjectType, TextSegmentIndexOutOfBounds, 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

§

PageObjectIndexOutOfBounds

§

PageAnnotationIndexOutOfBounds

§

OwnershipNotAttachedToDocument

§

OwnershipNotAttachedToPage

§

OwnershipAlreadyAttachedToDifferentPage

§

OwnershipNotAttachedToAnnotation

§

FormFieldOptionIndexOutOfBounds

§

FormFieldAppearanceStreamUndefined

§

PageFlattenFailure

§

PageMissingEmbeddedThumbnail

§

UnknownPdfPageObjectType

§

UnknownPdfPageTextRenderMode

§

UnknownPdfPagePathFillMode

§

UnknownPdfAnnotationType

§

UnknownPdfDestinationViewType

§

UnknownPdfSecurityHandlerRevision

§

UnknownPdfSignatureModificationDetectionPermissionLevel

§

UnsupportedPdfPageObjectType

§

TextSegmentIndexOutOfBounds

§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PdfiumError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for PdfiumError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.