pub struct PdfStream {
pub dict: PdfDict,
pub data: Vec<u8>,
/* private fields */
}Expand description
A PDF stream object
Streams are used to represent large or binary data in PDF.
They consist of a dictionary that describes the data, followed
by the raw bytes enclosed between stream and endstream keywords.
Fields§
§dict: PdfDictThe stream dictionary containing metadata
data: Vec<u8>The raw (possibly encoded) data
Implementations§
Source§impl PdfStream
impl PdfStream
Sourcepub fn new(dict: PdfDict, data: Vec<u8>) -> Self
pub fn new(dict: PdfDict, data: Vec<u8>) -> Self
Creates a new stream with the given dictionary and data
Sourcepub fn from_data_compressed(data: Vec<u8>) -> Self
pub fn from_data_compressed(data: Vec<u8>) -> Self
Creates a new stream with compressed data
Sourcepub fn dict_mut(&mut self) -> &mut PdfDict
pub fn dict_mut(&mut self) -> &mut PdfDict
Returns a mutable reference to the stream dictionary
Sourcepub fn encoded_length(&self) -> usize
pub fn encoded_length(&self) -> usize
Returns the length of the encoded data
Sourcepub fn update_length(&mut self)
pub fn update_length(&mut self)
Updates the Length entry in the dictionary
Sourcepub fn is_filtered(&self) -> bool
pub fn is_filtered(&self) -> bool
Returns true if the stream has a filter applied
Trait Implementations§
impl StructuralPartialEq for PdfStream
Auto Trait Implementations§
impl Freeze for PdfStream
impl RefUnwindSafe for PdfStream
impl Send for PdfStream
impl Sync for PdfStream
impl Unpin for PdfStream
impl UnsafeUnpin for PdfStream
impl UnwindSafe for PdfStream
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Convert this type into
T, using the provided data to resolve any offsets.