Module: OnlyofficePdfParser::PdfReaderHelper
- Included in:
- PdfStructure
- Defined in:
- lib/onlyoffice_pdf_parser/pdf_structure/pdf_reader_helper.rb
Overview
Module for helper methods for ‘pdf-reader` gem
Instance Method Summary collapse
-
#parse_font(page) ⇒ String
Return font name from page data.
Instance Method Details
#parse_font(page) ⇒ String
Return font name from page data
9 10 11 12 13 14 15 |
# File 'lib/onlyoffice_pdf_parser/pdf_structure/pdf_reader_helper.rb', line 9 def parse_font(page) return :unknown if page.fonts[:F1].nil? font_string = page.fonts[:F1][:BaseFont].to_s font_string = /(?=\+)(.*)/.match(font_string).to_s # remove from "+" to "," font_string.delete('+') end |