Django-Weasyprint image issue

As it says in the docs page, I defined a img tag in my html file as follows: <img src='{% static 'image.png' %}'/> This url exists in the server and I even made a different view with a http...

Django WeasyPrint CSS integration warning: Relative URI reference without a base URI: <link href="/static/css/bootstrap.min.css"> at line None

I want to generate reports using WeasyPrint in Django. But I don't know how to integrate the css (specifically the bootstrap css file). I am able to see the generated html. But I get a warning...

Getting the Base URI for Weasyprint in Python

I'm using the Weasyprint library for Python in an attempt to print out an html file to pdf. I am attempting to embed an image into the background of my page. Here is the code: HTML(string=''' ...

TypeError: parse() got an unexpected keyword argument 'override_encoding'

Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from weasyprint import HTML >>>...

attach img file in pdf weasyprint

I need help with attaching img file in pdfs. We use the WeasyPrint lib for generating pdf from html. in html connect img file like this <img src="1.png" alt=""> <img src="2.png" alt=""> <img...

Openshift 3 - Installing dependency from s2i/bin/assemble

I have the following file in the directory for my Openshift project which uses s2i to create a build image. This script attempts to install the cairo package. .s2i/bin/assemble #!/bin/bash echo...

PDF output using Weasyprint not showing images (Django)

I am trying to output PDF on Django using the Weasyprint library, but the images don't appear on the generated PDF. I have tried both relative and static URLs for the images, but even the static...

Generate PDF from html template and send via Email in Django

I'm trying to generate a pdf file from an HTML template using Weasyprint python package and I need to send it via email using. Here's what i have tried: def send_pdf(request): minutes =...

HTML to PDF on Google AppEngine

We're currently trying to convert html files to PDF on AppEngine using Python. The HTML files are from a third-party vendor so we have no control over their format. Both the Flexible and Standard...

jinja2 and weasyprint path to image

My code convert the jinja2 template into PDF using weasyprint. Everything work fine except I can't get the image to appear in the PDF. My files...

How to use Weasyprint with AWS Lambda? (Django & Zappa)

I have a simple Django app which has been pushed to AWS Lambda using Zappa. This process has worked properly, with one exception : cannot load library 'pango-1.0': pango-1.0: cannot open shared...

Weasyprint get undefined property at invoking write_pdf: "AttributeError: 'PosixPath' object has no attribute 'read_text'"

I'm running weasyprint project on ubuntu 18.04 and I try to create a a pdf. The problem started when I try to set a footer image. I'm running on python 3.6.7 This is my code invoking...

Python not resolving host (timed out) when running with Gunicorn inside a Docker container (weasyprint needs to do that)

I have a Django app running in a docker container, which serves the app using Gunicorn. This app uses Weasyprint to generate a PDF, which loads a CSS dynamically. This CSS is served by the app,...

Django HTML & CSS render to pdf

I'm trying to convert HTML & CSS into a pdf page using Django-weasyprint but I'm kind of stuck with their tutorial because I want the PDF to render the current page when the user clicks on the...

resolve pipenv install weasyprint error in Docker

I'm using Alpine linux for my Docker setup. Here is the Dockerfile. # pull official base image FROM python:3.7.4-alpine # set work directory WORKDIR /usr/src/app # set environment variables ENV...

Problems with weasyprint installation on windows 10

I am trying to install weasyprint, my set up is: Operating System: Windows 10 Pro 64-bit Python 3.8.2 32-bit I followed the official installation guide...

Weasyprint cant load images when rendering html string

I am working on weasyprint library with python, scenario is i wrote a simple function which first renders html template to html_string with dynamic data and a logo then i am converting that...

How to send waysiprint pdf by mail

I'm trying to generate a pdf file from an HTML template using Weasyprint python package and I need to send it via email using. Here's what i have tried: views.py : user_info = { ...

'utf8' codec can't decode byte 0xb5 in position 0: invalid start byte error

I am trying to create a pdf file from an html with the WeasyPrint library, I am following this tutorial: https://www.bedjango.com/blog/how-generate-pdf-django-weasyprint/ But is giving the error...

Print Barcode in PDF with Django

I am using render_to_string in django for parse an HTML and export to PDF. html = render_to_string("etiquetaTNT.html", { 'context': context, 'barcode': b, 'barcodeimg':...

OSError: cannot load library 'gobject-2.0': error 0x7e

I installed the package weasyprint according to the instructions Installing weasyprint (Django project). My system: win 10. I have installed gtk3 and it is present in my PATH import...

Weasyprint and CSS: header, footer, pagebreak and positioning

I am building a invoice report template in html and using Weasyprint to generate it as a PDF(and as a docx eventually) The issue I'm having is in the inability to not only page-break, but to also...

Trouble installing turbodbc

I am attempting to install turbodbc on my Ubuntu 20.10 machine. My specs are as follows: pip 20.2.4, Python 3.8.5 , gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0 I have attempted the solutions provided in...

How to get rid of cryptography build error?

I am trying to build a dockerfile but the problem is when it trying to build specifically cryptography is not building. MY Dockerfile FROM python:3.7-alpine ENV PYTHONUNBUFFERED 1 RUN apk update...

Weasyprint printing corrupt pdfs

I am trying to create a pdf using WeasyPrint on windows 10. It corrupts the css in the generated pdf, as shown in the image below. It is also not able to render images correctly and doesnt open in...

Conflicting with version dependencies when running pip install

Having issues with version dependencies when running pip install on docker. However, when installing on my mac without docker and just virtualenv, works perfectly fine. These are the versions I...

In PDF, font-face appears to be loading from URL, but is not displayed

My Django app uses WeasyPrint to generate PDFs on demand. I am using WeasyPrint 52.4 and Django 3.2. I have been using system fonts, which has been working great. Now I'm trying to use local...

ModuleNotFoundError: No module named 'weasyprint'

I have installed WeasyPrint==0.42.3, but when I try to import it in Django, it raises the following error: ModuleNotFoundError: No module named 'weasyprint' When I look at the requirements.txt,...

how to solve weasyprint error message gobject-2.0-0 error 0x7e message?

I installed several files based upon `https://pbpython.com/pdf-reports.htm to create reports. However the following error messages Traceback (most recent call last): File...

gobject-2.0-0 not able to load on macbook

I am facing this error when I start my flask python3 application on mac. OSError: cannot load library 'gobject-2.0-0': dlopen(gobject-2.0-0, 2): image not found. Additionally,...

Relevant tags