Sha256: daa55997dda9e91e157817616dab8c927a7b811ab063f4dc6a6ae040461345f0

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

module PDFRavager
  module Strategies
    class AcroForm
      def initialize(stamper)
        @stamper = stamper
        @afields = stamper.getAcroFields
      end

      def set_field_values(template)
        template.fields.select{|f| f.respond_to?(:acro_form_value)}.select do |f|
          begin
            @afields.setField(FieldTypes::AcroForm::SOM.short_name(f.acro_form_name), f.acro_form_value)
          rescue java.lang.NullPointerException
            false
          end
        end
      end

      def set_read_only
        @stamper.setFormFlattening(true)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pdf_ravager-0.2.1 lib/pdf_ravager/strategies/acro_form.rb
pdf_ravager-0.2.0 lib/pdf_ravager/strategies/acro_form.rb