{"id":17543180,"url":"https://github.com/vb64/pdftoc","last_synced_at":"2025-10-14T20:13:22.752Z","repository":{"id":48660802,"uuid":"380244789","full_name":"vb64/pdftoc","owner":"vb64","description":"Merging several pdf files and generate hierarchy TOC for the resulting pdf.","archived":false,"fork":false,"pushed_at":"2021-07-15T10:25:35.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T20:13:19.089Z","etag":null,"topics":["hierarchical-toc","pdf","pypdf2","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vb64.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-25T13:21:17.000Z","updated_at":"2024-11-30T13:25:45.000Z","dependencies_parsed_at":"2022-09-13T16:00:50.859Z","dependency_job_id":null,"html_url":"https://github.com/vb64/pdftoc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vb64/pdftoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb64%2Fpdftoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb64%2Fpdftoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb64%2Fpdftoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb64%2Fpdftoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vb64","download_url":"https://codeload.github.com/vb64/pdftoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb64%2Fpdftoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021005,"owners_count":26086946,"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-14T02:00:06.444Z","response_time":60,"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":["hierarchical-toc","pdf","pypdf2","python3"],"created_at":"2024-10-21T00:23:08.896Z","updated_at":"2025-10-14T20:13:22.729Z","avatar_url":"https://github.com/vb64.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PdfTOC utility\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/vb64/pdftoc/pdftoc%20pep257?label=Pep257\u0026style=plastic)](https://github.com/vb64/pdftoc/actions?query=workflow%3A%22pdftoc+pep257%22)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/vb64/pdftoc/pdftoc%20tests?label=Python%203.6%203.7%203.8%203.9\u0026style=plastic)](https://github.com/vb64/pdftoc/actions?query=workflow%3A%22pdftoc+tests%22)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/aa5f850432ca45408ab72c002f0689ea)](https://www.codacy.com/gh/vb64/pdftoc/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=vb64/pdftoc\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/aa5f850432ca45408ab72c002f0689ea)](https://www.codacy.com/gh/vb64/pdftoc/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=vb64/pdftoc\u0026utm_campaign=Badge_Coverage)\n\nMerging several pdf files and generate hierarchy TOC for the resulting pdf. TOC and set of source pdf files are defining in JSON file.\n\nUsage:\n```bash\npdftoc toc.json\n```\n\nFor example, to produce resulting `build/output/Merged report.pdf` file from `fixtures/example.pdf` with hierarchical TOC:\n\n![Merged report.pdf](fixtures/example.jpg)\n\nUse the following `toc.json` file:\n\n```json\n{\n  \"target\": \"build/output/Merged report.pdf\",\n  \"folder\": \"fixtures\",\n  \"toc\": [\n    [\"Level 0\", \"\", [\n      [\"Level 1\", \"{f}example.pdf\", []],\n      [\"Level 1\", \"{f}example.pdf\", [\n        [\"Level 2\", \"{f}example.pdf\", []],\n        [\"Level 2\", \"{f}example.pdf\", []]\n      ]],\n      [\"Level 1\", \"{f}example.pdf\", []]\n    ]],\n    [\"Level 0\", \"{f}example.pdf\", []]\n  ]\n}\n```\n\nSequence \"{f}\" is optional placeholder. It will be replaced with the value of \"folder\" key ('fixtures' in the given example).\n\nIf you want to align sections borders in resulting pdf on an even number of pages (for example when printing hard copy), you can use `evenpages` key in json file.\n\n```json\n{\n  \"target\": \"Merged_report.pdf\",\n  \"evenpages\": 1,\n```\n\nYou can download the ready [win64 binary executable](https://github.com/vb64/pdftoc/releases/download/v.1.2/pdftoc.exe) or create your version from sources.\n\nDownload and install:\n\n- [Python 3](https://www.python.org/downloads/release/python-3810/)\n- GNU [Unix Utils](http://unxutils.sourceforge.net/) for makefile operation\n\nThen\n\n```bash\ngit clone git@github.com:vb64/pdftoc.git\ncd pdftoc\nmake setup PYTHON_BIN=/path/to/python3/executable\nmake tests\nmake exe\n```\n\n`pdftoc.exe` will be created in `dist` subfolder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvb64%2Fpdftoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvb64%2Fpdftoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvb64%2Fpdftoc/lists"}