import acro form

This commit is contained in:
Pete Matsyburka committed 2026-08-15 19:08:54 +03:00
1 parent ee1d45d461
commit c8d3af9841
2 files changed
+10 -2

No files matched your search

+8
View File
@@ -425,6 +425,12 @@ class Pdfium
define_singleton_method(:FPDF_RemoveOrphanObjects) { |*| -1 } # rubocop:disable Naming/MethodName
end
begin
attach_function :FPDF_ImportAcroForm, %i[FPDF_DOCUMENT FPDF_DOCUMENT], :int
rescue FFI::NotFoundError
define_singleton_method(:FPDF_ImportAcroForm) { |*| -1 } # rubocop:disable Naming/MethodName
end
FPDF_ERR_SUCCESS = 0
FPDF_ERR_UNKNOWN = 1
FPDF_ERR_FILE = 2
@@ -560,6 +566,8 @@ class Pdfium
raise PdfiumError, 'Failed to import pages' if result.zero?
Pdfium.FPDF_ImportAcroForm(@document_ptr, src_doc.document_ptr)
@page_count = nil
result