PDF Comparison in Pure Ruby

Jahangir Anwari
Jul 5 · 2 min read
Tests execution times before and after Identikal

Identikal

$ identikal file_a.pdf file_b.pdf
true
$ identikal file_a.pdf file_c.pdf -t
false
require 'identikal'

base_path = File.expand_path(File.join(__dir__), '/../pdfs')
pdf_a = File.join(base_path, 'report_a.pdf')
pdf_b = File.join(base_path, 'report_b.pdf')

if Identikal.files_same?(pdf_a, pdf_b)
# some action when files are identical
else
# another action when files are different
end

Tarka Labs Blog

Tarka Labs is a team of passionate hackers, designers and product managers. We believe in experimental methods to identify the best solutions to problems instead of working on technology du jour. Visit us at https://tarkalabs.com/

Jahangir Anwari

Written by

Tarka Labs Blog

Tarka Labs is a team of passionate hackers, designers and product managers. We believe in experimental methods to identify the best solutions to problems instead of working on technology du jour. Visit us at https://tarkalabs.com/