pub enum Error {
Show 31 variants
Unimplemented(&'static str),
ObjectType {
expected: &'static str,
found: &'static str,
},
DictType {
expected: &'static str,
found: String,
},
AlreadyEncrypted,
CharacterEncoding,
Decompress(DecompressError),
Parse(ParseError),
Decryption(DecryptionError),
DictKey(String),
InvalidInlineImage(String),
InvalidOutline(String),
InvalidStream(String),
InvalidObjectStream(String),
InvalidOffset(usize),
IO(Error),
NoOutline,
NotEncrypted,
MissingXrefEntry,
ObjectNotFound((u32, u16)),
ReferenceCycle((u32, u16)),
PageNumberNotFound(u32),
NumericCast(String),
ReferenceLimit,
TextStringDecode,
Xref(XrefError),
IndirectObject {
offset: usize,
},
ObjectIdMismatch,
Syntax(String),
ToUnicodeCMap(UnicodeCMapError),
TryFromInt(TryFromIntError),
UnsupportedSecurityHandler(Vec<u8>),
}
Variants§
Unimplemented(&'static str)
Lopdf does not (yet) implement a needed feature.
ObjectType
An Object has the wrong type, e.g. the Object is an Array where a Name would be expected.
DictType
AlreadyEncrypted
PDF document is already encrypted.
CharacterEncoding
The encountered character encoding is invalid.
Decompress(DecompressError)
The stream couldn’t be decompressed.
Parse(ParseError)
Failed to parse input.
Decryption(DecryptionError)
Error when decrypting the contents of the file
DictKey(String)
Dictionary key was not found.
InvalidInlineImage(String)
Invalid inline image.
InvalidOutline(String)
Invalid document outline.
InvalidStream(String)
Invalid stream.
InvalidObjectStream(String)
Invalid object stream.
InvalidOffset(usize)
Byte offset in stream or file is invalid.
IO(Error)
IO error
NoOutline
PDF document has no outline.
NotEncrypted
PDF document is not encrypted.
MissingXrefEntry
Missing xref entry.
ObjectNotFound((u32, u16))
The Object ID was not found.
ReferenceCycle((u32, u16))
Dereferencing object failed due to a reference cycle.
PageNumberNotFound(u32)
Page number was not found in document.
NumericCast(String)
Numeric type cast failed.
ReferenceLimit
Dereferencing object reached the limit. This might indicate a reference loop.
TextStringDecode
Decoding text string failed.
Xref(XrefError)
Error while parsing cross reference table.
IndirectObject
Invalid indirect object while parsing at offset.
ObjectIdMismatch
Found object ID does not match expected object ID.
Syntax(String)
Syntax error while processing the content stream.
ToUnicodeCMap(UnicodeCMapError)
Could not parse ToUnicodeCMap.
TryFromInt(TryFromIntError)
UnsupportedSecurityHandler(Vec<u8>)
Encountered an unsupported security handler.