pub struct Stream {
pub dict: Dictionary,
pub content: Vec<u8>,
pub allows_compression: bool,
pub start_position: Option<usize>,
}
Expand description
Stream object Warning - all streams must be indirect objects, while the stream dictionary may be a direct object
Fields§
§dict: Dictionary
Associated stream dictionary
content: Vec<u8>
Contents of the stream in bytes
allows_compression: bool
Can the stream be compressed by the Document::compress()
function?
Font streams may not be compressed, for example
start_position: Option<usize>
Stream data’s position in PDF file.
Implementations§
source§impl Stream
impl Stream
pub fn new(dict: Dictionary, content: Vec<u8>) -> Stream
pub fn with_position(dict: Dictionary, position: usize) -> Stream
sourcepub fn with_compression(self, allows_compression: bool) -> Stream
pub fn with_compression(self, allows_compression: bool) -> Stream
Default is that the stream may be compressed. On font streams, set this to false, otherwise the font will be corrupt
pub fn filter(&self) -> Result<String>
pub fn filters(&self) -> Result<Vec<String>>
pub fn set_content(&mut self, content: Vec<u8>)
pub fn set_plain_content(&mut self, content: Vec<u8>)
pub fn compress(&mut self) -> Result<()>
pub fn decompressed_content(&self) -> Result<Vec<u8>>
pub fn decompress(&mut self)
Trait Implementations§
source§impl PartialEq for Stream
impl PartialEq for Stream
impl StructuralPartialEq for Stream
Auto Trait Implementations§
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
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