pdf-preflight
pdf-preflight copied to clipboard
cannot dynamically override rule
I have code:
preflight = Preflight::Profiles::PDFX1A.new
preflight.rule Preflight::Rules::MaxVersion, 1.4
preflight.check(destination).each do |issue|
puts issue.description
puts issue.attributes
end
so I want to override MaxVersion but output is:
#<Preflight::Issue:0x007fa73059d830 @description="PDF version should be 1.3 or lower", @rule=:"Preflight::Rules::MaxVersion", @attributes={:max_version=>1.3, :current_version=>1.4}>,
as you can see :max_version is get from the profile PDFX1A.
How can I override this rule?
When I use custom class with rules:
class MyPre
include Preflight::Profile
profile_name 'my-pre'
rule Preflight::Rules::MaxVersion, 1.4
end
it's working.