mirror of
https://github.com/docusealco/docuseal
synced 2026-11-08 23:42:32 -05:00
process pdf v2
This commit is contained in:
1 parent
785eb789ad
commit
f9669b0e16
9 files changed
+59
-458
No files matched your search
@@ -435,7 +435,9 @@ module Templates
|
||||
end
|
||||
|
||||
def save_document(template, old_attachment, data)
|
||||
annotations = data.size < ANNOTATIONS_SIZE_LIMIT ? Templates::BuildAnnotations.call(data) : []
|
||||
doc = Pdfium::Document.open_io(StringIO.new(data))
|
||||
|
||||
annotations = data.size < ANNOTATIONS_SIZE_LIMIT ? Templates::BuildPdfiumAnnotations.call(doc) : []
|
||||
sha256 = Base64.urlsafe_encode64(Digest::SHA256.digest(data))
|
||||
|
||||
blob = ActiveStorage::Blob.create_and_upload!(
|
||||
@@ -448,7 +450,9 @@ module Templates
|
||||
|
||||
document = template.documents.create!(blob:)
|
||||
|
||||
Templates::ProcessDocument.call(document, data)
|
||||
Templates::ProcessDocument.call(document, data, doc:)
|
||||
ensure
|
||||
doc&.close
|
||||
end
|
||||
|
||||
def remap_fields(template, mapping)
|
||||
|
||||
Reference in new issue
Block a user