Class: Mindee::Input::Source::BytesInputSource
- Inherits:
-
LocalInputSource
- Object
- LocalInputSource
- Mindee::Input::Source::BytesInputSource
- Defined in:
- lib/mindee/input/sources.rb
Overview
Load a document from raw bytes.
Instance Attribute Summary
Attributes inherited from LocalInputSource
#file_mimetype, #filename, #io_stream
Instance Method Summary collapse
-
#initialize(raw_bytes, filename, fix_pdf: false) ⇒ BytesInputSource
constructor
A new instance of BytesInputSource.
Methods inherited from LocalInputSource
#compress!, #count_pdf_pages, #pdf?, #process_pdf, #read_document, #rescue_broken_pdf, #source_text?
Constructor Details
#initialize(raw_bytes, filename, fix_pdf: false) ⇒ BytesInputSource
Returns a new instance of BytesInputSource.
204 205 206 207 208 |
# File 'lib/mindee/input/sources.rb', line 204 def initialize(raw_bytes, filename, fix_pdf: false) io_stream = StringIO.new(raw_bytes) io_stream.set_encoding Encoding::BINARY super(io_stream, filename, fix_pdf: fix_pdf) end |