Sha256: 2819e318b52244065716b46621057dab1f1ee4454bee79230d35293193b9ed7c

Contents?: true

Size: 883 Bytes

Versions: 5

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

require_relative 'pdf_matcher/version'
require_relative 'pdf_matcher/matcher'

module PdfMatcher
  Config = Struct.new(
    # Options for diff-pdf.
    # It will be applied as the default options when executing diff-pdf. Default is nil.
    #
    #     PdfMatcher.config.diff_pdf_opts = ['--dpi=300', '--grayscale']
    #     PdfMatcher.config.diff_pdf_opts = %w(--dpi=300 --grayscale)
    #
    # See `diff-pdf --help` for available options.
    :diff_pdf_opts
  )
  def self.config
    @config ||= Config.new(nil)
  end

  def self.match?(pdf1, pdf2, output_diff: nil, diff_pdf_opts: nil)
    match(pdf1, pdf2, output_diff: output_diff, diff_pdf_opts: diff_pdf_opts).matched?
  end

  def self.match(pdf1, pdf2, output_diff: nil, diff_pdf_opts: nil)
    Matcher.new(pdf1, pdf2, output_diff: output_diff, diff_pdf_opts: diff_pdf_opts).match
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pdf_matcher-2.2.0 lib/pdf_matcher.rb
pdf_matcher-2.1.0 lib/pdf_matcher.rb
pdf_matcher-2.0.0 lib/pdf_matcher.rb
pdf_matcher-1.0.1 lib/pdf_matcher.rb
pdf_matcher-1.0.0 lib/pdf_matcher.rb