cardimpose


Namecardimpose JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/frsche/cardimpose
SummaryImpose multiple copies of a pdf onto a larger document.
upload_time2024-01-31 21:13:41
maintainer
docs_urlNone
authorFrederik Scheerer
requires_python
license
keywords imposition print pdf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cardimpose

Cardimpose 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.

## Examples

### Business Cards

<details>
<summary>Show Example</summary>

Lets say you have a buisness card named `card.pdf`:

![card.pdf](https://github.com/frsche/cardimpose/blob/main/images/card.jpg?raw=true)

With the `cardimpose` command line tool, it is easy to print multiple copies of this card onto a larger sheet while adding crop marks:

`$ cardimpose card.pdf`

By default, the cards a placed side by side on an A4 sheet, filling up the entire document:

![example0.pdf](https://github.com/frsche/cardimpose/blob/main/images/example1.jpg?raw=true)

However, it is possible to tweak the layout.
In the following example, we add a 5mm gap between the cards:

`$ cardimpose --gutter 5mm card.pdf`

![example1.pdf](https://github.com/frsche/cardimpose/blob/main/images/example2.jpg?raw=true)

The example card actually has a 3mm bleed around the edges.
When informing `cardimpose`, it positions the cut marks accordingly:

`$ cardimpose --gutter 5mm --bleed 3mm card.pdf`

![example2.pdf](https://github.com/frsche/cardimpose/blob/main/images/example3.jpg?raw=true)

It is also possible to explicitly set the number of rows and columns:

`$ cardimpose --gutter 30mmx20mm --bleed 3mm --nup 2x2 --rotate-page card.pdf`

![example3.pdf](https://github.com/frsche/cardimpose/blob/main/images/example4.jpg?raw=true)

Customize the paper size, remove inner cut marks, and more:

`$ cardimpose --gutter 5mm --bleed 3mm --page-size A3 --rotate-page --no-inner-cut-marks card.pdf`

![example4.pdf](https://github.com/frsche/cardimpose/blob/main/images/example5.jpg?raw=true)

</details>

### Flash Cards
<details>
<summary>Show Example</summary>

In the first example, we showcased the capability of printing multiple duplicates of a single card onto a larger sheet.
In this example, we explore a scenario where we aim to produce flashcards, each featuring distinct questions and answers, to print one of each pair.
Furthermore, we desire to have the answer printed on the back of the corresponding question.

To achieve the single printing of each card, we utilize the option `--mode singles`.
To implement the printing of answers on the back, we specify `--backside alternating`.
With this configuration, each card in the input document is immediately followed by the back of the corresponding card.
Alternatively, the `--backside last-page` option can be employed, which prints the same backside on each distinct front - useful for situations like printing playing cards where all cards share a common backside.

For the flashcards, we would run the following command:

`$ cardimpose --gutter 5mm --bleed 3mm --mode singles --backside alternating flash_cards.pdf`

Executing this command results in the following output document:

![example5.pdf](https://github.com/frsche/cardimpose/blob/main/images/example6.jpg?raw=true)

Note that the backsides are horizontally flipped to ensure proper alignment when printing them double-sided.
</details>

## Installation

Install `cardimpose` using pip:

```bash
pip install cardimpose
```

## Settings

### Specifying Pages

Cardimpose generates one complete output page per selected input page.
By default, every input page is selected.
To control which input pages produce outputs, use the `--pages` argument.

This argument supports various options:
- Use `.` to include all pages.
- Specify single page numbers. Negative page numbers are calculated from the back of the document.
- Define page ranges using hyphens: `1-4` = pages 1, 2, 3 and 4.
- Print a single page multiple times: `5x1` = 5 times the first page
- Combine multiple page selections with commas.

For 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.

Other command line options apply to all input pages.
To specify different bleeds, margins and gutters for different pages, split the input file into different pdf files and impose them separately.

### Specifying Lengths

Lengths are given by a number with a unit.
Currently, supported units are `mm`, `cm`, `in` and `px`.
The arguments `--margin`, `--bleed` and `--gutter` can also receive separate horizontal and vertical lengths, combined by an `x`.
Setting `--margin 1cmx2cm`, sets the left and right margin to 1cm and the top and bottom margin to 2cm.
A single length for these arguments sets both directions to the same value.

### Crop Marks

By default cut marks are inserted around each imposed card.
The distance, length and thickness can be set through command line arguments (see `cardimpose --help`).
Additionally, it is possible to completely disable cutmarks or to hide the cutmarks in the middle of the imposed cards.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/frsche/cardimpose",
    "name": "cardimpose",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "imposition,print,pdf",
    "author": "Frederik Scheerer",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/b0/2f/4c8956254e1a74f64dd92f180ee2e2ed9b1fb19099539ebd0037d97a63a4/cardimpose-0.2.0.tar.gz",
    "platform": null,
    "description": "# 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\n### Business Cards\n\n<details>\n<summary>Show Example</summary>\n\nLets say you have a buisness card named `card.pdf`:\n\n![card.pdf](https://github.com/frsche/cardimpose/blob/main/images/card.jpg?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![example0.pdf](https://github.com/frsche/cardimpose/blob/main/images/example1.jpg?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![example1.pdf](https://github.com/frsche/cardimpose/blob/main/images/example2.jpg?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![example2.pdf](https://github.com/frsche/cardimpose/blob/main/images/example3.jpg?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![example3.pdf](https://github.com/frsche/cardimpose/blob/main/images/example4.jpg?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![example4.pdf](https://github.com/frsche/cardimpose/blob/main/images/example5.jpg?raw=true)\n\n</details>\n\n### Flash Cards\n<details>\n<summary>Show Example</summary>\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 flashcards, 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.\nAlternatively, the `--backside last-page` option can be employed, which prints the same backside on each distinct front - useful for situations like printing playing cards where all cards share a common backside.\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![example5.pdf](https://github.com/frsche/cardimpose/blob/main/images/example6.jpg?raw=true)\n\nNote that the backsides are horizontally flipped to ensure proper alignment when printing them double-sided.\n</details>\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`, `--bleed` 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",
    "bugtrack_url": null,
    "license": "",
    "summary": "Impose multiple copies of a pdf onto a larger document.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/frsche/cardimpose"
    },
    "split_keywords": [
        "imposition",
        "print",
        "pdf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "454f10dc1ed86e91971343d28306b32b9623096807534fd3fbd9caf943e5f528",
                "md5": "4fcd16be722104b71ba0ae1c51f4ed9f",
                "sha256": "27f98ae8c785a5e0de6825da003e943774d06864033cfc7d09e8cfa781fa3481"
            },
            "downloads": -1,
            "filename": "cardimpose-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4fcd16be722104b71ba0ae1c51f4ed9f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 25210,
            "upload_time": "2024-01-31T21:13:40",
            "upload_time_iso_8601": "2024-01-31T21:13:40.146292Z",
            "url": "https://files.pythonhosted.org/packages/45/4f/10dc1ed86e91971343d28306b32b9623096807534fd3fbd9caf943e5f528/cardimpose-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b02f4c8956254e1a74f64dd92f180ee2e2ed9b1fb19099539ebd0037d97a63a4",
                "md5": "949008fdc2dd0e1efa56a0688f3570b7",
                "sha256": "f7f400e6f913a0948b575d0cdfe173f58220e83f88edbbb4091f2bbc252bec53"
            },
            "downloads": -1,
            "filename": "cardimpose-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "949008fdc2dd0e1efa56a0688f3570b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24753,
            "upload_time": "2024-01-31T21:13:41",
            "upload_time_iso_8601": "2024-01-31T21:13:41.322890Z",
            "url": "https://files.pythonhosted.org/packages/b0/2f/4c8956254e1a74f64dd92f180ee2e2ed9b1fb19099539ebd0037d97a63a4/cardimpose-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 21:13:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "frsche",
    "github_project": "cardimpose",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cardimpose"
}
        
Elapsed time: 0.17392s