dj-easy-pdf


Namedj-easy-pdf JSON
Version 0.4.7 PyPI version JSON
download
home_pagehttps://github.com/WilliamOtieno/dj-easy-pdf
SummaryDjango PDF views, easily convert html responses to pdf responses
upload_time2023-06-08 09:40:44
maintainer
docs_urlNone
authorWilliam Otieno
requires_python
licenseMIT
keywords dj-easy-pdf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Django PDF rendering
====================

Django PDF rendering, easily convert html responses to pdf responses

.. image:: https://img.shields.io/pypi/v/dj-easy-pdf.svg
    :target: https://pypi.python.org/pypi/dj-easy-pdf/
    :alt: Latest Version
.. image:: https://img.shields.io/badge/wheel-yes-green.svg
    :target: https://pypi.python.org/pypi/dj-easy-pdf/
    :alt: Wheel
.. image:: https://img.shields.io/pypi/l/dj-easy-pdf.svg
    :target: https://pypi.python.org/pypi/dj-easy-pdf/
    :alt: License

Developed by `William Otieno <https://github.com/WilliamOtieno/>`_.


Overview
--------

This app makes rendering PDF files in Django really easy.
It can be used to create invoices, bills and other documents
from simple HTML markup and CSS styles. You can even embed images
and use custom fonts.

The library provides both Class-Based View that is almost a drop-in
replacement for Django's ``TemplateView`` as well as helper functions
to render PDFs in the backend outside the request scope
(i.e. using Celery workers).


Quickstart
----------

1. Include ``dj-easy-pdf``, ``xhtml2pdf`` in your ``requirements.txt`` file.
   If you are on Python 3 you need to install the latest version of Reportlab and the beta version of xhtml2pdf::

    $ pip install dj-easy-pdf

2. Add ``easy_pdf`` to ``INSTALLED_APPS``.

3. Create HTML template for PDF document and add a view that will render it:

    .. code-block:: css+django

        {% extends "easy_pdf/base.html" %}

        {% block content %}
            <div id="content">
                <h1>Hi there!</h1>
            </div>
        {% endblock %}

    .. code-block:: python

        from easy_pdf.views import PDFTemplateView

        class HelloPDFView(PDFTemplateView):
            template_name = 'hello.html'

4. You can also use a mixin to output PDF from Django generic views:

    .. code-block:: python

        class PDFUserDetailView(PDFTemplateResponseMixin, DetailView):
            model = get_user_model()
            template_name = 'user_detail.html'

5. If you're using Function Based views then:

    .. code-block:: python
    
        from easy_pdf.rendering import render_to_pdf_response
        
        def pdf_output(request):
            context = {}
            return render_to_pdf_response(request, "output.html", context)

Documentation
-------------

The full documentation is at `dj-easy-pdf.readthedocs.io <https://dj-easy-pdf.readthedocs.io/>`_.


Dependencies
------------

``dj-easy-pdf`` depends on:

    - ``django>=3.2``
    - ``xhtml2pdf``
    - ``reportlab``


License
-------

``dj-easy-pdf`` is released under the MIT license.


Other Resources
---------------

- GitHub repository - https://github.com/WilliamOtieno/dj-easy-pdf
- PyPi Package site - https://pypi.python.org/pypi/dj-easy-pdf
- Docs - https://dj-easy-pdf.readthedocs.io/


Commercial Support
------------------

