{"id":13588956,"url":"https://github.com/JoshData/pdf-diff","last_synced_at":"2025-04-08T07:31:31.784Z","repository":{"id":17789459,"uuid":"20665924","full_name":"JoshData/pdf-diff","owner":"JoshData","description":"A PDF comparison utility in Python.","archived":false,"fork":false,"pushed_at":"2024-12-06T19:06:30.000Z","size":269,"stargazers_count":470,"open_issues_count":25,"forks_count":69,"subscribers_count":12,"default_branch":"primary","last_synced_at":"2025-04-06T14:06:48.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoshData.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2014-06-09T23:36:52.000Z","updated_at":"2025-04-02T01:23:58.000Z","dependencies_parsed_at":"2024-06-19T00:04:52.079Z","dependency_job_id":"be61b543-4853-4fce-bb85-a761d5f6c1c6","html_url":"https://github.com/JoshData/pdf-diff","commit_stats":{"total_commits":49,"total_committers":12,"mean_commits":4.083333333333333,"dds":0.5306122448979591,"last_synced_commit":"41bf001f2c2a5cca917dc45b11edb4039e176c8a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fpdf-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fpdf-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fpdf-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fpdf-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoshData","download_url":"https://codeload.github.com/JoshData/pdf-diff/tar.gz/refs/heads/primary","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492512,"owners_count":20947544,"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","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":[],"created_at":"2024-08-01T16:00:15.534Z","updated_at":"2025-04-08T07:31:31.707Z","avatar_url":"https://github.com/JoshData.png","language":"Python","readme":"# pdf-diff\n\nFinds differences between two PDF documents:\n\n1. Compares the text layers of two PDF documents and outputs the bounding boxes of changed text in JSON.\n2. Rasterizes the changed pages in the PDFs to a PNG and draws red outlines around changed text.\n\n![Example Image Output](example.png)\n\nThe script is written in Python 3, and it relies on the `pdftotext` program.\n\n## Requirements\n    \n    libxml2 \u003e= 2.7.0, libxslt \u003e= 1.1.23, poppler\n## Requirements installation for Ubuntu:\n    \n    sudo apt-get install python3-lxml poppler-utils\n## Requirements installation for OS X:\n    \n    brew install libxml2 libxslt poppler\n## Installation\n\nFrom PyPI:\n\n    pip install pdf-diff\n\nFrom source:\n\n    sudo python3 setup.py install\n## Running\n\nTurn two PDFs into one large PNG image showing the differences:\n\n    pdf-diff before.pdf after.pdf \u003e comparison_output.png\n\n## Maintainer Notes\n\nTo deploy:\n\n\tpython3 -m pip install --user --upgrade setuptools wheel twine\n\tpython3 setup.py sdist bdist_wheel\n\tpython3 -m twine upload dist/*\n\n## Function flow diagram\n\n```\ncompute_changes\n│\n├── serialize_pdf (called twice)\n│    ├── pdf_to_bboxes\n│    ├── mark_eol_hyphens\n│    │    └── mark_eol_hyphen\n│    └── Processes bounding boxes and text\n│\n├── perform_diff\n│    └── Calls external `fast_diff_match_patch`\n│\n└── process_hunks\n     ├── Iterates through diff hunks\n     └── mark_difference (called multiple times)\n\nrender_changes\n│\n├── simplify_changes\n├── make_pages_images\n│    └── pdftopng (converts PDF pages to images)\n├── realign_pages\n│    ├── Splits pages into sub-pages\n│    └── Adjusts box coordinates\n├── draw_red_boxes\n│    └── Annotates images with rectangles or lines\n└── zealous_crop\n     └── Crops the image to reduce unnecessary margins\n\nstack_pages\n│\n└── Combines processed images into a final output\n```\n\n","funding_links":[],"categories":["PYTHON"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJoshData%2Fpdf-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJoshData%2Fpdf-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJoshData%2Fpdf-diff/lists"}