mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-05 00:21:15 +03:00
The awesome document factory
1571528da3
cffi.dlopen should use .so.N symlinks instead of .so to make sure we load ABI compatible version of the library and the same library used by the rest of the system. cffi uses `ctypes.util.find_library` to search for libraries and the docs for `find_library` states that "The exact functionality is system dependent." so different system may expect different names for the same library. To overcome that problem we try to load several names until success among these names exact file name with `.so` suffix eg. `libcairo.so` but .so symlink is not always safe to use. Shared library usually consist of two of three files: - libcairo.so.N.M - N.M exact version number - libcairo.so.N - symlink to library.so.N.M with major ABI version - libcairo.so - symlink to library.so.N When -lcairo flag is used linker search for libcairo.so, but when the programm loaded it loads libcairo.so.N where N is the version that it was linked with. Some downsides of .so usage: - .so may point to the wrong ABI version, e.g. we expect libcairo version 2 but libcairo.so points at libcairo.so.1 - usually .so files are shipped with development packages `-dev` in debian and `-devel` in centos and they are just symlinks to the .so.N files. So it safer to search for .so.N files they will exist even if dev package is not installed. - hard symlink .so -> .so.N not always preserved, eg. if we zip them we get two copies of the library and while the rest of the system will use .so.N file we will load .so files that may lead to crash |
||
---|---|---|
docs | ||
weasyprint | ||
.gitignore | ||
.travis.yml | ||
AUTHORS | ||
CODE_OF_CONDUCT.rst | ||
COPYRIGHT | ||
LICENSE | ||
NEWS.rst | ||
README.rst | ||
setup.cfg | ||
setup.py |
========== WeasyPrint ========== **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 and PNG. 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. * Free software: BSD licensed * Python 3.5+ * Website: https://weasyprint.org/ * Documentation: https://weasyprint.readthedocs.io/ * Source code and issue tracker: https://github.com/Kozea/WeasyPrint * Tests: https://travis-ci.org/Kozea/WeasyPrint * Support: https://www.patreon.com/kozea