This app and many other help us build better software
and focus on delivering quality projects faster.
We would love to help you with your next project so get in touch
by dropping an email at jimmywilliamotieno@gmail.com



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/WilliamOtieno/dj-easy-pdf",
    "name": "dj-easy-pdf",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "dj-easy-pdf",
    "author": "William Otieno",
    "author_email": "jimmywilliamotieno@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/04/54/c2780c02ef7c4b90819fc83a4c9699668f0cb12778841ad2d6098e4b873a/dj-easy-pdf-0.4.7.tar.gz",
    "platform": null,
    "description": "Django PDF rendering\n====================\n\nDjango PDF rendering, easily convert html responses to pdf responses\n\n.. image:: https://img.shields.io/pypi/v/dj-easy-pdf.svg\n    :target: https://pypi.python.org/pypi/dj-easy-pdf/\n    :alt: Latest Version\n.. image:: https://img.shields.io/badge/wheel-yes-green.svg\n    :target: https://pypi.python.org/pypi/dj-easy-pdf/\n    :alt: Wheel\n.. image:: https://img.shields.io/pypi/l/dj-easy-pdf.svg\n    :target: https://pypi.python.org/pypi/dj-easy-pdf/\n    :alt: License\n\nDeveloped by `William Otieno <https://github.com/WilliamOtieno/>`_.\n\n\nOverview\n--------\n\nThis app makes rendering PDF files in Django really easy.\nIt can be used to create invoices, bills and other documents\nfrom simple HTML markup and CSS styles. You can even embed images\nand use custom fonts.\n\nThe library provides both Class-Based View that is almost a drop-in\nreplacement for Django's ``TemplateView`` as well as helper functions\nto render PDFs in the backend outside the request scope\n(i.e. using Celery workers).\n\n\nQuickstart\n----------\n\n1. Include ``dj-easy-pdf``, ``xhtml2pdf`` in your ``requirements.txt`` file.\n   If you are on Python 3 you need to install the latest version of Reportlab and the beta version of xhtml2pdf::\n\n    $ pip install dj-easy-pdf\n\n2. Add ``easy_pdf`` to ``INSTALLED_APPS``.\n\n3. Create HTML template for PDF document and add a view that will render it:\n\n    .. code-block:: css+django\n\n        {% extends \"easy_pdf/base.html\" %}\n\n        {% block content %}\n            <div id=\"content\">\n                <h1>Hi there!</h1>\n            </div>\n        {% endblock %}\n\n    .. code-block:: python\n\n        from easy_pdf.views import PDFTemplateView\n\n        class HelloPDFView(PDFTemplateView):\n            template_name = 'hello.html'\n\n4. You can also use a mixin to output PDF from Django generic views:\n\n    .. code-block:: python\n\n        class PDFUserDetailView(PDFTemplateResponseMixin, DetailView):\n            model = get_user_model()\n            template_name = 'user_detail.html'\n\n5. If you're using Function Based views then:\n\n    .. code-block:: python\n    \n        from easy_pdf.rendering import render_to_pdf_response\n        \n        def pdf_output(request):\n            context = {}\n            return render_to_pdf_response(request, \"output.html\", context)\n\nDocumentation\n-------------\n\nThe full documentation is at `dj-easy-pdf.readthedocs.io <https://dj-easy-pdf.readthedocs.io/>`_.\n\n\nDependencies\n------------\n\n``dj-easy-pdf`` depends on:\n\n    - ``django>=3.2``\n    - ``xhtml2pdf``\n    - ``reportlab``\n\n\nLicense\n-------\n\n``dj-easy-pdf`` is released under the MIT license.\n\n\nOther Resources\n---------------\n\n- GitHub repository - https://github.com/WilliamOtieno/dj-easy-pdf\n- PyPi Package site - https://pypi.python.org/pypi/dj-easy-pdf\n- Docs - https://dj-easy-pdf.readthedocs.io/\n\n\nCommercial Support\n------------------\n\nThis app and many other help us build better software\nand focus on delivering quality projects faster.\nWe would love to help you with your next project so get in touch\nby dropping an email at jimmywilliamotieno@gmail.com\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Django PDF views, easily convert html responses to pdf responses",
    "version": "0.4.7",
    "project_urls": {
        "Homepage": "https://github.com/WilliamOtieno/dj-easy-pdf"
    },
    "split_keywords": [
        "dj-easy-pdf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a168d2826854ec0faf4debdc64c37a84adbd827badddff29af7ea51e537e311c",
                "md5": "7f0c9dd3b0711b64645a01bd2d51ba32",
                "sha256": "cc260ed553e52cf15504bc33532aa122267e120696897e0848c24ab8dc757fde"
            },
            "downloads": -1,
            "filename": "dj_easy_pdf-0.4.7-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7f0c9dd3b0711b64645a01bd2d51ba32",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 9092,
            "upload_time": "2023-06-08T09:40:42",
            "upload_time_iso_8601": "2023-06-08T09:40:42.673770Z",
            "url": "https://files.pythonhosted.org/packages/a1/68/d2826854ec0faf4debdc64c37a84adbd827badddff29af7ea51e537e311c/dj_easy_pdf-0.4.7-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0454c2780c02ef7c4b90819fc83a4c9699668f0cb12778841ad2d6098e4b873a",
                "md5": "22f28986e319db99404aae80a33f0b30",
                "sha256": "7a276eacb2351118e451d577791b3fba6df8fe5478ec7052cf76998976554744"
            },
            "downloads": -1,
            "filename": "dj-easy-pdf-0.4.7.tar.gz",
            "has_sig": false,
            "md5_digest": "22f28986e319db99404aae80a33f0b30",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10063,
            "upload_time": "2023-06-08T09:40:44",
            "upload_time_iso_8601": "2023-06-08T09:40:44.197765Z",
            "url": "https://files.pythonhosted.org/packages/04/54/c2780c02ef7c4b90819fc83a4c9699668f0cb12778841ad2d6098e4b873a/dj-easy-pdf-0.4.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-08 09:40:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "WilliamOtieno",
    "github_project": "dj-easy-pdf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "dj-easy-pdf"
}
        
Elapsed time: 0.08696s