plone.pdfexport


Nameplone.pdfexport JSON
Version 2.2 PyPI version JSON
download
home_pagehttps://github.com/plone/plone.pdfexport
SummaryPDF export of Plone content based on the weasyprint library.
upload_time2024-07-21 17:51:14
maintainerNone
docs_urlNone
authorMaik Derstappen
requires_python>=3.7
licenseGPL version 2
keywords python plone cms pdf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
   This text does not appear on pypi or github. It is a comment.

.. image:: https://github.com/plone/plone.pdfexport/actions/workflows/plone-package.yml/badge.svg
    :target: https://github.com/plone/plone.pdfexport/actions/workflows/plone-package.yml

.. image:: https://coveralls.io/repos/github/plone/plone.pdfexport/badge.svg?branch=main
    :target: https://coveralls.io/github/plone/plone.pdfexport?branch=main
    :alt: Coveralls

.. image:: https://img.shields.io/pypi/v/plone.pdfexport.svg
    :target: https://pypi.python.org/pypi/plone.pdfexport/
    :alt: Latest Version

.. image:: https://img.shields.io/pypi/status/plone.pdfexport.svg
    :target: https://pypi.python.org/pypi/plone.pdfexport
    :alt: Egg Status

.. image:: https://img.shields.io/pypi/pyversions/plone.pdfexport.svg?style=plastic   :alt: Supported - Python Versions

.. image:: https://img.shields.io/pypi/l/plone.pdfexport.svg
    :target: https://pypi.python.org/pypi/plone.pdfexport/
    :alt: License


===============
plone.pdfexport
===============

Provides PDF export functionality for Plone content.

Features
--------

- Exports Documents, Event, News items and other custom content.
- Can be customized via CSS in the PDF Export control panel.
- Long tables which will be rendered on more than one page, will have the thead repeated on every page.
- One can use Plone body tag CSS classes to define CSS rules for specific Plone content.

.. figure:: https://github.com/plone/plone.pdfexport/raw/main/docs/plone-pdfexport.gif



This add-on is based on the great `WeasyPrint library <https://weasyprint.org>`_.

Translations
------------

This product has been translated into

- english
- german


Installation
------------


Install plone.pdfexport by adding it to your buildout::

    [buildout]

    ...

    eggs =
        plone.pdfexport


and then running ``bin/buildout``

Note: for Python 2 (Plone 5.1) you have to pin some packages:

    weasyprint = 0.42.3
    cairocffi = 0.9.0
    tinycss2 = 0.6.1
    soupsieve = 1.9.6
    cssselect2 = 0.2.2


Usage
-----

After installing the add-on you can call the "aspdf" view on any Plone content.

``http://localhost:8080/Plone/news/aspdf``

for testing, you can add the GET parameter "html=1" to see the HTML version before it get rendered into a PDF.

``http://localhost:8080/Plone/news/aspdf?html=1``


We provide portrait and landscape mode with separate page setting for each mode:

.. code-block:: CSS

    @page {
        margin: 2.75cm 1.4cm 1.4cm 1.4cm;
        size: landscape;
        @top-center {
            font-size:12px;
            color:#666666;
            content: "Beautiful Plone content, deserves a beautiful PDF export!";
        }
        @bottom-left {
            font-size:12px;
            color:#666666;
            content: "provided by derico.de";
        }
        @bottom-right {
            font-size:12px;
            color:#666666;
            content: "Page " counter(page);
        }

    }

You can set which mode is the default. To use a different mode, you can add a request parameter:

.. code-block::

    http://localhost:8080/Plone/front-page/aspdf?mode=landscape
    http://localhost:8080/Plone/front-page/aspdf?mode=portait



Authors
-------

This add-on was build by `Derico <https://derico.de>`_ [MrTango].


Contribute
----------

- Issue Tracker: https://github.com/plone/plone.pdfexport/issues
- Source Code: https://github.com/plone/plone.pdfexport


Support
-------

If you are having issues, please let us know.


License
-------

The project is licensed under the GPLv2.


Contributors
============

- Maik Derstappen, md@derico.de


Changelog
=========


2.2 (2024-07-21)
----------------

- Add Banner image field, render banner in page headers
  [MrTango]


2.1 (2022-11-04)
----------------

- fix python_requires definition
  [MrTango]

- require Py >=3.7 and remove restapi down pinning
  [MrTango]


2.0 (2021-10-26)
----------------

- Provide both page mode's (landscape and portrait) with a default setting and switch thru a request mode parameter
  [MrTango]


