Struct lopdf::Stream [−][src]
pub struct Stream { pub dict: Dictionary, pub content: Vec<u8>, pub allows_compression: bool, }
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
Methods
impl Stream
[src]
impl Stream
pub fn new(dict: Dictionary, content: Vec<u8>) -> Stream
[src]
pub fn new(dict: Dictionary, content: Vec<u8>) -> Stream
pub fn with_compression(self, allows_compression: bool) -> Stream
[src]
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) -> Option<String>
[src]
pub fn filter(&self) -> Option<String>
pub fn set_content(&mut self, content: Vec<u8>)
[src]
pub fn set_content(&mut self, content: Vec<u8>)
pub fn set_plain_content(&mut self, content: Vec<u8>)
[src]
pub fn set_plain_content(&mut self, content: Vec<u8>)
pub fn compress(&mut self)
[src]
pub fn compress(&mut self)
pub fn decompressed_content(&self) -> Option<Vec<u8>>
[src]
pub fn decompressed_content(&self) -> Option<Vec<u8>>
pub fn decompress(&mut self)
[src]
pub fn decompress(&mut self)
impl Stream
[src]
impl Stream
pub fn decode_content(&self) -> Result<Content>
[src]
pub fn decode_content(&self) -> Result<Content>
Decode content after decoding all stream filters.
Trait Implementations
impl Debug for Stream
[src]
impl Debug for Stream
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Stream
[src]
impl Clone for Stream
fn clone(&self) -> Stream
[src]
fn clone(&self) -> Stream
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl From<Stream> for Object
[src]
impl From<Stream> for Object