{"id":15936365,"url":"https://github.com/vokimon/visualpdfdiff","last_synced_at":"2025-10-11T16:46:13.941Z","repository":{"id":61971604,"uuid":"220935428","full_name":"vokimon/visualpdfdiff","owner":"vokimon","description":"Visual side by side comparision of rendered PDF documents (CLI tool, python function, unittest assert and back2back plugin)","archived":false,"fork":false,"pushed_at":"2023-09-11T17:58:38.000Z","size":106,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T23:17:10.386Z","etag":null,"topics":["back-to-back","compare","diff","pdf","testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vokimon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-11T08:32:41.000Z","updated_at":"2023-10-13T14:47:39.000Z","dependencies_parsed_at":"2024-11-10T23:26:15.806Z","dependency_job_id":"806c7ef3-f50d-4dd7-8c0d-e7e34cc21ff8","html_url":"https://github.com/vokimon/visualpdfdiff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vokimon/visualpdfdiff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vokimon%2Fvisualpdfdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vokimon%2Fvisualpdfdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vokimon%2Fvisualpdfdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vokimon%2Fvisualpdfdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vokimon","download_url":"https://codeload.github.com/vokimon/visualpdfdiff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vokimon%2Fvisualpdfdiff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007975,"owners_count":26084369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["back-to-back","compare","diff","pdf","testing"],"created_at":"2024-10-07T04:21:21.273Z","updated_at":"2025-10-11T16:46:13.926Z","avatar_url":"https://github.com/vokimon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visual PDF diff\n\n[![CI Status](https://github.com/GuifiBaix/visualpdfdiff/actions/workflows/main.yml/badge.svg)](https://github.com/GuifiBaix/visualpdfdiff/actions/workflows/main.yml)\n[![Coverage Status](https://coveralls.io/repos/github/GuifiBaix/visualpdfdiff/badge.svg?branch=master)](https://coveralls.io/github/GuifiBaix/visualpdfdiff?branch=master)\n![PyPI](https://img.shields.io/pypi/v/visualpdfdiff)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/visualpdfdiff)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/visualpdfdiff)\n\n\n\nVisual side by side comparision of rendered PDF documents.\n\nYou can use this in several ways:\n\n- a commandline tool to obtain the diff of two pdfs\n- a Python function to do the same from other Python programs\n- an equality assertion to be used in `python-unittest`\n- a back-to-back assertion to be used in `python-unittest`\n- an extension for the tool [`back2back`](https://github.com/vokimon/back2back) to make back-to-back tests of the PDF outputs of your commands\n\nThe generated diff looks like this:\n\n![Diff output example](docs/example.png)\n\n## Installation\n\n```\nsudo apt install imagemagick # Or the equivalent if not debian based\npip install visualpdfdiff\npip install b2btest # if you want to use the back2back command\n```\n\nNOTE: visualpdfdiff requires enabling ImageMagick to handle PDF.\nThis is disabled by default for security reasons.\nIf you are running a web server accepting PDF files from outside,\nplease, consider the security implications.\n\nEdit `/etc/ImageMagick-*/policy.xml` and \nuncomment th line:\n```xml\n\u003cpolicy domain=\"coder\" rights=\"read | write\" pattern=\"PDF\" /\u003e\n```\nAnd comment the line:\n```xml\n\u003c!-- \u003cpolicy domain=\"coder\" rights=\"none\" pattern=\"PDF\" /\u003e --\u003e\n```\n\n## Comand line diff tool\n\n```bash\nvisualpdfdiff a.pdf b.pdf [output-diff.pdf]\n```\n\nReturns 0 if both pdfs are raster equal, -1 if they are not.\n\nIf an output is provided the side-by-side diff pdf is generated.\nNot providing an output is faster when diff exists, though,\nso checking and then generating is faster when you expect, being equal most of the time.\n\n## Python diff function\n\n```python\nfrom visualpdfdiff import diff\n\nhaveDifferences = diff('a.pdf', 'b.pdf', 'out.pdf')\n```\n\n## Unittest back-to-back assertion\n\nCompares against the last validated output.\nIf the extension is PDF, visualpdfdiff will be chosen to detect and output the differences.\n\n```python\nclass MyClass_Test(unittest.TestCase):\n\n\tfrom b2btest import assertB2BEqual\n\n\tdef test_otherMethod_conditions(self):\n\t\t...\n\t\tself.assertB2BEqual('b.pdf')\n```\n\n## Command back2back tests\n\nUsing the back2back command.\nAlso, by installing this package, PDF outputs are compared using visualpdfdiff.\n\n```yaml\nmyTest:\n  command: ./myreportscript.py -o output.pdf\n  outputs:\n  - output.pdf\n```\n\n## Similar tools\n\n- [pdfdiff:](https://github.com/JoshData/pdf-diff)\n\tExtracts text and diff that, then draws an outline on the text.\n\tBetter for text diffing, but not so for layout diffing.\n- [qtrac's diffpdf:](http://www.qtrac.eu/diffpdf-foss.html)\n\tA quite nice (qt-based) graphical tool that does both text and visual diffing.\n\tIs not maintained anymore since the authors moved to a close source license.\n- [vslavik's diff-pdf:](https://vslavik.github.io/diff-pdf/)\n- [diff-pdf-visualy](https://github.com/bgeron/diff-pdf-visually)\n\tQuite similar to this one, not just in name, but does not generate an output pdf\n\n\n## CHANGES\n\n### 1.0 (Unreleased)\n\n- First version as independent module\n- Previous versions were part of somenergia-oomakotest a test suite to compare outputs of mako reports generated by odoo\n\n## TODO\n\n- Raster resolution configurable by keywords\n- Diff metadata as well\n- Make an overlay fully transparent within the diff zone, and translucent gray in the matching zone\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvokimon%2Fvisualpdfdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvokimon%2Fvisualpdfdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvokimon%2Fvisualpdfdiff/lists"}