Class: IiifPrint::SplitPdfs::PdfImageExtractionService
- Inherits:
-
Object
- Object
- IiifPrint::SplitPdfs::PdfImageExtractionService
- Defined in:
- lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb
Overview
Uses poppler 0.19+ pdfimages command to extract image
listing metadata from PDF files.
For dpi extraction, falls back to calculating using MiniMagick,
if neccessary.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#page_count ⇒ Object
readonly
Returns the value of attribute page_count.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#pixels_per_inch ⇒ Object
(also: #ppi)
readonly
Returns the value of attribute pixels_per_inch.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #color ⇒ Array<String, Integer, Integer>
-
#initialize(path) ⇒ PdfImageExtractionService
constructor
A new instance of PdfImageExtractionService.
Constructor Details
#initialize(path) ⇒ PdfImageExtractionService
Returns a new instance of PdfImageExtractionService.
11 12 13 14 |
# File 'lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb', line 11 def initialize(path) @path = path process(command: format('pdfimages -list %<path>s 2>/dev/null', path: path)) end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
16 17 18 |
# File 'lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb', line 16 def height @height end |
#page_count ⇒ Object (readonly)
Returns the value of attribute page_count.
16 17 18 |
# File 'lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb', line 16 def page_count @page_count end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
16 17 18 |
# File 'lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb', line 16 def path @path end |
#pixels_per_inch ⇒ Object (readonly) Also known as: ppi
Returns the value of attribute pixels_per_inch.
16 17 18 |
# File 'lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb', line 16 def pixels_per_inch @pixels_per_inch end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
16 17 18 |
# File 'lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb', line 16 def width @width end |
Instance Method Details
#color ⇒ Array<String, Integer, Integer>
20 21 22 |
# File 'lib/iiif_print/split_pdfs/pdf_image_extraction_service.rb', line 20 def color [@color_description, @channels, @bits] end |