22
33module Mindee
44 # Pdf Extraction Module.
5- module Extraction
5+ module Image
66 # Pdf Extraction class.
77 module PdfExtractor
88 # Pdf extraction class.
@@ -13,7 +13,7 @@ def initialize(local_input)
1313 if local_input . pdf?
1414 @source_pdf = local_input . io_stream
1515 else
16- pdf_image = Extraction ::ImageExtractor . attach_image_as_new_file ( local_input . io_stream )
16+ pdf_image = Image ::ImageExtractor . attach_image_as_new_file ( local_input . io_stream )
1717 io_buffer = StringIO . new
1818 pdf_image . save ( io_buffer )
1919
@@ -40,7 +40,7 @@ def cut_pages(page_indexes)
4040
4141 # Extract the sub-documents from the main pdf, based on the given list of page indexes.
4242 # @param page_indexes [Array<Array<Integer>>] List of page number to use for merging in the original Pdf.
43- # @return [Array<Mindee::Extraction ::PdfExtractor::ExtractedPdf>] The buffer containing the new Pdf.
43+ # @return [Array<Mindee::Image ::PdfExtractor::ExtractedPdf>] The buffer containing the new Pdf.
4444 def extract_sub_documents ( page_indexes )
4545 extracted_pdfs = [ ]
4646 extension = File . extname ( @filename )
@@ -59,8 +59,8 @@ def extract_sub_documents(page_indexes)
5959 formatted_max_index = format ( '%03d' , page_index_list [ page_index_list . length - 1 ] + 1 ) . to_s
6060 field_filename = "#{ basename } _#{ format ( '%03d' ,
6161 ( page_index_list [ 0 ] + 1 ) ) } -#{ formatted_max_index } #{ extension } "
62- extracted_pdf = Mindee ::Extraction ::PdfExtractor ::ExtractedPdf . new ( cut_pages ( page_index_list ) ,
63- field_filename )
62+ extracted_pdf = Mindee ::Image ::PdfExtractor ::ExtractedPdf . new ( cut_pages ( page_index_list ) ,
63+ field_filename )
6464 extracted_pdfs << extracted_pdf
6565 end
6666 extracted_pdfs
@@ -72,7 +72,7 @@ def extract_sub_documents(page_indexes)
7272 # Extracts invoices as complete PDFs from the document.
7373 # @param page_indexes [Array<Array<Integer>, InvoiceSplitterV1PageGroup>]
7474 # @param strict [Boolean]
75- # @return [Array<Mindee::Extraction ::PdfExtractor::ExtractedPdf>]
75+ # @return [Array<Mindee::Image ::PdfExtractor::ExtractedPdf>]
7676 def extract_invoices ( page_indexes , strict : false )
7777 raise Errors ::MindeePDFError , 'No indexes provided.' if page_indexes . empty?
7878 unless page_indexes [ 0 ] . is_a? ( Mindee ::Product ::InvoiceSplitter ::InvoiceSplitterV1PageGroup )
0 commit comments