Developer builds browser-based diff tool that compares Word and PDF files client-side
A developer has built an online text comparison tool that supports .docx, .pdf, and plain text files, processing everything client-side without storing uploaded content. The tool uses a two-level diffing approach — first comparing full lines via LCS, then running a finer word-level diff only on lines flagged as modified. To handle large inputs, a cell-count guard switches the algorithm to a simpler positional comparison when the LCS matrix would exceed five million cells. The developer identified PDF line-wrap as the biggest source of user confusion, since extracted PDF text breaks at layout boundaries rather than paragraph ends, making clean documents appear almost entirely changed. Mitigations include rejoining wrapped lines and normalising whitespace, along with explicit warnings for scanned PDFs and non-UTF-8 encoded files.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in