# frozen_string_literal: true module HexaPDF module Encryption class SecurityHandler def encrypt_string(str, obj) return str.dup if str.empty? || obj == document.trailer[:Encrypt] || obj.type == :XRef || (obj.type == :Sig && obj[:Contents].equal?(str)) key = object_key(obj.oid, obj.gen, string_algorithm) string_algorithm.encrypt(key, str).dup end end end module Type class Page # fix NoMethodError (undefined method `color_space' for an instance of HexaPDF::Type::Page) def color_space(name) GlobalConfiguration.constantize('color_space.map', name).new end end # fix NoMethodError: undefined method `field_value' for #