mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 14:42:33 -05:00
process acro form fields
This commit is contained in:
1 parent
320fe02e35
commit
749043dfbb
10 files changed
+374
-17
No files matched your search
@@ -9,17 +9,17 @@ module Templates
|
||||
|
||||
module_function
|
||||
|
||||
def call(template, params)
|
||||
def call(template, params, extract_fields: false)
|
||||
Array.wrap(params[:files].presence || params[:file]).map do |file|
|
||||
if file.content_type.exclude?('image') && file.content_type != PDF_CONTENT_TYPE
|
||||
next handle_file_types(template, file, params)
|
||||
end
|
||||
|
||||
handle_pdf_or_image(template, file, file.read, params)
|
||||
handle_pdf_or_image(template, file, file.read, params, extract_fields:)
|
||||
end
|
||||
end
|
||||
|
||||
def handle_pdf_or_image(template, file, document_data = nil, params = {})
|
||||
def handle_pdf_or_image(template, file, document_data = nil, params = {}, extract_fields: false)
|
||||
document_data ||= file.read
|
||||
|
||||
if file.content_type == PDF_CONTENT_TYPE
|
||||
@@ -44,7 +44,7 @@ module Templates
|
||||
|
||||
document = template.documents.create!(blob:)
|
||||
|
||||
Templates::ProcessDocument.call(document, document_data)
|
||||
Templates::ProcessDocument.call(document, document_data, extract_fields:)
|
||||
end
|
||||
|
||||
def maybe_decrypt_pdf_or_raise(data, params)
|
||||
|
||||
Reference in new issue
Block a user