1.1 (2021-10-08)
----------------

Improved image handling, now support also original images (without @@images/scales).
  [MrTango]


1.0 (2021-10-06)
----------------

- Improve German translations
  [MrTango]

- Improve error handling and add more tests
  [MrTango]


1.0b1 (2021-07-15)
------------------

- Resolve images internally in a custom WeasyPrint url_fetcher, this removes the need to resolves url's for WeasyPrint, which was problematic with permissions or https cert issues
  [MrTango]


1.0a4 (2021-07-14)
------------------

- Don't use  optimize_images=True in weasyprint for now, it only works in Py3 versions
  [MrTango]

1.0a3 (2021-07-14)
------------------

- Add print_image_scale to control panel and use custom image scale for PDF export
  [MrTango]


1.0a2 (2021-07-14)
------------------

- Fix missing lead image viewlet in PDF export
  [MrTango]

- Merge content css classes with body tag classes instead of overriding them
  [MrTango]


1.0a1 (2021-07-13)
------------------

- Initial release.
  [MrTango]
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/plone/plone.pdfexport",
    "name": "plone.pdfexport",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Python Plone CMS PDF",
    "author": "Maik Derstappen",
    "author_email": "md@derico.de",
    "download_url": "https://files.pythonhosted.org/packages/56/57/dcbabaeebc78738cd0dbc2fb85249ae972e4c59a98ce80e919b666f74141/plone.pdfexport-2.2.tar.gz",
    "platform": null,
    "description": ".. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.\n   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html\n   This text does not appear on pypi or github. It is a comment.\n\n.. image:: https://github.com/plone/plone.pdfexport/actions/workflows/plone-package.yml/badge.svg\n    :target: https://github.com/plone/plone.pdfexport/actions/workflows/plone-package.yml\n\n.. image:: https://coveralls.io/repos/github/plone/plone.pdfexport/badge.svg?branch=main\n    :target: https://coveralls.io/github/plone/plone.pdfexport?branch=main\n    :alt: Coveralls\n\n.. image:: https://img.shields.io/pypi/v/plone.pdfexport.svg\n    :target: https://pypi.python.org/pypi/plone.pdfexport/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/status/plone.pdfexport.svg\n    :target: https://pypi.python.org/pypi/plone.pdfexport\n    :alt: Egg Status\n\n.. image:: https://img.shields.io/pypi/pyversions/plone.pdfexport.svg?style=plastic   :alt: Supported - Python Versions\n\n.. image:: https://img.shields.io/pypi/l/plone.pdfexport.svg\n    :target: https://pypi.python.org/pypi/plone.pdfexport/\n    :alt: License\n\n\n===============\nplone.pdfexport\n===============\n\nProvides PDF export functionality for Plone content.\n\nFeatures\n--------\n\n- Exports Documents, Event, News items and other custom content.\n- Can be customized via CSS in the PDF Export control panel.\n- Long tables which will be rendered on more than one page, will have the thead repeated on every page.\n- One can use Plone body tag CSS classes to define CSS rules for specific Plone content.\n\n.. figure:: https://github.com/plone/plone.pdfexport/raw/main/docs/plone-pdfexport.gif\n\n\n\nThis add-on is based on the great `WeasyPrint library <https://weasyprint.org>`_.\n\nTranslations\n------------\n\nThis product has been translated into\n\n- english\n- german\n\n\nInstallation\n------------\n\n\nInstall plone.pdfexport by adding it to your buildout::\n\n    [buildout]\n\n    ...\n\n    eggs =\n        plone.pdfexport\n\n\nand then running ``bin/buildout``\n\nNote: for Python 2 (Plone 5.1) you have to pin some packages:\n\n    weasyprint = 0.42.3\n    cairocffi = 0.9.0\n    tinycss2 = 0.6.1\n    soupsieve = 1.9.6\n    cssselect2 = 0.2.2\n\n\nUsage\n-----\n\nAfter installing the add-on you can call the \"aspdf\" view on any Plone content.\n\n``http://localhost:8080/Plone/news/aspdf``\n\nfor testing, you can add the GET parameter \"html=1\" to see the HTML version before it get rendered into a PDF.\n\n``http://localhost:8080/Plone/news/aspdf?html=1``\n\n\nWe provide portrait and landscape mode with separate page setting for each mode:\n\n.. code-block:: CSS\n\n    @page {\n        margin: 2.75cm 1.4cm 1.4cm 1.4cm;\n        size: landscape;\n        @top-center {\n            font-size:12px;\n            color:#666666;\n            content: \"Beautiful Plone content, deserves a beautiful PDF export!\";\n        }\n        @bottom-left {\n            font-size:12px;\n            color:#666666;\n            content: \"provided by derico.de\";\n        }\n        @bottom-right {\n            font-size:12px;\n            color:#666666;\n            content: \"Page \" counter(page);\n        }\n\n    }\n\nYou can set which mode is the default. To use a different mode, you can add a request parameter:\n\n.. code-block::\n\n    http://localhost:8080/Plone/front-page/aspdf?mode=landscape\n    http://localhost:8080/Plone/front-page/aspdf?mode=portait\n\n\n\nAuthors\n-------\n\nThis add-on was build by `Derico <https://derico.de>`_ [MrTango].\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/plone/plone.pdfexport/issues\n- Source Code: https://github.com/plone/plone.pdfexport\n\n\nSupport\n-------\n\nIf you are having issues, please let us know.\n\n\nLicense\n-------\n\nThe project is licensed under the GPLv2.\n\n\nContributors\n============\n\n- Maik Derstappen, md@derico.de\n\n\nChangelog\n=========\n\n\n2.2 (2024-07-21)\n----------------\n\n- Add Banner image field, render banner in page headers\n  [MrTango]\n\n\n2.1 (2022-11-04)\n----------------\n\n- fix python_requires definition\n  [MrTango]\n\n- require Py >=3.7 and remove restapi down pinning\n  [MrTango]\n\n\n2.0 (2021-10-26)\n----------------\n\n- Provide both page mode's (landscape and portrait) with a default setting and switch thru a request mode parameter\n  [MrTango]\n\n\n1.1 (2021-10-08)\n----------------\n\nImproved image handling, now support also original images (without @@images/scales).\n  [MrTango]\n\n\n1.0 (2021-10-06)\n----------------\n\n- Improve German translations\n  [MrTango]\n\n- Improve error handling and add more tests\n  [MrTango]\n\n\n1.0b1 (2021-07-15)\n------------------\n\n- Resolve images internally in a custom WeasyPrint url_fetcher, this removes the need to resolves url's for WeasyPrint, which was problematic with permissions or https cert issues\n  [MrTango]\n\n\n1.0a4 (2021-07-14)\n------------------\n\n- Don't use  optimize_images=True in weasyprint for now, it only works in Py3 versions\n  [MrTango]\n\n1.0a3 (2021-07-14)\n------------------\n\n- Add print_image_scale to control panel and use custom image scale for PDF export\n  [MrTango]\n\n\n1.0a2 (2021-07-14)\n------------------\n\n- Fix missing lead image viewlet in PDF export\n  [MrTango]\n\n- Merge content css classes with body tag classes instead of overriding them\n  [MrTango]\n\n\n1.0a1 (2021-07-13)\n------------------\n\n- Initial release.\n  [MrTango]",
    "bugtrack_url": null,
    "license": "GPL version 2",
    "summary": "PDF export of Plone content based on the weasyprint library.",
    "version": "2.2",
    "project_urls": {
        "Homepage": "https://github.com/plone/plone.pdfexport",
        "PyPI": "https://pypi.python.org/pypi/plone.pdfexport",
        "Source": "https://github.com/plone/plone.pdfexport",
        "Tracker": "https://github.com/plone/plone.pdfexport/issues"
    },
    "split_keywords": [
        "python",
        "plone",
        "cms",
        "pdf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5657dcbabaeebc78738cd0dbc2fb85249ae972e4c59a98ce80e919b666f74141",
                "md5": "7ceb2c665c91ae284daafa62e54c650a",
                "sha256": "93fef6eca9724d2245ef2b50ccca4bce79ecc001a23df93f9a5377be4c2367b2"
            },
            "downloads": -1,
            "filename": "plone.pdfexport-2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "7ceb2c665c91ae284daafa62e54c650a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4214015,
            "upload_time": "2024-07-21T17:51:14",
            "upload_time_iso_8601": "2024-07-21T17:51:14.789267Z",
            "url": "https://files.pythonhosted.org/packages/56/57/dcbabaeebc78738cd0dbc2fb85249ae972e4c59a98ce80e919b666f74141/plone.pdfexport-2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-21 17:51:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "plone",
    "github_project": "plone.pdfexport",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "plone.pdfexport"
}
        
Elapsed time: 0.26457s