{"id":37066076,"url":"https://github.com/frsche/cardimpose","last_synced_at":"2026-01-14T07:45:04.425Z","repository":{"id":219777170,"uuid":"749799088","full_name":"frsche/cardimpose","owner":"frsche","description":"Python library and command line tool to impose multiple copies of a pdf onto a larger document.","archived":false,"fork":false,"pushed_at":"2025-09-10T06:24:11.000Z","size":2497,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-04T14:04:47.920Z","etag":null,"topics":["imposition","pdf","print"],"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/frsche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-29T12:26:03.000Z","updated_at":"2025-09-10T06:24:15.000Z","dependencies_parsed_at":"2025-01-04T11:59:06.465Z","dependency_job_id":null,"html_url":"https://github.com/frsche/cardimpose","commit_stats":null,"previous_names":["frsche/cardimpose"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frsche/cardimpose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frsche%2Fcardimpose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frsche%2Fcardimpose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frsche%2Fcardimpose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frsche%2Fcardimpose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frsche","download_url":"https://codeload.github.com/frsche/cardimpose/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frsche%2Fcardimpose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["imposition","pdf","print"],"created_at":"2026-01-14T07:45:03.820Z","updated_at":"2026-01-14T07:45:04.420Z","avatar_url":"https://github.com/frsche.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cardimpose\n\nCardimpose is a Python library that makes it easy to arrange multiple copies of a PDF on a larger document, perfect for scenarios like printing business cards. The library lets you customize your layout while adding crop marks and comes with a handy command line tool.\n\n## Examples\n\nClick the images to view the corresponding pdf file.\n\n### Business Cards\n\n\u003cdetails\u003e\n\u003csummary\u003eShow Example\u003c/summary\u003e\n\nLets say you have a buisness card named `card.pdf`:\n\n[\u003cimg src=\"https://github.com/frsche/cardimpose/blob/main/images/card.jpg?raw=true\"\u003e](https://github.com/frsche/cardimpose/blob/main/examples/card.pdf?raw=true)\n\nWith the `cardimpose` command line tool, it is easy to print multiple copies of this card onto a larger sheet while adding crop marks:\n\n`$ cardimpose card.pdf`\n\nBy default, the cards a placed side by side on an A4 sheet, filling up the entire document:\n\n[\u003cimg src=\"https://github.com/frsche/cardimpose/blob/main/images/example1.jpg?raw=true\"\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example1.pdf?raw=true)\n\nHowever, it is possible to tweak the layout.\nIn the following example, we add a 5mm gap between the cards:\n\n`$ cardimpose --gutter 5mm card.pdf`\n\n[\u003cimg src=\"https://github.com/frsche/cardimpose/blob/main/images/example2.jpg?raw=true\"\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example2.pdf?raw=true)\n\nThe example card actually has a 3mm bleed around the edges.\nWhen informing `cardimpose`, it positions the cut marks accordingly:\n\n`$ cardimpose --gutter 5mm --bleed 3mm card.pdf`\n\n[\u003cimg src=\"https://github.com/frsche/cardimpose/blob/main/images/example3.jpg?raw=true\"\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example3.pdf?raw=true)\n\nIt is also possible to explicitly set the number of rows and columns:\n\n`$ cardimpose --gutter 30mmx20mm --bleed 3mm --nup 2x2 --rotate-page card.pdf`\n\n[\u003cimg src=\"https://github.com/frsche/cardimpose/blob/main/images/example4.jpg?raw=true\"\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example4.pdf?raw=true)\n\nCustomize the paper size, remove inner cut marks, and more:\n\n`$ cardimpose --gutter 5mm --bleed 3mm --page-size A3 --rotate-page --no-inner-cut-marks card.pdf`\n\n[\u003cimg src=\"https://github.com/frsche/cardimpose/blob/main/images/example5.jpg?raw=true\"\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example5.pdf?raw=true)\n\n\u003c/details\u003e\n\n### Flash Cards\n\u003cdetails\u003e\n\u003csummary\u003eShow Example\u003c/summary\u003e\n\nIn the first example, we showcased the capability of printing multiple duplicates of a single card onto a larger sheet.\nIn this example, we explore a scenario where we aim to produce [flash cards](https://github.com/frsche/cardimpose/blob/main/examples/flash_cards.pdf?raw=true), each featuring distinct questions and answers, to print one of each pair.\nFurthermore, we desire to have the answer printed on the back of the corresponding question.\n\nTo achieve the single printing of each card, we utilize the option `--mode singles`.\nTo implement the printing of answers on the back, we specify `--backside alternating`.\nWith this configuration, each card in the input document is immediately followed by the back of the corresponding card.\n\nFor the flashcards, we would run the following command:\n\n`$ cardimpose --gutter 5mm --bleed 3mm --mode singles --backside alternating flash_cards.pdf`\n\nExecuting this command results in the following output document:\n\n[\u003cimg src=\"https://raw.githubusercontent.com/frsche/cardimpose/main/images/example6-0.jpg\" width=\"200\" /\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example6.pdf?raw=true)\n[\u003cimg src=\"https://raw.githubusercontent.com/frsche/cardimpose/main/images/example6-1.jpg\" width=\"200\" /\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example6.pdf?raw=true)\n\nNote that the backsides are horizontally flipped to ensure proper alignment when printing them double-sided.\n\u003c/details\u003e\n\n### Playing Cards\n\n\u003cdetails\u003e\n\u003csummary\u003eShow Example\u003c/summary\u003e\n\nFor the last example, we want to print [playing cards](https://github.com/frsche/cardimpose/blob/main/examples/playing_cards.pdf?raw=true).\nAll these cards share a common back design.\nTherefore, we employ the `--backside last-page` option, treating the final page in the input PDF as the backside of all cards.\n\nSuppose we intend to print three distinct playing cards labeled A, B and C.\nFor some reason, we wish to print card A three times, while cards B and C are to be printed only twice each.\nTo achieve this, we utilize the `--mode singles` option to not print a whole output sheet for each card, and then specify the quantities using the `--pages 3x1,2x2,2x3,4` argument.\nWith this configuration, we produce three copies of the first page (A), two copies of the second page (B), and two copies of the third page (C), and then the backside on page 4.\n\n`$ cardimpose --gutter 5mm --bleed 3mm --mode singles --backside last-page --pages 3x1,2x2,2x3,4 playing_cards.pdf`\n\n[\u003cimg src=\"https://raw.githubusercontent.com/frsche/cardimpose/main/images/example7-0.jpg\" width=\"200\" /\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example7.pdf?raw=true)\n[\u003cimg src=\"https://raw.githubusercontent.com/frsche/cardimpose/main/images/example7-1.jpg\" width=\"200\" /\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example7.pdf?raw=true)\n[\u003cimg src=\"https://raw.githubusercontent.com/frsche/cardimpose/main/images/example7-2.jpg\" width=\"200\" /\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example7.pdf?raw=true)\n[\u003cimg src=\"https://raw.githubusercontent.com/frsche/cardimpose/main/images/example7-3.jpg\" width=\"200\" /\u003e](https://github.com/frsche/cardimpose/blob/main/examples/example7.pdf?raw=true)\n\n\u003c/details\u003e\n\n## Installation\n\nInstall `cardimpose` using pip:\n\n```bash\npip install cardimpose\n```\n\n## Settings\n\n### Specifying Pages\n\nCardimpose generates one complete output page per selected input page.\nBy default, every input page is selected.\nTo control which input pages produce outputs, use the `--pages` argument.\n\nThis argument supports various options:\n- Use `.` to include all pages.\n- Specify single page numbers. Negative page numbers are calculated from the back of the document.\n- Define page ranges using hyphens: `1-4` = pages 1, 2, 3 and 4.\n- Print a single page multiple times: `5x1` = 5 times the first page\n- Combine multiple page selections with commas.\n\nFor instance, using the command `--pages 1,4-6` will impose pages 1,4,5 and 6 of the input document, generating one imposed output page for each selected input page.\n\nOther command line options apply to all input pages.\nTo specify different bleeds, margins and gutters for different pages, split the input file into different pdf files and impose them separately.\n\n### Specifying Lengths\n\nLengths are given by a number with a unit.\nCurrently, supported units are `mm`, `cm`, `in` and `px`.\nThe arguments `--margin` and `--gutter` can also receive separate horizontal and vertical lengths, combined by an `x`.\nSetting `--margin 1cmx2cm`, sets the left and right margin to 1cm and the top and bottom margin to 2cm.\nA single length for these arguments sets both directions to the same value.\n\n### Crop Marks\n\nBy default cut marks are inserted around each imposed card.\nThe distance, length and thickness can be set through command line arguments (see `cardimpose --help`).\nAdditionally, it is possible to completely disable cutmarks or to hide the cutmarks in the middle of the imposed cards.\n\n## Library\n\nAll features of the command line tool are also available through the `CardImpose` class.\n\n```python\nfrom cardimpose import CardImpose\n\nCardImpose(\"card.pdf\") \\\n\t.set_bleed(\"3mm\")  \\\n\t.set_gutter(\"5mm\") \\\n\t.fill_page()       \\\n\t.save(\"out.pdf\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrsche%2Fcardimpose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrsche%2Fcardimpose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrsche%2Fcardimpose/lists"}