{ "info": { "author": "Julien Bouquillon", "author_email": "julien@revolunet.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "# pypdftk [![circleci](https://circleci.com/gh/revolunet/pypdftk.svg?style=shield&circle-token=78ab3159527f865cf8ee850b3c1c9fcce8ccf631)](https://circleci.com/gh/revolunet/pypdftk) [![travis](https://travis-ci.org/yguarata/pypdftk.svg?branch=master)](https://travis-ci.org/yguarata/pypdftk)\n\nPython module to drive the awesome [pdftk][0] binary.\n\nProudly brought to you by the [revolunet][1] team and [awesome contributors](https://github.com/revolunet/pypdftk/graphs/contributors)\n\n\n## Features\n\n### `fill_form`\nFill a PDF with given data and returns the output PDF path\n - `pdf_path` : input PDF\n - `datas` : dictionnary of fielf names / values\n - `out_file` (default=auto) : output PDF path. will use tempfile if not provided\n - `flatten` (default=True) : flatten the final PDF\n\n### `concat`\nMerge multiple PDFs into one single file and returns the output PDF path\n - `files` : list of PDF files to concatenate\n - `out_file` (default=auto) : output PDF path. will use tempfile if not provided\n\n### `split`\nSplit a single PDF in many pages and return a list of pages paths\n - `pdf_path` : input PDF\n - `out_dir` (default=auto) : output PDFs dir. will use tempfile if not provided\n\n**warning** if you give a out_dir parameter, ensure its empty, or the split function may destroy your files and return incorrect results.\n\n### `gen_xfdf`\nGenerate a XFDF file suited for filling PDF forms and return the generated XFDF file path\n - `datas` : dictionnary of datas\n\n### `get_num_pages`\nReturn the number of pages for a given PDF\n - `pdf_path` : input PDF file\n\n### `replace_page`\nReplace a page in a PDF (pdf_path) by the PDF pointed by pdf_to_insert_path.\n - `pdf_path` is the PDF that will have its page replaced.\n - `page_number` is the number of the page in pdf_path to be replaced. It is 1-based.\n - `pdf_to_insert_path` is the PDF that will be inserted at the old page.\n\n### `stamp`\nApplies a stamp (from `stamp_pdf_path`) to the PDF file in `pdf_path`. If no `output_pdf_path` is provided, it returns a temporary file with the result PDF.\n\n### `[compress | uncompress]`\n These are only useful when you want to edit PDF code in a text\n editor like vim or emacs. Remove PDF page stream compression by\n applying the uncompress filter. Use the compress filter to\n restore compression.\n - `pdf_path` : input PDF file\n - `out_file` (default=auto) : output PDF path. will use tempfile if not provided\n - `flatten` (default=True) : flatten the final PDF\n\n### `dump_data_fields`\nRead PDF and output form field statistics.\n - `pdf_path` : input PDF file\n\n## Example\n\nFill a PDF model and add a cover page :\n\n```python\n\nimport pypdftk\n\ndatas = {\n 'firstname': 'Julien',\n 'company': 'revolunet',\n 'price': 42\n}\ngenerated_pdf = pypdftk.fill_form('/path/to/model.pdf', datas)\nout_pdf = pypdftk.concat(['/path/to/cover.pdf', generated_pdf])\n```\n\n## pdftk path\n\nBy default, path is `/usr/bin/pdftk`, but you can override it with the `PDFTK_PATH` environment variable\n\n## Licence\nThis module is released under the permissive [MIT license](http://revolunet.mit-license.org). Your contributions are always welcome.\n\n\n [0]: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/\n [1]: http://revolunet.com", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/revolunet/pypdftk", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pypdftk", "package_url": "https://pypi.org/project/pypdftk/", "platform": "", "project_url": "https://pypi.org/project/pypdftk/", "project_urls": { "Homepage": "http://github.com/revolunet/pypdftk" }, "release_url": "https://pypi.org/project/pypdftk/0.4/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper for PDFTK", "version": "0.4" }, "last_serial": 4815271, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "97e2f529221fe9fe5ae7ae55a8f7bdc3", "sha256": "bd91d9ad018cf64ca1bde985532dc75bf059be74c936fe3722a03793c947f36e" }, "downloads": -1, "filename": "pypdftk-0.3.tar.gz", "has_sig": false, "md5_digest": "97e2f529221fe9fe5ae7ae55a8f7bdc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3814, "upload_time": "2015-08-05T23:07:37", "url": "https://files.pythonhosted.org/packages/d5/85/45b73fdf9247a7bf5a213673f07e2f72909bcfa817cec7a382f7a970fbfa/pypdftk-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "fcbc8fdb812f1e27850d0d0032f9c966", "sha256": "c596178c9db6e210439b4a976dd1930293ff370683a0bde8e714b512b19f814e" }, "downloads": -1, "filename": "pypdftk-0.4.tar.gz", "has_sig": false, "md5_digest": "fcbc8fdb812f1e27850d0d0032f9c966", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5251, "upload_time": "2019-02-13T11:25:35", "url": "https://files.pythonhosted.org/packages/8c/8d/217585627be49bfdd2eb42c14ae047a5f67b549098f1c18e16b364eb467f/pypdftk-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fcbc8fdb812f1e27850d0d0032f9c966", "sha256": "c596178c9db6e210439b4a976dd1930293ff370683a0bde8e714b512b19f814e" }, "downloads": -1, "filename": "pypdftk-0.4.tar.gz", "has_sig": false, "md5_digest": "fcbc8fdb812f1e27850d0d0032f9c966", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5251, "upload_time": "2019-02-13T11:25:35", "url": "https://files.pythonhosted.org/packages/8c/8d/217585627be49bfdd2eb42c14ae047a5f67b549098f1c18e16b364eb467f/pypdftk-0.4.tar.gz" } ] }