pub enum ManipError {
Show 14 variants
Pdf(Error),
Io(Error),
PageOutOfRange(usize, usize),
EmptyPageRange,
Encryption(String),
DecryptionFailed,
UnsupportedEncryption(String),
InvalidBookmark(String),
Watermark(String),
Image(String),
ImageTooLarge {
width: u32,
height: u32,
bytes_per_pixel: u32,
max_dimension: u32,
max_allocation_bytes: usize,
},
DecompressionLimitExceeded(u64),
FontVariantNotEmbedded {
current: String,
requested: String,
available_variants: Vec<String>,
},
Other(String),
}Expand description
Errors returned by the pdf-manip crate while performing page-level
operations (merge, split, extract, rotate, watermark, encrypt, etc.).
These bubble up through the pdfluent facade as Error::* variants —
customers will normally see them indirectly. Variants with explicit
limit fields (image size, decompression cap) describe safety guards
that refused to proceed; the source document is not modified.
Variants§
Pdf(Error)
The underlying PDF byte stream could not be parsed (malformed
xref, truncated stream, unsupported construct). The wrapped
lopdf::Error carries the detail.
Io(Error)
An I/O error while reading the source or writing the result.
PageOutOfRange(usize, usize)
A page index passed to a manipulation routine does not exist in
the document. Fields: (requested_index, total_pages). Page
indexes at this layer are 0-based; the public facade translates
to 1-based.
EmptyPageRange
A range-based operation (extract, split) received an empty range. Returned eagerly to surface the no-op rather than silently produce an empty document.
Encryption(String)
Setting up an encryption pipeline failed (key derivation, cipher initialization, or invalid permission flag combination). The wrapped string identifies the failing step.
DecryptionFailed
Decryption failed. Either the supplied password is wrong, the document uses an algorithm this build does not support (RC4 in a no-RC4 build), or the encryption dictionary is malformed.
UnsupportedEncryption(String)
The document advertises an encryption algorithm that the SDK
cannot read. The wrapped string identifies the algorithm
(e.g. "V=4 RC4 with custom CFM").
InvalidBookmark(String)
A bookmark/outline operation received an invalid bookmark description (missing title, invalid destination, malformed tree).
Watermark(String)
A watermark operation could not be applied (font/image resolution failure, invalid coordinates, malformed text).
Image(String)
An image operation (insertion, replacement, watermark image) failed before the page was modified.
ImageTooLarge
An image operation refused to proceed because the requested image would exceed the configured allocation safety limits.
Allocation = width * height * bytes_per_pixel. The guards exist
to prevent denial-of-service via crafted PDFs that trigger huge
pixel-buffer allocations. If you genuinely need a larger image,
raise the limit in the operation’s options or pre-resize the
image before insertion.
Fields
DecompressionLimitExceeded(u64)
A FlateDecode-compressed stream expanded past the configured
decompression limit. Like ImageTooLarge
this is a denial-of-service guard. The u64 is the byte limit
that was hit.
FontVariantNotEmbedded
The requested bold or italic variant font is not embedded in the document.
set_text_run_style only swaps to fonts that are already present in the
xref. Synthetic bold (stroke-and-fill) and system-font injection are
explicitly forbidden. The caller must embed the variant before styling.
available_variants lists the BaseFont names of all variants of the same
family that are embedded, so the caller can surface actionable guidance.
Fields
Other(String)
A non-categorised manipulation failure. Reserved for cases the more specific variants do not cover; the message describes the situation.
Trait Implementations§
Source§impl Debug for ManipError
impl Debug for ManipError
Source§impl Display for ManipError
impl Display for ManipError
Source§impl Error for ManipError
impl Error for ManipError
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
use the Display impl or to_string()
Source§impl From<Error> for ManipError
impl From<Error> for ManipError
Source§impl From<Error> for ManipError
impl From<Error> for ManipError
Source§impl From<ManipError> for TextEditError
impl From<ManipError> for TextEditError
Source§fn from(source: ManipError) -> Self
fn from(source: ManipError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ManipError
impl !UnwindSafe for ManipError
impl Freeze for ManipError
impl Send for ManipError
impl Sync for ManipError
impl Unpin for ManipError
impl UnsafeUnpin for ManipError
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.