Class: Libis::Format::Converter::PdfSplitter
- Defined in:
- lib/libis/format/converter/pdf_splitter.rb
Overview
noinspection DuplicatedCode
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #convert(source, target, format, opts = {}) ⇒ Object
-
#initialize ⇒ PdfSplitter
constructor
A new instance of PdfSplitter.
-
#page(v) ⇒ Object
Split at given page.
Methods inherited from Base
#check_file_exist, inherited, #using_temp, using_temp
Constructor Details
#initialize ⇒ PdfSplitter
Returns a new instance of PdfSplitter.
27 28 29 |
# File 'lib/libis/format/converter/pdf_splitter.rb', line 27 def initialize super end |
Class Method Details
.category ⇒ Object
23 24 25 |
# File 'lib/libis/format/converter/pdf_splitter.rb', line 23 def self.category :splitter end |
.input_types ⇒ Object
14 15 16 |
# File 'lib/libis/format/converter/pdf_splitter.rb', line 14 def self.input_types [:PDF] end |
.output_types(format = nil) ⇒ Object
18 19 20 21 |
# File 'lib/libis/format/converter/pdf_splitter.rb', line 18 def self.output_types(format = nil) return [] unless input_types.include?(format) if format [:PDFA] end |
Instance Method Details
#convert(source, target, format, opts = {}) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/libis/format/converter/pdf_splitter.rb', line 36 def convert(source, target, format, opts = {}) super result = split(source, target) return nil unless result result end |
#page(v) ⇒ Object
Split at given page. If omitted, nil or 0, the source PDF will be split at every page
32 33 34 |
# File 'lib/libis/format/converter/pdf_splitter.rb', line 32 def page(v) @options[:page] = v unless v.blank? end |