{ "info": { "author": "Nguyen Ba Long", "author_email": "Nguyen.Ba.Long13@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# pdfformfields\n\npdfformfields is a Python wrapper around \n[pdftk](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) \nthat lets the user fill in forms \nfrom a Python dictionary.\n\n### Prerequisites\n\nYou need to have [pdftk server](https://www.pdflabs.com/tools/pdftk-server/)\n on your computer installed.\n\n### Installing\n\nTo install, simply run\n\n``` bash\npip install pdfformfields\n```\n\n## Usage\n\n```python\nfrom pdfformfields import fill_form_fields, generate_dictionary\n\n\n# Example pdf containing two fields with ids: first_name, last_name\nexample_input_pdf = \"example_input.pdf\"\n\n# Use generate_dictionary() with verbose=True to understand the structure\n# generate_dictionary(example_input_pdf, verbose=True)\n\n# Use generate_dictionary() without verbose=True to generate a copiable code for the field dictionary onto the console\ngenerate_dictionary(example_input_pdf)\n\n\"\"\" The output should be:\nrename_me = {\n \"first_name\": ,\n \"last_name\": ,\n}\n\"\"\"\n\n# Paste code, rename dictionary, and fill in the values however you like\nform_field_dictionary = {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n}\n\n# Output filled in dictionary with the fill_form_fields() function\nexample_output_pdf = r\"example_output.pdf\"\nfill_form_fields(example_input_pdf, form_field_dictionary, example_output_pdf)\n\n# If you don't want the output to be editable set flatten=True\nexample_output_pdf_flattened = r\"example_output_pdf_flattened.pdf\"\nfill_form_fields(example_input_pdf, form_field_dictionary, example_output_pdf_flattened, flatten=True)\n```\n\nSee complete [example](example/example_script.py).\n\n### Bash error\n\nThe package did not manage to locate your pdftk command.\n\nMake sure that pdftk server is installed on your system.\nIf it is, try setting the pdftk argument of fill_form_fields to ...\n\n... on Linux:\n\n```\nfill_form_fields(..., pdftk_command=\"pdftk\")\n```\n\n... on Windows:\n```\npdftk_path = os.path.join(\"path_to_pdftk_server_folder\", \"bin\", \"pdftk.exe\")\nfill_form_fields(..., pdftk_command=pdftk_path)\n```\n\n## Built With\n\n* [pdftk](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) \n\n## Author\n\n* **Nguyen Ba Long**\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n* [pypdftk](https://github.com/revolunet/pypdftk) Inspiration: another wrapper around pdftk that does not work under \nWindows and Python 3.7, which is why this package was created.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Balonger/pdfformfields", "keywords": "", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "pdfformfields", "package_url": "https://pypi.org/project/pdfformfields/", "platform": "", "project_url": "https://pypi.org/project/pdfformfields/", "project_urls": { "Homepage": "https://github.com/Balonger/pdfformfields" }, "release_url": "https://pypi.org/project/pdfformfields/0.0.3/", "requires_dist": [ "xfdfgen" ], "requires_python": ">=3.7", "summary": "pdfformfields is a Python wrapper around pdftk that fills in pdf forms from a Python dictionary.", "version": "0.0.3" }, "last_serial": 5935760, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ca2f4454ce05d28e62bc38c752ad1da5", "sha256": "24a597ef83f3c35da48fd303e6d6c88cf74ba3099c9a51382e63e3bbacb2ab89" }, "downloads": -1, "filename": "pdfformfields-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ca2f4454ce05d28e62bc38c752ad1da5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 16450, "upload_time": "2019-09-30T00:18:08", "url": "https://files.pythonhosted.org/packages/04/25/d31cd201f6071ed3bb7fcbb760e71dcd9a366acbc68d615bcd5ff8aebee7/pdfformfields-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1caaff9811a1127ac5ee9fcf81d249ab", "sha256": "42bb9569aff478db4ebcc21c52f441bff99f0b3de27ad7a8b03095e35d5122a5" }, "downloads": -1, "filename": "pdfformfields-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1caaff9811a1127ac5ee9fcf81d249ab", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 3958, "upload_time": "2019-09-30T00:18:10", "url": "https://files.pythonhosted.org/packages/79/61/1422fcdf66a8d7fe862f66e40c7c50269ffcfb187c3c2d88aec3d00a741c/pdfformfields-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "308ba323fd1c124a49aaa8390d2f0c7e", "sha256": "555ed9dbf44e27def9ecb30b68e05d5a2abd10587ecab297a3d5d7ea46cbbd55" }, "downloads": -1, "filename": "pdfformfields-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "308ba323fd1c124a49aaa8390d2f0c7e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 17407, "upload_time": "2019-09-30T00:23:06", "url": "https://files.pythonhosted.org/packages/6d/82/0659cbe32a9dac7958ed9e66ee0dc971ff1fc0b15dd1c74e6ec4fd121235/pdfformfields-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cdd37dee323a9602427f401cbb63be26", "sha256": "c16adf1c53c0b4fc9ee81b7a4c0a0aa6a915cafbc358dc1934121f998b44817a" }, "downloads": -1, "filename": "pdfformfields-0.0.2.tar.gz", "has_sig": false, "md5_digest": "cdd37dee323a9602427f401cbb63be26", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 4303, "upload_time": "2019-09-30T00:23:07", "url": "https://files.pythonhosted.org/packages/ae/02/1ea0e77d58b629ccfb6af9ae65c33310eb71384861f0a7d9955fdce627df/pdfformfields-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "445e582952a814eac9269a77696ff28f", "sha256": "0c0b04dd11142e7c1229167320a183c915f1fe3c59533577f7d912e6837f5495" }, "downloads": -1, "filename": "pdfformfields-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "445e582952a814eac9269a77696ff28f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 17419, "upload_time": "2019-10-06T19:37:38", "url": "https://files.pythonhosted.org/packages/04/2b/a4654f0a36facd5845644faf4638d7bee686bb55285689e9ce6a687c28d1/pdfformfields-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "59f690392111199355e30c3c31295bf4", "sha256": "89013db34938138e9ebff940df3ca93bdd558b9988d7a8a2abb672bf3a02ab95" }, "downloads": -1, "filename": "pdfformfields-0.0.3.tar.gz", "has_sig": false, "md5_digest": "59f690392111199355e30c3c31295bf4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 4314, "upload_time": "2019-10-06T19:37:40", "url": "https://files.pythonhosted.org/packages/4e/15/4e85aa8e7b72726e83bcd6104a6f11d01f3ed587eaa6abfd48bb29ed2bdf/pdfformfields-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "445e582952a814eac9269a77696ff28f", "sha256": "0c0b04dd11142e7c1229167320a183c915f1fe3c59533577f7d912e6837f5495" }, "downloads": -1, "filename": "pdfformfields-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "445e582952a814eac9269a77696ff28f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 17419, "upload_time": "2019-10-06T19:37:38", "url": "https://files.pythonhosted.org/packages/04/2b/a4654f0a36facd5845644faf4638d7bee686bb55285689e9ce6a687c28d1/pdfformfields-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "59f690392111199355e30c3c31295bf4", "sha256": "89013db34938138e9ebff940df3ca93bdd558b9988d7a8a2abb672bf3a02ab95" }, "downloads": -1, "filename": "pdfformfields-0.0.3.tar.gz", "has_sig": false, "md5_digest": "59f690392111199355e30c3c31295bf4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 4314, "upload_time": "2019-10-06T19:37:40", "url": "https://files.pythonhosted.org/packages/4e/15/4e85aa8e7b72726e83bcd6104a6f11d01f3ed587eaa6abfd48bb29ed2bdf/pdfformfields-0.0.3.tar.gz" } ] }