import acro form

This commit is contained in:
Pete Matsyburka
2026-08-13 15:55:26 +03:00
parent ee1d45d461
commit c8d3af9841
2 changed files with 10 additions and 2 deletions
+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