WeasyPrint is a smart solution helping web developers to create PDF documents.

Overview

The Awesome Document Factory

WeasyPrint is a smart solution helping web developers to create PDF documents. It turns simple HTML pages into gorgeous statistical reports, invoices, tickets…

From a technical point of view, WeasyPrint is a visual rendering engine for HTML and CSS that can export to PDF. It aims to support web standards for printing. WeasyPrint is free software made available under a BSD license.

It is based on various libraries but not on a full rendering engine like WebKit or Gecko. The CSS layout engine is written in Python, designed for pagination, and meant to be easy to hack on.

WeasyPrint has been created and developed by Kozea (https://kozea.fr/). Professional support, maintenance and community management is provided by CourtBouillon (https://www.courtbouillon.org/).

Copyrights are retained by their contributors, no copyright assignment is required to contribute to WeasyPrint. Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion is licensed under the BSD 3-clause license, without any additional terms or conditions. For full authorship information, see the version control history.

Comments
  • Tests should pass on Windows

    Tests should pass on Windows

    I've open a branch dedicated for tests on Windows: travis-windows. Thanks to the amazing work of @Tontyna for #587, only 3 tests don't pass:

    The third one is easy to understand: the fonts included in this Windows flavor (Windows Server, version 1803) probably don't include a condensed variant, we should try to update SANS_FONT. The first one can be complicated. The second one is a mystery.

    feature 
    opened by liZe 76
  • Don't use pdfrw anymore

    Don't use pdfrw anymore

    pdfrw is a great piece of software, but we don't know PDF enough to debug the problems we've met. It's safer to use the new cairo API and get back to manual edition for attachments and bleed boxes.

    We only have two regressions for now:

    • some internal links are broken,
    • PDF producer is not overwritten.

    A mail has been sent to cairo's mailing-list about that: https://lists.cairographics.org/archives/cairo/2018-August/028694.html

    Fix #639, fix #615, fix #596, fix #565.

    bug 
    opened by liZe 58
  • Implement `target-counter` to create table of contents

    Implement `target-counter` to create table of contents

    I'd like to automatically create a table of contents in my document. I am thinking of using a small piece of Javascript.... But I have a feeling WeasyPrint doesn't process javascript.. ? Or are there other ways of doing this ?

    Sander.

    feature 
    opened by sander76 45
  • CAIRO_STATUS_TAG_ERROR: b'invalid tag name, attributes, or nesting'

    CAIRO_STATUS_TAG_ERROR: b'invalid tag name, attributes, or nesting'

    Hello,

    I encountered a strange error. When I try to render a pdf in my flask app with the following code:

    @some_blueprint.route("/print/<string:file_hash>")
    def print_pdf(file_hash):
        html = HTML(string="<html><head><title>Test</title></head><body><h1>test</h1></body></html>")
        return render_pdf(html)
    

    Then I get:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2309, in __call__
        return self.wsgi_app(environ, start_response)
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2295, in wsgi_app
        response = self.handle_exception(e)
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1741, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 35, in reraise
        raise value
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2292, in wsgi_app
        response = self.full_dispatch_request()
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1815, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1718, in handle_user_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 35, in reraise
        raise value
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1813, in full_dispatch_request
        rv = self.dispatch_request()
      File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1799, in dispatch_request
        return self.view_functions[rule.endpoint](**req.view_args)
      File "/azk/azk/controllers/hiwi.py", line 184, in print_pdf
        return render_pdf(html)
      File "/usr/local/lib/python3.6/dist-packages/flask_weasyprint/__init__.py", line 209, in render_pdf
        pdf = html.write_pdf(stylesheets=stylesheets)
      File "/usr/local/lib/python3.6/dist-packages/weasyprint/__init__.py", line 199, in write_pdf
        target, zoom, attachments)
      File "/usr/local/lib/python3.6/dist-packages/weasyprint/document.py", line 613, in write_pdf
        levels.pop(), title, link_attribs, 0)
      File "/usr/local/lib/python3.6/dist-packages/cairocffi/surfaces.py", line 903, in add_outline
        self._check_status()
      File "/usr/local/lib/python3.6/dist-packages/cairocffi/surfaces.py", line 160, in _check_status
        _check_status(cairo.cairo_surface_status(self._pointer))
      File "/usr/local/lib/python3.6/dist-packages/cairocffi/__init__.py", line 79, in _check_status
        raise exception(message, status)
    cairocffi.CairoError: cairo returned CAIRO_STATUS_TAG_ERROR: b'invalid tag name, attributes, or nesting'
    

    Actually I am using flask_weasyprint, but the error is the same when using weasyprint directly. So far I have not been able to reproduce this with a simple flask application, but after removing the <h1> and </h1> tag everythings fine.

    My python env consists of:

    alembic==1.0.2
    asn1crypto==0.24.0
    bcrypt==3.1.4
    blinker==1.4
    bokeh==1.0.1
    cairocffi==0.9.0
    CairoSVG==2.2.1
    certifi==2018.10.15
    cffi==1.11.5
    chardet==3.0.4
    Click==7.0
    coverage==4.5.1
    cryptography==2.1.4
    cssselect2==0.2.1
    decorator==4.3.0
    defusedxml==0.5.0
    Flask==1.0.2
    Flask-Bcrypt==0.7.1
    Flask-DebugToolbar==0.10.1
    Flask-Login==0.4.1
    Flask-Migrate==2.3.0
    flask-mongoengine==0.9.5
    Flask-Principal==0.4.0
    Flask-SQLAlchemy==2.3.2
    Flask-WeasyPrint==0.5
    Flask-WTF==0.14.2
    html5lib==1.0.1
    idna==2.6
    infinity==1.4
    intervals==0.8.1
    itsdangerous==1.1.0
    Jinja2==2.10
    keyring==10.6.0
    keyrings.alt==3.0
    ldap==1.0.2
    ldap3==2.5.1
    Mako==1.0.7
    MarkupSafe==1.1.0
    mongoengine==0.16.0
    numpy==1.15.4
    packaging==18.0
    pandas==0.23.4
    Pillow==5.3.0
    ply==3.11
    pyasn1==0.4.4
    pyasn1-modules==0.2.2
    pycparser==2.18
    pycrypto==2.6.1
    pygobject==3.26.1
    pymongo==3.7.2
    PyMySQL==0.9.2
    pyparsing==2.3.0
    Pyphen==0.9.5
    python-dateutil==2.7.5
    python-editor==1.0.3
    python-ldap==3.1.0
    pytz==2018.7
    pyxdg==0.25
    PyYAML==3.13
    regex==2018.11.7
    requests==2.20.0
    SecretStorage==2.3.1
    six==1.11.0
    SQLAlchemy==1.2.12
    SQLAlchemy-Utils==0.33.6
    tinycss2==0.6.1
    tornado==5.1.1
    urllib3==1.24.1
    validators==0.12.2
    WeasyPrint==43
    webencodings==0.5.1
    Werkzeug==0.14.1
    WTForms==2.2.1
    WTForms-Alchemy==0.16.7
    WTForms-Components==0.10.3
    

    and the whole app is running in a docker container which is based on ubuntu 18.04. Is there anything I am doing wrong?

    opened by Niecke 44
  • Python 3.8 AWS Lambda incompatibility (Amazon Linux 2)

    Python 3.8 AWS Lambda incompatibility (Amazon Linux 2)

    Hello there!

    I'm trying to build and package WeasyPrint and its native dependencies into an AWS Lambda layer for the Python 3.8 runtime.

    The steps described in https://github.com/Kozea/WeasyPrint/issues/916 work for the Python 3.7 runtime environment (Amazon Linux 1), but fail with Python 3.8.

    Here's as far as I got:

    # Dockerfile
    FROM lambci/lambda:build-python3.8
    
    # Based on https://aws.amazon.com/premiumsupport/knowledge-center/lambda-linux-binary-package/
    RUN yum install -y yum-utils rpmdevtools
    WORKDIR /tmp
    RUN yumdownloader --resolve \
        libffi \
        libffi-devel \
        cairo \
        pango && \
        rpmdev-extract *rpm
    
    RUN mkdir /opt/lib
    WORKDIR /opt/lib
    RUN cp -P -R /tmp/*/usr/lib64/* /opt/lib
    RUN ln libcairo.so.2 libcairo.so && \
        ln libpango-1.0.so.0 pango-1.0 && \
        ln libpangocairo-1.0.so.0 pangocairo-1.0
    
    WORKDIR /opt
    RUN pip3 install weasyprint -t python
    RUN zip -r /var/task/weasyprint_lambda_layer.zip ./lib ./python
    
    # Test the package
    RUN PYTHONPATH=python python -m weasyprint
    

    And the resulting error:

    Traceback (most recent call last):
      File "/var/lang/lib/python3.8/runpy.py", line 183, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "/var/lang/lib/python3.8/runpy.py", line 142, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "/var/lang/lib/python3.8/runpy.py", line 109, in _get_module_details
        __import__(pkg_name)
      File "/opt/python/weasyprint/__init__.py", line 443, in <module>
        from .document import Document, Page  # noqa isort:skip
      File "/opt/python/weasyprint/document.py", line 24, in <module>
        from .fonts import FontConfiguration
      File "/opt/python/weasyprint/fonts.py", line 54, in <module>
        pangoft2 = dlopen(ffi, 'pangoft2-1.0', 'libpangoft2-1.0-0',
      File "/opt/python/weasyprint/text.py", line 253, in dlopen
        return ffi.dlopen(names[0])  # pragma: no cover
      File "/opt/python/cffi/api.py", line 146, in dlopen
        lib, function_cache = _make_ffi_library(self, name, flags)
      File "/opt/python/cffi/api.py", line 828, in _make_ffi_library
        backendlib = _load_backend_lib(backend, libname, flags)
      File "/opt/python/cffi/api.py", line 823, in _load_backend_lib
        raise OSError(msg)
    OSError: cannot load library 'pangoft2-1.0': pangoft2-1.0: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'pangoft2-1.0'
    

    Now, the problem is I can't find any pangoft2 distribution for Fedora nor any compilation instructions.

    Any pointers?

    Thanks!

    documentation 
    opened by Wenzil 39
  • UnboundLocalError: local variable 'lower_guess' referenced before assignment

    UnboundLocalError: local variable 'lower_guess' referenced before assignment

    I'm having issue #409 with weasyprint 44. That issue is closed and I don't see how I could reopen it. I've described what's happening in that issue for now.

    crash bug 
    opened by andreas-gruenbacher 38
  • Allow page breaks in floats, absolute blocks, table-cells

    Allow page breaks in floats, absolute blocks, table-cells

    Floated elements that don't fit on the current page simply fall off the bottom, rather than being placed on the next page.

    Here's a handy long list of floated elements to demonstrate the problem: http://www.stripey.com/demo/weasyprint/float_off_bottom.html

    Look at it in Firefox and do ‘Print Preview’. You should see that there's a page break, with the list being continued on page 2. Similarly if you print from Chromium.

    But WeasyPrint generates this file, where the elements simply run off the bottom of the first page: http://www.stripey.com/demo/weasyprint/float_off_bottom.pdf

    bug 
    opened by Smylers 36
  • Support @font-face on Linux

    Support @font-face on Linux

    Today on IRC:

    SimonSapin: Hi behdad. Does Pango have APIs to load a specific font file? (This is to implement web fonts in WeasyPrint.) behdad: SimonSapin: no. behdad: SimonSapin: however, you can subclass the FcFontMap and do it yourself. behdad: that's what Firefox does. behdad: don't ask me about the details... I don't quite know that myself either. SimonSapin: behdad: I’ll look into it, thanks behdad: well. that's not correct. I know. you can subclass PangoCairoFcFontMap behdad: and override the create_font(), and figure it out from there behdad: humm. something like that. don't remember the details. behdad: the thing is, you need to work around the fontconfig layer

    Now we only need to figure out how subclassing works in gobject. And all of fontconfig.

    feature 
    opened by SimonSapin 36
  • Unexpected horizontal whitespace

    Unexpected horizontal whitespace

    Running WeasyPrint 0.42.3 on Python 3.6.5 and Ubuntu 18.04, I occasionally see odd horizontal gaps in documents. Here's an example that's about as minimal as I can make it:

    <!DOCTYPE html>
    
    <html lang="en-US">
    <head>
    <meta charset="UTF-8">
    <title>foo</title>
    <style>
    
    body
       {font-family: "Times New Roman";
        font-size: 12pt;}
    
    </style></head><body>
    
    <p>Xyzz, B. B., <b>Smith A.</b> <i>Hello world</i>.</p>
    
    </body>
    </html>
    

    The generated PDF looks like this in Okular 1.3.3 (200% zoom):

    Screenshot

    Why is there a lot of whitespace after "Smith A."?

    bug 
    opened by Kodiologist 33
  • Seemingly random crashes when used with uWSGI, Django and Celery on MacOS

    Seemingly random crashes when used with uWSGI, Django and Celery on MacOS

    I am using WeasyPrint with Django and Celery and seemingly random errors occur. I have a Django model which has a file field that is a pdf and a celery task which generates these pdfs using WeasyPrint.

    The first error occurs on our web server and occurs on seemingly random requests and we receive the traceback below:

    Traceback (most recent call last):
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 103, in get_response
        resolver_match = resolver.resolve(request.path_info)
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 319, in resolve
        for pattern in self.url_patterns:
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 347, in url_patterns
        patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 342, in urlconf_module
        self._urlconf_module = import_module(self.urlconf_name)
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
        __import__(name)
    
      File "/sites/myApp/urls.py", line 16, in <module>
        admin.autodiscover()
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 29, in autodiscover
        import_module('%s.admin' % app)
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
        __import__(name)
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/djcelery/admin.py", line 274, in <module>
        class PeriodicTaskAdmin(admin.ModelAdmin):
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/djcelery/admin.py", line 276, in PeriodicTaskAdmin
        form = periodic_task_form()
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/djcelery/admin.py", line 246, in periodic_task_form
        current_app.loader.import_default_modules()
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/djcelery/loaders.py", line 138, in import_default_modules
        self.autodiscover()
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/djcelery/loaders.py", line 141, in autodiscover
        self.task_modules.update(mod.__name__ for mod in autodiscover() or ())
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/djcelery/loaders.py", line 176, in autodiscover
        for app in settings.INSTALLED_APPS])
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/djcelery/loaders.py", line 195, in find_related_module
        return importlib.import_module('%s.%s' % (app, related_name))
    
      File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
        __import__(name)
    
      File "/sites/myApp/apps/pdfs/tasks.py", line 6, in <module>
        from apps.pdfs.models import PdfModel
    
      File "/sites/myApp/apps/pdfs/models.py", line 15, in <module>
        from apps.pdfs.utils import pdf_utils
    
      File "/sites/myApp/apps/pdfs/utils/pdf_utils.py", line 3, in <module>
        from weasyprint import HTML, CSS
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/weasyprint/__init__.py", line 304, in <module>
        from .css import PARSER, preprocess_stylesheet
    
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/weasyprint/css/__init__.py", line 29, in <module>
        from . import properties
    
    ImportError: cannot import name properties
    

    This exact error occurs with a relatively high frequency, although nowhere near all requests and it starts at seemingly random times. Restarting the uwsgi process which runs the server "solves" the problem.

    This issue is also "solved" when I remove djcelery, since djcelery no longer tries to autoload all my tasks modules and WeasyPrint is no longer imported down the line at this point in time, only when it is required.

    I originally thought this error would be related to issue #10 but I am not sure because none of the fixes in that issue seemed to work and I am also able to import and use WeasyPrint generally, it just seems to fail in this one specific case.

    We also get an error on the machines which run celery workers. We have a Django management command which runs every 3 minutes, and about once a day, we receive the following traceback:

    Traceback (most recent call last):
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/management/base.py", line 222, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/management/base.py", line 254, in execute
        self.validate()
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/management/base.py", line 280, in validate
        num_errors = get_validation_errors(s, app)
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
        for (app_name, error) in get_app_errors().items():
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/db/models/loading.py", line 166, in get_app_errors
        self._populate()
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/db/models/loading.py", line 72, in _populate
        self.load_app(app_name, True)
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/db/models/loading.py", line 96, in load_app
        models = import_module('.models', app_name)
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
        __import__(name)
      File "/sites/myApp/apps/pdfs/models.py", line 15, in <module>
        from apps.pdfs.utils import pdf_utils
      File "/sites/myApp/apps/pdfs/utils/pdf_utils.py", line 3, in <module>
        from weasyprint import HTML, CSS
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/weasyprint/__init__.py", line 304, in <module>
        from .css import PARSER, preprocess_stylesheet
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/weasyprint/css/__init__.py", line 30, in <module>
        from . import computed_values
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/weasyprint/css/computed_values.py", line 18, in <module>
        from .. import text
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/weasyprint/text.py", line 195, in <module>
        gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0')
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/weasyprint/text.py", line 192, in dlopen
        return ffi.dlopen(names[0])  # pragma: no cover
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/cffi/api.py", line 112, in dlopen
        lib, function_cache = _make_ffi_library(self, name, flags)
      File "/home/ubuntu/.virtualenvs/myApp/local/lib/python2.7/site-packages/cffi/api.py", line 369, in _make_ffi_library
        path = ctypes.util.find_library(name)
      File "/usr/lib/python2.7/ctypes/util.py", line 224, in find_library
        return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
      File "/usr/lib/python2.7/ctypes/util.py", line 213, in _findSoname_ldconfig
        f = os.popen('/sbin/ldconfig -p 2>/dev/null')
    OSError: [Errno 12] Cannot allocate memory
    

    I have attempted to check the obvious issue of is the server out of memory which doesn't seem to be the case, and it also seemed odd that the error is the exact same every time. The management command also runs successfully 3 minutes before and 3 minutes after. Also, this occurs across 3 different machines, at the same time.

    Both of these errors seem to occur when Django or Celery dynamically import something which eventually imports from WeasyPrint, and both seem to happen randomly as I have been unable to ever reproduce these errors myself.

    crash 
    opened by ryankuczka 33
  • v53.0b2 Global Installation

    v53.0b2 Global Installation

    How do I install this version globally (outside of a virtual environment)? I'm attempting to get this done in a GitLab CI script, and am battling with dependencies and errors.

    My CI script is on a php:8 image as the package is for PHP and needs to be tested.

    I've arrived at a point where the dependencies seem correct, but am now getting this error:

    AttributeError: function/symbol 'pango_context_set_round_glyph_positions' not found in library 'libpango-1.0.so.0': /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: pango_context_set_round_glyph_positions

    These are the dependencies (some for PHP):

    apt install -yqq build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget git libmcrypt-dev python3-dev python3-pip python3-setuptools python3-wheel python3-cffi python3-venv libpango1.0-dev libzip-dev libharfbuzz-dev libpangoft2-1.0-0 libjpeg-dev libpng-dev

    Many thanks!

    feature 
    opened by mikerockett 30
  • Tibetan pagination

    Tibetan pagination

    For Tibetan text print layout it is need insert ༄༅། in beginning of first text string on every odd page.

    Please help us understand how apply this rule for page layout

    With best regards Open Source Buddhism Library Alexander Stroganov tibetan pagination

    CSS question 
    opened by RimeOCRLIB 5
  • compose Tibetan Buddhist Canon text collection in layout of traditional Pecha tibetan texts

    compose Tibetan Buddhist Canon text collection in layout of traditional Pecha tibetan texts

    Good day.

    Thank you for all your noble work for benefit of all mankind.

    At present we need compose Tibetan Buddhist Canon text collection in layout of traditional Pecha tibetan texts. At first stage it is about 350 volumes.

    https://www.pechamaker.com/screenshots.html https://en.wikipedia.org/wiki/Pecha

    Does it possible to ask your help to compose this layout and help me understand how adjust hyphenation route for tibetan texts? First of all we need position @left-middle and @right-middle properly and make border around all page content.

    @page :left {
      margin: 5mm 35mm 5mm 35mm;
      border: 1px solid black;
      padding:3px;
      @left-middle { display: inline-block; margin-left:-60px; padding:3px; width:200px; height:30px; border:1px solid black; transform: rotate(90deg);  content: "ris" }
      @right-middle {display: inline-block; margin-right:-60px;  padding:3px; width:200px; height:30px; border:1px solid black; transform: rotate(-90deg); content: counter(page); font-variant: small-caps }
    }
    

    pecha Screenshot from 2022-12-25 20-24-00 Of course we will be happy provide Weasyprint contact an every generated PDF (at last few million pages).

    Open Source Buddhism Library Stroganov Alexander

    opened by RimeOCRLIB 8
  • Weasyprint output differs between Operating systems

    Weasyprint output differs between Operating systems

    I am printing the same html and css files on both MacOS locally and Alpine 3.16 in a docker container and the output differs between the 2. On Mac everything is set up correctly, it comes out properly formatted and in the correct order, but in the docker container it comes out with text overlaying other text (duplicated, as if one page is overlayed on itself slightly to the right), extra blank pages and sections in the wrong order.

    Package versions: Alpine 3.16:

    • gcc-11.2.1
    • musl-dev-1.2.3-r1
    • Python 3.9.15
    • pango-1.50.7
    • zlib-dev-1.2.12
    • jpeg-dev-9d-r1
    • openjpeg-dev-2.5.0
    • g++-11.2.1
    • libffi-dev-3.4.2

    MacOS Monterey

    • Python 3.9.13
    • pango-1.50.11
    opened by jamie-96 2
  • Apply style defined in HTML on inline SVG images

    Apply style defined in HTML on inline SVG images

    Example:

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <title>Attribute Selector Test</title>
        <style>
          svg [font-family~="serif"] {
            font-family: monospace;
            text-transform: uppercase;
          }
        </style>
      </head>
      <body>
        <svg width="300" height="200" xmlns="http://www.w3.org/2000/svg">
          <rect width="100%" height="100%" fill="green" />
          <circle cx="150" cy="100" r="80" fill="black" />
          <text x="150" y="125" font-family="serif" font-size="60" text-anchor="middle" fill="white">main</text>
        </svg>
      </body>
    </html>
    

    Firefox screenshot: Screenshot 2022-11-02 at 11 28 13 AM

    Weasyprint 57.0 screenshot: Screenshot 2022-11-02 at 11 29 06 AM

    feature 
    opened by kesara 2
  • Flex container: align-items:flex-start with text produces unexpected line returns

    Flex container: align-items:flex-start with text produces unexpected line returns

    Hi, a simple flex container with align-items: flex-start; fails to produce expected output.

    Similar to #1171, but a simpler case, as I am not using nested flex boxes.

    test.html:

    <!DOCTYPE html>
    <html lang="fr-CA">
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="test.css">
      </head>
      <body>
        <section>
          <div class="vbox is-debug">
            <div><p class="is-debug">Hi Bart</p></div>
            <div><p class="is-debug">Hi Lisa</p></div>
            <div><p class="is-debug">Hi Homer</p></div>
            <div><p class="is-debug">Hi Marge</p></div>
          </div>
        </section>
      </body>
    </html>
    

    test.css:

    .vbox {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .is-debug {
        border-style: dashed;
        border-width: 1px;
    }
    

    cat test.html | weasyprint -s test.css - test.pdf

    WeasyPrint: image

    Chromium (similar to what I expect -- albeit the user agent sytlesheet): image

    Replacing <p> with <span>:

    WeasyPrint: image

    Chromium: image

    EDIT: Adding display: inline-block; or white-space: nowrap; to my inner <p> or <span> elements seems to be a workaround.

    bug 
    opened by leducvin 0
Releases(v57.2)
  • v57.2(Dec 23, 2022)

    Bug fixes

    • 0f2e377: Print annotations with PDF/A
    • 0e9426f: Hide annotations with PDF/UA
    • #1764: Use reference instead of stream for annotation appearance stream
    • #1783: Fix multiple font weights for @font-face declarations

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Tom Pohl
    • Castedo Ellerman
    • Moritz Mahringer
    • Piotr Horzycki
    • Gábor Nyers
    • Sidharth Kapur
    Source code(tar.gz)
    Source code(zip)
  • v57.1(Nov 4, 2022)

    Dependencies

    • #1754: Pillow 9.1.0 is now needed

    Bug fixes

    • #1756: Fix rem font size for SVG images
    • #1755: Keep format when transposing images
    • #1753: Don’t use deprecated read_text function when files is available
    • #1741: Generate better manpage
    • #1747: Correctly set target counters in pages’ absolute elements
    • #1748: Always set font size when font is changed in line
    • 2b05137: Fix stability of font identifiers

    Documentation

    • #1750: Fix documentation spelling

    Contributors

    • Guillaume Ayoub
    • Eli Schwartz
    • Mikhail Anikin
    • Scott Kitterman

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Tom Pohl
    • John R Ellis
    • Castedo Ellerman
    • Moritz Mahringer
    • Gábor
    • Piotr Horzycki
    Source code(tar.gz)
    Source code(zip)
  • v57.0(Oct 18, 2022)

    This version also includes the changes from unstable b1 version listed below.

    New features

    • a4fc7a1: Support image-orientation

    Bug fixes

    • #1739: Set baseline on all flex containers
    • #1740: Don’t crash when currentColor is set on root svg tag
    • #1718: Don’t crash with empty bitmap glyphs
    • #1736: Always use the font’s vector variant when possible
    • eef8b4d: Always set color and state before drawing
    • #1662: Use a stable key to store stream fonts
    • #1733: Don’t remove attachments when adding internal anchors
    • 3c4fa50, c215697, d275dac, b04bfff: Fix many bugs related to PDF/UA structure

    Performance

    • dfccf1b: Use faces as fonts dictionary keys
    • 0dc12b6: Cache add_font to avoid calling get_face too often
    • 75e17bf: Don’t call process_whitespace twice on many children
    • 498d3e1: Optimize missing functions

    Documentation

    • 863b3d6: Update documentation of installation on macOS with Homebrew

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Tom Pohl
    • John R Ellis
    • Castedo Ellerman
    • Moritz Mahringer
    • Gábor
    • Piotr Horzycki
    Source code(tar.gz)
    Source code(zip)
  • v57.0b1(Sep 22, 2022)

    This version is experimental, don't use it in production. If you find bugs, please report them!

    New features

    • #1704: Support PDF/UA, with financial support from Novareto
    • #1454: Support variable fonts

    Bug fixes

    • #1058: Fix bullet position after page break, with financial support from OpenZeppelin
    • #1707: Fix footnote positioning in multicolumn layout, with financial support from Code & Co.
    • #1722: Handle skew transformation with only one parameter
    • #1715: Don’t crash when images are truncated
    • #1697: Don’t crash when attr() is used in text-decoration-color
    • #1695: Include language information in PDF metadata
    • #1612: Don’t lowercase letters when capitalizing text
    • #1700: Fix crash when rendering footnote with repagination
    • #1667: Follow EXIF metadata for image rotation
    • #1669: Take care of floats when remvoving placeholders
    • #1638: Use the original box when breaking waiting children

    Contributors

    • Guillaume Ayoub
    • Konstantin Weddige
    • VeteraNovis
    • Lucie Anglade

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Tom Pohl
    • John R Ellis
    • Moritz Mahringer
    • Gábor
    • Piotr Horzycki
    • Andrew Ittner
    Source code(tar.gz)
    Source code(zip)
  • v56.1(Jul 24, 2022)

    Bug fixes

    • #1674: Follow max-height on footnot area, with financial support from Code & Co.
    • #1678: Fix gradients with opacity set

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    • Andrew Ittner
    Source code(tar.gz)
    Source code(zip)
  • v56.0(Jul 7, 2022)

    This version also includes the changes from unstable b1 version listed below.

    New features

    • 70f9b62: Support format 5 for bitmap glyphs

    Bug fixes

    • #1666: Fix reproducible PDF generation with embedded images
    • #1668: Fix @page:nth() selector
    • 3bd9a8e: Don’t limit the opacity groups to the original box size
    • cb9540b, 76d174f, 9ce6547: Minor bugfixes for split table rows

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Des images et des mots
    • Andreas Zettl
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    Source code(tar.gz)
    Source code(zip)
  • v56.0b1(Jun 17, 2022)

    This version is experimental, don't use it in production. If you find bugs, please report them!

    Dependencies

    • pydyf 0.2.0+ is now needed

    Features

    • #1660: Support nested line-clamp, with financial support from Expert Germany
    • #1644, #1645: Support bitmap fonts, with financial support from Expert Germany
    • #1651, #630: Support PDF/A, with financial support from Blueshoe

    Bug fixes

    • #1656: Fix chained variables in the same selector block
    • #1028: Fix font weight management in @font-face rules
    • #1653: Don’t crash when @font-face’s src ends with a comma
    • #1650: Don’t check origin when URL only contains fragment
    • e38bff8: Don’t crash when inherited SVG attributes are not set on the parent

    Performance

    • e6021da: Launch tests in parallel by default

    Contributors

    • Guillaume Ayoub
    • aschmitz
    • Lucie Anglade

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Des images et des mots
    • Andreas Zettl
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    Source code(tar.gz)
    Source code(zip)
  • v55.0(May 12, 2022)

    This version also includes the changes from unstable b1 version listed below.

    Bug fixes

    • #1626, 3802f88: Fix the vertical position and available height of absolute boxes
    • 9641098, e5e6b88: Minor fixes for multi-column layout
    • 0fcc7de: Don’t stop rendering SVG when CSS parsing fails
    • #1636: Fix sequential footnotes that could disappear when overflowing
    • #1637: Fix position of absolute boxes with right-to-left direction
    • #1641: Fix relative paths for SVG files stored as data URLs

    Contributors

    • Guillaume Ayoub
    • aschmitz

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • Spacinov
    • KontextWork
    • René Fritz
    • NCC Group
    • Kobalt
    • Nathalie Gutton
    • Andreas Zettl
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    Source code(tar.gz)
    Source code(zip)
  • v55.0b1(Apr 15, 2022)

    This version is experimental, don't use it in production. If you find bugs, please report them!

    Dependencies

    • Python 3.7+ is now needed, Python 3.6 is not supported anymore

    Features

    • #1534: Support word-break: break-all
    • #489, #1619: Support column breaks
    • #1553: Allow reproducible PDF generation

    Bug fixes

    • #1007, #1524: Handle inherit in shorthand properties
    • #1539, #1541: Space out no-repeat patterns
    • #1554: Avoid invalid PDF operators when drawing SVG text
    • #1564, #1566, #1570: Don’t output footnotes before their call sites
    • #1020, #1597: Prevent infinite loops in multi-column layout
    • #1512, #1613: Fix position of absolute boxes in right-to-left contexts
    • #1093: Draw borders around absolute replaced boxes
    • #984, #1604: Fix skip stacks for columns
    • #1621: Better support of nested text-decoration properties
    • fe1f3d9: Fix absolute blocks in lines
    • 4650b70: Clear adjoining margins when a container’s child doesn’t fit

    Performance

    • #1548: Improve tests speed
    • 3b0ae92, #1457: Improve fonts management
    • #1597: Improve column layout speed
    • #1587, #1607, #1608: Cache ch and ex units calculations

    Contributors

    • Guillaume Ayoub
    • aschmitz
    • Lucie Anglade
    • Christoph Kepper
    • Jack Lin
    • Rian McGuire

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • KontextWork
    • Maykin Media
    • René Fritz
    • NCC Group
    • Spacinov
    • Nathalie Gutton
    • Andreas Zettl
    • Tom Pohl
    • Kobalt
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    • DeivGuerrero
    Source code(tar.gz)
    Source code(zip)
  • v54.3(Apr 4, 2022)

    Bug fixes

    • #1588 Support position: absolute in footnotes
    • #1586 Fix discarded text-align values

    Contributors

    • aschmitz
    • Guillaume Ayoub

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • KontextWork
    • Maykin Media
    • René Fritz
    • NCC Group
    • Spacinov
    • Nathalie Gutton
    • Andreas Zettl
    • Tom Pohl
    • Kobalt
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    • DeivGuerrero
    Source code(tar.gz)
    Source code(zip)
  • v54.2(Feb 27, 2022)

    Bug fixes

    • #1575: Always store parent blocks children as lists
    • #1574, #1559: Fix float rounding errors
    • #1571: Ignore unknown glyphs
    • #1561, #1562: Fix line break when breaks occur between a nbsp and an inline block
    • #1560: Always set the child index
    • #1558: Fix patterns with use tags

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade
    • Jack Lin
    • aschmitz

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • Crisp BV
    • SimonSoft
    • Menutech
    • KontextWork
    • Maykin Media
    • René Fritz
    • NCC Group
    • Spacinov
    • Nathalie Gutton
    • Andreas Zettl
    • Tom Pohl
    • Kobalt
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    • DeivGuerrero
    Source code(tar.gz)
    Source code(zip)
  • v54.1(Jan 31, 2022)

    Features

    • #1547: Handle break-inside: avoid on tr tags

    Bug fixes

    • #1540, #1239: Handle absolute children in running elements
    • #1538: Handle invalid values in text-align
    • #1536: Handle absolute flex boxes
    Source code(tar.gz)
    Source code(zip)
  • v54.0(Jan 8, 2022)

  • v54.0b1(Dec 13, 2021)

    This version is experimental, don't use it in production. If you find bugs, please report them!

    Dependencies

    • html5lib 1.1+ is now needed.

    New features

    • #1509: Support footnotes, with financial support from Code & Co.
    • #36: Handle parallel flows for floats, absolutes, table-cells
    • #1389: Support text-align-last and text-align-all properties
    • #1434: Draw SVG and PNG emojis
    • #1520: Support overflow-wrap: anywhere
    • #1435: Add environment variable to set DLL folder on Windows

    Performance

    • #1439: Cache SVG use tags
    • #1481: Encode non-JPEG images as PNGs instead of JPEG2000s

    Bug fixes

    • #137: Don’t use text-transform text for content-based uses
    • #1443: Don’t serialize and parse again inline SVG files
    • #607: Correctly handle whitespaces in bookmark labels
    • #1094: Fix column height with column-span content
    • #1473: Fix absolutely positioned boxes in duplicated pages
    • #1491: Fix target-counter attribute in flex items
    • #1515, #1508: Don’t draw empty glyphs
    • #1499: Don’t crash when font size is really small

    Documentation

    • #1519: Fix typo

    Packaging

    • The source package does not include a setup.py file anymore. You can find more information about this in #1410.

    Contirbutors

    • Guillaume Ayoub
    • Lucie Anglade
    • Colin Kinloch
    • aschmitz
    • Pablo González
    • Rian McGuire

    Backers and sponsors

    • Grip Angebotssoftware
    • Manuel Barkhau
    • SimonSoft
    • Menutech
    • KontextWork
    • Crisp BV
    • Maykin Media
    • René Fritz
    • Simon Sapin
    • NCC Group
    • Nathalie Gutton
    • Andreas Zettl
    • Tom Pohl
    • Des images et des mots
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • Gábor
    • Piotr Horzycki
    Source code(tar.gz)
    Source code(zip)
  • v53.4(Nov 14, 2021)

    Bug fixes

    • #1446: Fix background on pages with a bleed property
    • #1455: Use SVG width/height as inner size when no viewBox is given
    • #1469: Only enable letter- and word-spacing when needed
    • #1471: Don’t display inputs with "hidden" type
    • #1485: Allow quotes in url() syntax for SVG, use better approximations for font ascent and descent values in SVG
    • #1486: Fix images embedded from multiple pages
    • #1489: Use a better hash for fonts to avoid collisions
    • abd54c4: Set SVG ratio when width and height are 0

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade

    Backers and sponsors

    • Grip Angebotssoftware
    • SimonSoft
    • Menutech
    • Manuel Barkhau
    • Simon Sapin
    • KontextWork
    • René Fritz
    • Maykin Media
    • NCC Group
    • Crisp BV
    • Des images et des mots
    • Andreas Zettl
    • Nathalie Gutton
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    • G. Allard
    • Gábor
    Source code(tar.gz)
    Source code(zip)
  • v53.3(Sep 10, 2021)

    Bug fixes

    • #1431, #1440: Fix crashes and malformed PDF files
    • #1430: Handle cx and cy in SVG rotations
    • #1436: Fix marker-start being drawn on mid vertices

    Contributors

    • Guillaume Ayoub
    • Rian McGuire
    • Lucie Anglade

    Backers and sponsors

    • Grip Angebotssoftware
    • SimonSoft
    • Menutech
    • Manuel Barkhau
    • Simon Sapin
    • KontextWork
    • René Fritz
    • Maykin Media
    • NCC Group
    • Des images et des mots
    • Andreas Zettl
    • Nathalie Gutton
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    Source code(tar.gz)
    Source code(zip)
  • v53.2(Aug 27, 2021)

    New features

    • #1428: Re-add the make_bookmark_tree() method

    Bug fixes

    • #1429: Fix package deployed on PyPI

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • Grip Angebotssoftware
    • PDF Blocks
    • SimonSoft
    • Menutech
    • Manuel Barkhau
    • Simon Sapin
    • KontextWork
    • René Fritz
    • Maykin Media
    • NCC Group
    • Des images et des mots
    • Andreas Zettl
    • Nathalie Gutton
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    Source code(tar.gz)
    Source code(zip)
  • v53.1(Aug 22, 2021)

    Bug fixes

    • #1409: Don’t crash when leaders are in floats
    • #1414: Embed images once
    • #1417: Fix crash with SVG intrinsic ratio

    Documentation

    • #1420: Remove make_bookmark_tree from documentation
    • #1422: Include weasyprint.tools removal in documentation

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • Grip Angebotssoftware
    • PDF Blocks
    • SimonSoft
    • Menutech
    • Manuel Barkhau
    • Simon Sapin
    • KontextWork
    • René Fritz
    • Maykin Media
    • NCC Group
    • Des images et des mots
    • Andreas Zettl
    • Nathalie Gutton
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • Yanal-Yvez Fargialla
    Source code(tar.gz)
    Source code(zip)
  • v53.0(Jul 31, 2021)

    This version also includes the changes from unstable b1 and b2 versions listed below.

    Dependencies

    • Pango 1.44.0+ is now needed.
    • pydyf 0.0.3+ is now needed.
    • fontTools 4.0.0+ is now needed.
    • html5lib 1.0.1+ is now needed.

    API changes

    • FontConfiguration is now in the weasyprint.text.fonts module.
    • --format and --resolution options have been deprecated, PDF is the only output format supported.
    • --optimize-images option has been deprecated and replaced by --optimize-size, allowing images, fonts, all and none values.
    • weasyprint.tools have been removed.
    • Document.resolve_links, Document.make_bookmark_tree and Document.add_hyperlinks have been removed.

    Performance

    • Improve image management

    New features

    • #1374: Support basic "clipPath" in SVG

    Bug fixes

    • #1369: Render use path in SVG
    • #1370: Fix fill color on use path in SVG
    • #1371: Handle stroke-opacity and fill-opacity
    • #1378: Fix crash with borders whose widths are in em
    • #1394: Fix crash on draw_pattern
    • #880: Handle stacking contexts put in contexts by previous generations
    • #1386: Catch font subsetting errors
    • #1403: Fix how x and y attributes are handled in SVG
    • #1399, #1401: Don’t crash when use tags reference non-existing element
    • #1393: Handle font collections
    • #1408: Handle x and y attributes in use tags

    Documentation

    • #1391, #1405: Add documentation for installation

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade
    • Pelle Bo Regener
    • aschmitz
    • John Jackson
    • Felix Schwarz
    • Syrus Dark
    • Christoph Päper

    Backers and sponsors

    • OpenEdition
    • Grip Angebotssoftware
    • Simonsoft
    • PDF Blocks
    • Menutech
    • Manuel Barkhau
    • print-css.rocks
    • Simon Sapin
    • KontextWork
    • René Fritz
    • Maykin Media
    • Nathalie Gutton
    • Andreas Zettl
    • Tom Pohl
    • NCC Group
    • Moritz Mahringer
    • Florian Demmer
    • Des images et des mots
    • Mohammed Y. Alnajdi
    • Yanal-Yvez Fargialla
    • Yevhenii Hyzyla
    Source code(tar.gz)
    Source code(zip)
  • v53.0b2(May 30, 2021)

    This version is experimental, don't use it in production. If you find bugs, please report them!

    New features

    • #359: Embed full sets of fonts in PDF

    Bug fixes

    • #1345: Fix position of SVG use tags
    • #1346: Handle "stroke-dasharray: none"
    • #1352, #1358: Sort link target identifiers
    • #1357: Fix font information
    • #1362: Handle visibility and display properties in SVG
    • #1365: Cascade inherited attributes for use tags
    • #1366: Correctly handle style attributes in SVG
    • #1367: Include line stroke in box bounding

    Documentation

    • #1341: Fix typos

    Contributors

    • Guillaume Ayoub
    • aschmitz
    • John Jackson
    • Lucie Anglade
    • Pelle Bo Regener

    Backers and sponsors

    • OpenEdition
    • print-css.rocks
    • Simonsoft
    • PDF Blocks
    • Menutech
    • Manuel Barkhau
    • Simon Sapin
    • Grip Angebotssoftware
    • KontextWork
    • René Fritz
    • Nathalie Gutton
    • Andreas Zettl
    • Tom Pohl
    • Maykin Media
    • Moritz Mahringer
    • Florian Demmer
    • Mohammed Y. Alnajdi
    • NCC Group
    • Des images et des mots
    • Yanal-Yvez Fargialla
    • Yevhenii Hyzyla
    Source code(tar.gz)
    Source code(zip)
  • v53.0b1(Apr 22, 2021)

    This version is experimental, don't use it in production. If you find bugs, please report them!

    This version uses its own PDF generator instead of Cairo. Rendering may be different for text, gradients, SVG images…

    New features

    • #1328: Add ISO and JIS paper sizes
    • #1309: Leader support, with financial support from Simonsoft

    Bug fixes

    • #504: Fix rendering bugs with PDF gradients
    • #606: Fix rounding errors on PDF dimensions
    • #1264: Include witdh/height when calculating auto margins of absolute boxes
    • #1191: Don’t try to get an earlier page break between columns
    • #1235: Include padding, border, padding when calculating inline-block width
    • #1199: Fix kerning issues with small fonts

    Documentation

    • #1298: Rewrite documentation

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade
    • Felix Schwarz
    • Syrus Dark
    • Christoph Päper

    Backers and sponsors

    • Simonsoft
    • PDF Blocks
    • Menutech
    • Manuel Barkhau
    • Simon Sapin
    • Nathalie Gutton
    • Andreas Zettl
    • René Fritz
    • Tom Pohl
    • KontextWork
    • Moritz Mahringer
    • Florian Demmer
    • Maykin Media
    • Yanal-Yvez Fargialla
    • Des images et des mots
    • Yevhenii Hyzyla
    Source code(tar.gz)
    Source code(zip)
  • v52.5(Apr 17, 2021)

    Bug fixes

    • #1336: Fix text breaking exception
    • #1318: Fix @font-face rules with Pango 1.48.3+

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • Simonsoft
    • PDF Blocks
    • Menutech
    • Manuel Barkhau
    • Simon Sapin
    • Nathalie Gutton
    • Andreas Zettl
    • René Fritz
    • Tom Pohl
    • KontextWork
    • Moritz Mahringer
    • Florian Demmer
    • Maykin Media
    • Yanal-Yvez Fargialla
    • Des images et des mots
    • Yevhenii Hyzyla
    Source code(tar.gz)
    Source code(zip)
  • v52.4(Mar 11, 2021)

    Bug fixes

    • #1304: Don’t try to draw SVG files with no size
    • ece5f066: Avoid crash on last word detection
    • 4ee42e48: Remove last word before ellipses when hyphenated

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • PDF Blocks
    • Simonsoft
    • Menutech
    • Simon Sapin
    • Manuel Barkhau
    • Andreas Zettl
    • Nathalie Gutton
    • Tom Pohl
    • René Fritz
    • Moritz Mahringer
    • Florian Demmer
    • KontextWork
    • Michele Mostarda
    Source code(tar.gz)
    Source code(zip)
  • v52.3(Mar 2, 2021)

    Bug fixes

    • #1299: Fix imports with url() and quotes

    New features

    • #1300: Add support of line-clamp, with financial support from expert Germany

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade

    Backers and sponsors

    • PDF Blocks
    • Simonsoft
    • Menutech
    • Simon Sapin
    • Manuel Barkhau
    • Andreas Zettl
    • Nathalie Gutton
    • Tom Pohl
    • Moritz Mahringer
    • Florian Demmer
    • KontextWork
    • Michele Mostarda
    Source code(tar.gz)
    Source code(zip)
  • v52.2(Dec 6, 2020)

    Bug fixes

    • #1248: Include missing test data
    • #1254: Top margins removed from children when tables are displayed on multiple pages
    • #1250: Correctly draw borders on the last line of split tables
    • a6f9c80: Add a nice gif to please gdk-pixbuf 2.42.0

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade
    • Felix Schwarz

    Backers and Sponsors

    • PDF Blocks
    • Simonsoft
    • Menutech
    • Simon Sapin
    • Nathalie Gutton
    • Andreas Zetti
    • Tom Pohl
    • Florian Demmer
    • Moritz Mahringer
    Source code(tar.gz)
    Source code(zip)
  • v52.1(Nov 2, 2020)

    Bug fixes

    • 238e214: Fix URL handling with tinycss2

    Contributors

    • Guillaume Ayoub

    Backers and sponsors

    • Simonsoft
    • Simon Sapin
    • Nathalie Gutton
    • Andreas Zettl
    • Florian Demmer
    • Moritz Mahringer
    Source code(tar.gz)
    Source code(zip)
  • v52(Oct 30, 2020)

    Dependencies

    • Python 3.6+ is now needed, Python 3.5 is not supported anymore
    • WeasyPrint now depends on Pillow

    New features

    • #1019: Implement counter-set
    • #1080: Don’t display template tags
    • #1210: Use download attribute in a tags for attachment's filename
    • #1206: Handle strings in list-style-type
    • #1165: Add support for concatenating var() functions in content declarations
    • c56b96b: Add an option to optimize embedded images size, with financial support from Hashbang
    • #969: Add an image cache that can be shared between documents, with financial support from Hashbang

    Bug fixes

    • #1141: Don’t clip page margins on account of body overflow
    • #1000: Don’t apply text-indent twice on inline blocks
    • #1051: Avoid random line breaks
    • #1120: Gather target counters in page margins
    • #1110: Handle most cases for boxes avoiding floats in rtl containers, with financial support from Innovative Software
    • #1111: Fix horizontal position of last rtl line, with financial support from Innovative Software
    • #1114: Fix bug with transparent borders in tables
    • #1146: Don’t gather bookmarks twice for blocks that are displayed on two pages
    • #1237: Use fallback fonts on unsupported WOFF2 and WOFF fonts
    • #1025: Don’t insert the same layout attributes multiple times
    • #1027: Don’t try to break tables after the header or before the footer
    • #1050: Don’t crash on absolute SVG files with no intrinsic size
    • #1204: Fix a crash with a flexbox corner case
    • #1030: Fix frozen builds
    • #1089: Fix Pyinstaller builds
    • #1216: Fix embedded files
    • #1225: Initial support of RTL direction in flexbox layout

    Documentation

    • #1149: Add the --quiet CLI option in the documentation
    • #1061: Update install instructions on Windows

    Tests

    • #1209: Use GitHub Actions instead of Travis

    Contributors

    • Guillaume Ayoub
    • Lucie Anglade
    • Tontyna
    • Mohammed Y. Alnajdi
    • Mike Voets
    • Bjarni Þórisson
    • Balázs Dukai
    • Bart Broere
    • Endalkachew
    • Felix Schwarz
    • Julien Sanchez
    • Konstantin Alekseev
    • Nicolas Hart
    • Nikolaus Schlemm
    • Thomas J. Lampoltshammer
    • mPyth
    • nempoBu4
    • saddy001

    Backers and Sponsors

    • Hashbang
    • Innovative Software
    • Screenbreak
    • Simon Sapin
    • Lisa Warshaw
    • Nathalie Gutton
    • Andreas Zetti
    • Florian Demmer
    • Moritz Mahringer
    Source code(tar.gz)
    Source code(zip)
  • v51(Dec 23, 2019)

    Dependencies

    • Pyphen 0.9.1+ is now needed

    New features

    • #882: Add support of element() and running()
    • #972: Add HTML element to Box class
    • 7a4d6f8: Support larger and smaller values for font-size

    Bug fixes

    • #960: Fix how fonts used for macOS tests are installed
    • #956: Fix various crashes due to line breaking bugs
    • #983: Fix typo in variable name
    • #975: Don’t crash when string-set is set to none
    • #998: Keep font attributes when text lines are modified
    • #1005: Don’t let presentational hints add decorations on tables with no borders
    • #974: Don’t crash on improper var() values
    • #1012: Fix rendering of header and footer for empty tables
    • #1013: Avoid quadratic time relative to tree depth when setting page names
    Source code(tar.gz)
    Source code(zip)
  • v50(Sep 19, 2019)

    New features

    • #209: Make break-* properties work inside tables
    • #661: Make blocks with overflow: auto grow to include floating children

    Bug fixes

    • #945: Don't break pages between a list item and its marker
    • #727: Avoid tables lost between pages
    • #831: Ignore auto margins on flex containers
    • #923: Fix a couple of crashes when splitting a line twice
    • #896: Fix skip stack order when using a reverse flex direction
    Source code(tar.gz)
    Source code(zip)
  • v49(Sep 11, 2019)

    Performance

    • Speed and memory use have been largely improved.

    New features

    • #700: Handle ::marker pseudo-selector
    • 135dc06c: Handle recto and verso parameters for page breaks
    • #907: Provide a clean way to build layout contexts

    Bug fixes

    • #937: Fix rendering of tables with empty lines and rowspans
    • #897: Don't crash when small columns are wrapped in absolute blocks
    • #913: Fix a test about gradient colors
    • #924: Fix title for document with attachments
    • #917: Fix tests with Pango 1.44
    • #919: Fix padding and margin management for column flex boxes
    • #901: Fix width of replaced boxes with no intrinsic width
    • #906: Don't respect table cell width when content doesn't fit
    • #927: Don't use deprecated logger.warn anymore
    • a8662794: Fix margin collapsing between caption and table wrapper
    • 87d9e84f: Avoid infinite loops when rendering columns
    • 789b80e6: Only use in flow children to set columns height
    • 615e298a: Don't include floating elements each time we try to render a column
    • 48d8632e: Avoid not in flow children to compute column height
    • e7c452ce: Fix collapsing margins for columns
    • fb0887cf: Fix crash when using currentColor in gradients
    • f66df067: Don't crash when using ex units in word-spacing in letter-spacing
    • c790ff20: Don't crash when properties needing base URL use var functions
    • d63eac31: Don't crash with object-fit: non images with no intrinsic size

    Documentation

    • #900: Add documentation about semantic versioning
    • #692: Add a snippet about PDF magnification
    • #899: Add .NET wrapper link
    • #893: Fixed wrong nested list comprehension example
    • #902: Add state to the make_bookmark_tree documentation
    • #921: Fix typos in the documentation
    • #328: Add CSS sample for forms
    Source code(tar.gz)
    Source code(zip)
Owner
Kozea
We build open source software that you will love.
Kozea
Simple HTML and PDF document generator for Python - with built-in support for popular data analysis and plotting libraries.

Esparto is a simple HTML and PDF document generator for Python. Its primary use is for generating shareable single page reports with content from popular analytics and data science libraries.

Dom 76 Dec 12, 2022
Converting Html files to pdf using python script, pdfkit module and wkhtmltopdf.

Html-to-pdf-pdfkit-wkhtml- This repository has code for converting local html files and online html resources into pdf. It is an python script which u

Hemachandran P 1 Nov 09, 2021
Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python.

About Zen-Knit: Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python. Inspired fro

Zen Reportz 27 Jul 13, 2022
pikepdf is a Python library for reading and writing PDF files.

A Python library for reading and writing PDF, powered by qpdf

1.6k Jan 03, 2023
PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files.

PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files. It can also add custom data, viewing options, and passwords to PDF files

Matthew Stamy 5k Jan 04, 2023
A tool for certificate PDF generation.

certificate-pdf-generator 获奖证书PDF批量生成工具 | a Tool for certificate PDF generation. ⚠️ 下载前请注意 本项目使用了LFS来存储PDF等大文件。在克隆或下载本仓库前,请先使用apt等包管理器安装git-lfs包。如果已经克

Wanghao Xu 4 Nov 28, 2022
borb is a library for reading, creating and manipulating PDF files in python.

borb is a library for reading, creating and manipulating PDF files in python.

Joris Schellekens 2.9k Jan 01, 2023
Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza.

tratapdf Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza. dependências icc-profiles ghostscript visualizador de PDF

1 Nov 30, 2021
Busca no nome e conteúdo de arquivos PDF no diretório e subdiretórios.

PDF Finder Este script auxilia na pesquisa em pastas com inúmeros arquivos PDF. A pesquisa é feita em todos os arquivos do doretório e subdiretórios.

William Pilger 1 Nov 27, 2021
DietPDF aims at reducing PDF file size while not degrading quality nor losing metadata

DietPDF aims at reducing PDF file size while not degrading quality nor losing metadata

Frédéric BISSON 6 Jul 27, 2022
Compare-pdf - A Flask driven restful API for comparing two PDF files

COMPARE-PDF A Flask driven restful API for comparing two PDF files. Description

Karthikeyan JC 3 Mar 13, 2022
A bulk pdf generator. This application can generate PDFs in bulk by using just one click.

A bulk html pdf generator. This application can generate PDFs in bulk by using just one click. Screenshots Requirements 🧱 Your system must have the f

Aman Nirala 3 Apr 23, 2022
Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface

Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface

1.8k Dec 29, 2022
Scans pdfs for links written in plaintext and checks if they are active or returns an error code.

Scans pdfs for links written in plaintext and checks if they are active or returns an error code. It then generates a report of its findings. Extract references (pdf, url, doi, arxiv) and metadata fr

Marshal Miller 22 Nov 21, 2022
WeasyPrint is a smart solution helping web developers to create PDF documents.

WeasyPrint is a smart solution helping web developers to create PDF documents. It turns simple HTML pages into gorgeous statistical reports, invoices, tickets…

Kozea 5.4k Jan 08, 2023
Auto Convert PDFs to png files in python

This python tool, which is an application of PyMuPDF module, could auto convert PDFs to png files

Bo-Yu 4 Dec 05, 2021
Produce pdf in python backend from simple bootstrap vue frontend and download to browser

vollmacht produce pdf in python backend from simple bootstrap vue frontend and download to browser Frontend in one file with bootstrap-vue (allthough

Otto 1 Nov 08, 2020
An application which enables the users to perform simple yet intriguing PDF operations

AstutePDF A repository containing the GUI for an application which enables the users to perform simple yet intriguing PDF operations. These include, M

Raghav S 5 Jan 22, 2022
Python bindings for MuPDF's rendering library.

PyMuPDF 1.19.3 Release date: December 15, 2021 On PyPI since August 2016: Author Jorj X. McKie, based on original code by Ruikai Liu. Introduction PyM

Jorj X. McKie 0 Nov 03, 2022
Excalibur: A web interface to extract tabular data from PDFs

Excalibur: A web interface to extract tabular data from PDFs Excalibur is a web interface to extract tabular data from PDFs, written in Python 3! It i

1.2k Jan 04, 2023