{ "info": { "author": "Matthias Kestenholz", "author_email": "mk@feinheit.ch", "bugtrack_url": null, "classifiers": [], "description": "===========\nPDFDocument\n===========\n\nThis is a wrapper for ReportLab which allows easy creation of PDF documents::\n\n from io import BytesIO\n from pdfdocument.document import PDFDocument\n\n def say_hello():\n f = BytesIO()\n pdf = PDFDocument(f)\n pdf.init_report()\n pdf.h1('Hello World')\n pdf.p('Creating PDFs made easy.')\n pdf.generate()\n return f.getvalue()\n\n\nLetters and reports\n===================\n\nPDFDocument comes with two different PDF templates, letters and reports. The\nonly difference is the layout of the first page: The letter has an additional\nframe for the address at the top and a smaller main content area.\n\nUsage is as follows::\n\n pdf.init_report()\n # Or:\n pdf.init_letter()\n\nThe letter generates default styles using 9 point fonts as base size, the report\nuses 8 points. This can be changed by calling ``pdf.generate_style`` again.\n\nThere exists also a special type of report, the confidential report, the only\ndifferences being that the confidentiality is marked using a red cross at the\ntop of the first page and a watermark in the background.\n\n\nStyles\n======\n\nThe call to ``pdf.generate_style`` generates a set of predefined styles. (Yes\nit does!) That includes the following styles; this list is neither exhaustive\nnor a promise:\n\n- ``pdf.style.normal``\n- ``pdf.style.heading1``\n- ``pdf.style.heading2``\n- ``pdf.style.heading3``\n- ``pdf.style.small``\n- ``pdf.style.bold``\n- ``pdf.style.right``\n- ``pdf.style.indented``\n- ``pdf.style.paragraph``\n- ``pdf.style.table``\n\nMost of the time you will not use those attributes directly, except in the case\nof tables. Convenience methods exist for almost all styles as described in the\nnext chapter.\n\n\nContent\n=======\n\nAll content passed to the following methods is escaped by default. ReportLab\nsupports a HTML-like markup language, if you want to use it directly you'll\nhave to either use only ``pdf.p_markup`` or resort to creating\n``pdfdocument.document.MarkupParagraph`` instances by hand.\n\n\nHeadings\n--------\n\n``pdf.h1``, ``pdf.h2``, ``pdf.h3``\n\n\nParagraphs\n----------\n\n``pdf.p``, ``pdf.p_markup``, ``pdf.small``, ``pdf.smaller``\n\n\nUnordered lists\n---------------\n\n``pdf.ul``\n\nMini-HTML\n---------\n\n``pdf.mini_html``\n\n\nVarious elements\n----------------\n\n``pdf.hr``, ``pdf.hr_mini``, ``pdf.spacer``, ``pdf.pagebreak``,\n``pdf.start_keeptogether``, ``pdf.end_keeptogether``, ``pdf.next_frame``,\n\n\nTables\n------\n\n``pdf.table``, ``pdf.bottom_table``\n\n\nCanvas methods\n--------------\n\nCanvas methods work with the canvas directly, and not with Platypus objects.\nThey are mostly useful inside stationery functions. You'll mostly use\nReportLab's canvas methods directly, and only resort to the following methods\nfor special cases.\n\n``pdf.confidential``, ``pdf.draw_watermark``, ``pdf.draw_svg``\n\n\nAdditional methods\n------------------\n\n``pdf.append``, ``pdf.restart``\n\n\nDjango integration\n==================\n\nPDFDocument has a few helpers for generating PDFs in Django views, most notably\n``pdfdocument.utils.pdf_response``::\n\n from pdfdocument.utils import pdf_response\n\n def pdf_view(request):\n pdf, response = pdf_response('filename_without_extension')\n # ... more code\n\n pdf.generate()\n return response\n\n\nThe SVG support uses svglib by Dinu Gherman. It can be found on PyPI:\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/matthiask/pdfdocument/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pdfdocument", "package_url": "https://pypi.org/project/pdfdocument/", "platform": "", "project_url": "https://pypi.org/project/pdfdocument/", "project_urls": { "Homepage": "https://github.com/matthiask/pdfdocument/" }, "release_url": "https://pypi.org/project/pdfdocument/3.3/", "requires_dist": null, "requires_python": "", "summary": "Programmatic wrapper around ReportLab.", "version": "3.3" }, "last_serial": 4894880, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "952ae6e9a0f71c0a456bbe30d8fa986d", "sha256": "c425c527fb26d89f2243db6f4694652dbf43486fb7be39970b3499fcba11314a" }, "downloads": -1, "filename": "pdfdocument-1.0.tar.gz", "has_sig": true, "md5_digest": "952ae6e9a0f71c0a456bbe30d8fa986d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5753, "upload_time": "2011-03-16T09:52:50", "url": "https://files.pythonhosted.org/packages/7d/49/232bafb98be0ee7858dc5c085853337530584df0442f53ed69c3b1df3e21/pdfdocument-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "ec5b1b551ac9a31fc4786367083ee4d5", "sha256": "a1bd970e8bc3719e0fc7135f3c07118d1518a5b5e6d03a52b8ea6132a477884f" }, "downloads": -1, "filename": "pdfdocument-1.1.tar.gz", "has_sig": true, "md5_digest": "ec5b1b551ac9a31fc4786367083ee4d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6606, "upload_time": "2011-11-15T17:33:07", "url": "https://files.pythonhosted.org/packages/90/50/0dc051fca60448fa17f6f517293218160e2224dc7e2d8523b971169937c5/pdfdocument-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "f4e046b7db6ed82980bf4004d983bb15", "sha256": "99fffa1746ae9f7a691b3678fdb77f3a7f5c1bae7870e730a36dbc1b2cb9d18d" }, "downloads": -1, "filename": "pdfdocument-1.2.tar.gz", "has_sig": true, "md5_digest": "f4e046b7db6ed82980bf4004d983bb15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7147, "upload_time": "2011-12-23T22:42:05", "url": "https://files.pythonhosted.org/packages/67/96/d464f3723ec51081d79049d494089ad0b1fad4308d4283550b1037752a2e/pdfdocument-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "7db3837d52a47492002626dc1ebdca62", "sha256": "c647c3c3d3c7463acb3bc149faa81c19feb8019abb2f332686a126cbf28c71e3" }, "downloads": -1, "filename": "pdfdocument-1.3.tar.gz", "has_sig": true, "md5_digest": "7db3837d52a47492002626dc1ebdca62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7312, "upload_time": "2012-08-03T16:26:19", "url": "https://files.pythonhosted.org/packages/e5/79/ae853a0505cdfc5efdb91ca51883e261d2a060c16a0dfb8595036e500268/pdfdocument-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "f9fbd6a38a428d3d268a081d7c337c6e", "sha256": "8c7cadae9346884aaa4b9535ad59b3804f78de0edccd9d27affefd800a751af2" }, "downloads": -1, "filename": "pdfdocument-1.4.tar.gz", "has_sig": true, "md5_digest": "f9fbd6a38a428d3d268a081d7c337c6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7404, "upload_time": "2012-10-09T09:56:00", "url": "https://files.pythonhosted.org/packages/4c/a8/522e8a273db33d404fd0e46ec1083595fab4c74249873cd60be8b23de417/pdfdocument-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "b7b10c0d30eec9de9674067c4022e5ff", "sha256": "5a13a2716a9b353cafabd5bdfdcf50546a4e15230cc2d7a72b5a842b8c3ebd78" }, "downloads": -1, "filename": "pdfdocument-1.5.tar.gz", "has_sig": true, "md5_digest": "b7b10c0d30eec9de9674067c4022e5ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8731, "upload_time": "2013-03-23T15:29:29", "url": "https://files.pythonhosted.org/packages/fc/3d/bc2c388b3506e696e3d5ecbd6e9e1613324e580b788a2a293f0a9dc64b8b/pdfdocument-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "b6fc7fc9ddf865d99038cced7e16e73f", "sha256": "449a98972c0ae2353dc75dbec6bfabca8ed3217043ffb640e23a7dd34f60b88a" }, "downloads": -1, "filename": "pdfdocument-1.6.tar.gz", "has_sig": true, "md5_digest": "b6fc7fc9ddf865d99038cced7e16e73f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8741, "upload_time": "2013-09-02T12:26:19", "url": "https://files.pythonhosted.org/packages/f5/e0/2547c0b21a1139b908d5479c5ba84407278e8690accf470a2e659e23fc17/pdfdocument-1.6.tar.gz" } ], "3.0": [ { "comment_text": "", "digests": { "md5": "d8f5ef28c43405dca46f24c5871535fa", "sha256": "7e8ca1dd2116dcfb921769f6ef11852dd751ae856f9792a308f9c3f5e40dd2de" }, "downloads": -1, "filename": "pdfdocument-3.0.tar.gz", "has_sig": true, "md5_digest": "d8f5ef28c43405dca46f24c5871535fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8909, "upload_time": "2014-01-03T17:41:15", "url": "https://files.pythonhosted.org/packages/12/4e/beebac58273c82358f8c92943ecf36a8b55561b7aafcfe8e1125bc122bd8/pdfdocument-3.0.tar.gz" } ], "3.1": [ { "comment_text": "", "digests": { "md5": "9d46220b4797ad4a0836a647196b0e32", "sha256": "236fe1f553f30655af2bda0951cddaf8051fc40f54f7ae37899ff2dfe12e2fb7" }, "downloads": -1, "filename": "pdfdocument-3.1.tar.gz", "has_sig": true, "md5_digest": "9d46220b4797ad4a0836a647196b0e32", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8966, "upload_time": "2014-10-21T14:41:41", "url": "https://files.pythonhosted.org/packages/35/dc/7e6b9313f3ca638569c5303bacbfdcde3618c6fa5d37413bcef9c092ae9c/pdfdocument-3.1.tar.gz" } ], "3.2": [ { "comment_text": "", "digests": { "md5": "b94116618066c85f822255ddea12b2a0", "sha256": "d3d47387ed909db95bc49a8ab7141ecee530790b3648744481ead6836769c635" }, "downloads": -1, "filename": "pdfdocument-3.2.tar.gz", "has_sig": false, "md5_digest": "b94116618066c85f822255ddea12b2a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9949, "upload_time": "2017-04-13T11:53:40", "url": "https://files.pythonhosted.org/packages/e7/5a/e44cd9438ceecca480e6cf08c18600b216817b0acc7562e0f2a8e1c981a3/pdfdocument-3.2.tar.gz" } ], "3.3": [ { "comment_text": "", "digests": { "md5": "16d7cbecbbedbc47d853be01274d2a78", "sha256": "8aa0e461ec96c860f5f9e99b711f80b800d6dd910fe78bcb3543756ed7c075e0" }, "downloads": -1, "filename": "pdfdocument-3.3.tar.gz", "has_sig": false, "md5_digest": "16d7cbecbbedbc47d853be01274d2a78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8982, "upload_time": "2019-03-04T15:15:13", "url": "https://files.pythonhosted.org/packages/cf/78/cea047b153e78304f8f011dd5fe3cb72637e4830f3a8f1e01789f6938b64/pdfdocument-3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "16d7cbecbbedbc47d853be01274d2a78", "sha256": "8aa0e461ec96c860f5f9e99b711f80b800d6dd910fe78bcb3543756ed7c075e0" }, "downloads": -1, "filename": "pdfdocument-3.3.tar.gz", "has_sig": false, "md5_digest": "16d7cbecbbedbc47d853be01274d2a78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8982, "upload_time": "2019-03-04T15:15:13", "url": "https://files.pythonhosted.org/packages/cf/78/cea047b153e78304f8f011dd5fe3cb72637e4830f3a8f1e01789f6938b64/pdfdocument-3.3.tar.gz" } ] }