Add text to Existing PDF using Python

I need to add some extra text to an existing PDF using Python, what is the best way to go about this and what extra modules will I need to install. Note: Ideally I would like to be able to run...

Python Reportlab Area under multiple lines graph

So I have started a project for the web utilizing Reportlab. The website needs to generate PDFs that have embedded charts. So far I've been extremely happy with Reportlab's capabilities (i've done...

Convert plain text to PDF in Python

For my project, I get a plain text file (report.txt) from another program. It is all formatted in plain text. If you open it in Notepad, it looks nice (as much as a plain text file can). When I...

Django AttributeError: 'str' object has no attribute '_default_manager'

The following error seems to occur randomly on my live server (i.e. through apache mod_wsgi) but never in development (i.e. localhost python manage.py runserver). Note this happens infrequently...

Multiple tables (5) on one page using ReportLab

I have the following code in Python to generate two tables using ReportLab. Is there a way to position these two tables side by side using ReportLab? from reportlab.lib import colors from...

Insert image into Reportlab either from PIL image or StringIO

I'm trying to insert a barcode image into Reportlab. I know there are a lot of questions asked on this, but all of them assume that you already have the image file in the directory or on the...

How to install pango for Python on Windows?

Since ReportLab does not support Python 3 I am now attempting to generate PDF with cairo, which works but lacks text-wrapping support. The next step seems to require pango and its Python-bindings,...

PDF, Django, qr-ode, reportlab

I use python-qrcode and reportlab, I want to generate a qrcode and display it without saving it as an image. def member_card(request): response = HttpResponse(content_type='application/pdf') ...

Python reportlab inserting image into table

In the reportlab user guide (page79), this is how the images are inserted into the table. I = Image('../images/replogo.gif') I.drawHeight = 1.25*inch*I.drawHeight / I.drawWidth I.drawWidth =...

How to resize column to content in ReportLab?

I am working in python using ReportLab. I need to generate report in PDF format. The data is retrieving from the database and insert into table. Here is simple code: from reportlab.lib import...

python reportlab barcode code128 size

i want to create a label (57*32mm) with a code128 barcode. Its all fine but the barcode is to small =( How can i make this barcode bigger ? from reportlab.graphics.barcode import code128 from...

python Reportlab two items in the same row on a Paragraph

I would like to align two text in the same row, on the left and on the right: TEXT1 TEXT2 and in the same line left align an image and center a text: IMAGE ...

How can I recreate my conda environment using yml file?

My conda export was done like this: conda env export --file environment.yml -n djangoenv The file itself looks like this: name: djangoenv channels: - bioconda - anaconda-cluster -...

PyPDF2 write doesn't work on some PDF files (Python 3.5.1)

First of all I am using Python 3.5.1 (32 bit version) I wrote the following program to add a pagenumber on all pages of my pdf files using PyPDF2 and reportlab: #import modules from os import...

pip3 install not working - No module named 'pip._vendor.pkg_resources'

When trying to install a package for Python 3 (in Ubuntu), using pip3 install packageName (or sudo pip3 install packageName), I get the following error message: Traceback (most recent call last): ...

ImportError: No module named 'config.settings'; 'config' is not a package

I'm trying to get my cookiecutter-django app running under Apache with mod_wsgi installed via pip. python3 manager.py runserver works. But after running it in Apache, I got an error saying Module...

Python ReportLab Paragraph Count Lines Printed

Is there any way that I can get the number of lines for a Flowable Paragraph in reportlab? I have a very long string printed in different sizes and fonts. I need to know how many lines is utilized...

PyInstaller win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryExW', 'The system cannot find the file specified.')

While using PyInstaller (dev version 4.0.dev0+8196c57ab), produced an OSError: [WinError 2] 'The system cannot find the file specified.' Python version: 3.7 GUI: PySide2 5.13.0 Other packages:...

Reportlab install: need Pillow. Pillow install: need zlib. Zlib install: file not found

Relevant details: Windows 8 Python 2.7 and 3.7 installed. I'm trying to migrate from 2.7 to 3.7, starting by making sure I have every package I use installed for 3.7 IDE is PyCharm. I tried...

Error with Pillow library when dockerinzing Django app

I develop Django apps in Windows environnement and deploy my apps in production in Linux server. Python 3.8.3 I have a Django project that works (in dev and prod) and I try to "dockerize" it but I...

How to activate virtual envirooment for existing django project using pipenv in python 3.8

I developed a Django webapp project using Django 2.2.1 in python 3.7.2 in a pipenv version 2018.11.26 virtual environment in MacBook Air. After an unintentional update to python 3.8 using brew...

setting default printer custom page size with python

At the organization I work for, different printers are set up at various locations. All are mainly used to print A4-sized documents, so the defaults are set up accordingly. We are also using a...

Generating PDF documents from large text files using Python's ReportLab package is slow

I have a very large number of text files that I need to convert to PDFs (using Python 3.8.5), and then separate the content by page breaks. The page breaks are encoded in these text files as form...

Python Reportlab divide table to fit into different pages

I am trying to build a schedule planner, in a PDF file generated with ReportLab. The schedule will have a different rows depending on the hour of the day: starting with 8:00 a.m., 8:15 a.m., 8:30...

Error when running executable generated by pyinstaller [pyvisa-py]

I'm trying to build an executable from a simple python script using pyvisa-py but I'm running into error after I run the executable generated by pyinstaller. Here what my small python code looks...

How to draw a shape inside a pdf with python?

I would like to draw a shape such as a rectangle inside pdf. I have tried with the below code, but it is adding a text in pdf. How can I draw it? # Add text to Existing PDF using Python from...

Linux Mint Cinnamon error opening settings (No module named 'PIL')

since I updated Cinnamon to 5.0.6 I can't access any entry under 'Preferences', nothing happens. When I try to open from CLI I have the following : #> cinnamon-settings No module named 'PIL' I...

Symbol not found in flat namespace '_FT_Done_Face' from reportlab with [email protected] on macOS 12

I have a django project using easy-thumbnail as a dependency. Installing all packages with pip is working as expected, but when I try to run my app I get this error: Invalid template library...

pycharm error happening at random time: Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

I am working with pycharm community on a tensorflow model with keras backend, sometimes this error appears in a random time, specially after I call pyplot and close the window: Exception ignored...

Why can't Python 3 virtualenv find some installed packages?

I am working with a Python virtualenv named env to execute Odoo. In the virtualenv bin directory, I got this: pip pip3 pip3.8 python -> /usr/bin/python3 python3 -> python python3.8 ->...