Questions tagged [pyfpdf]

PyFPDF is a library for PDF document generation under Python, ported from PHP (see FPDF: "Free"-PDF, a well-known PDFlib-extension replacement.

90 questions
0
votes
1 answer

How do I use a font to recognize WhatsApp letters and icons?

I'm using fpdf2 for python (pyfpdf) and I have a problem to show some whatsapp characters in my pdf. It would be great if I could use the whatsapp .ttf file but I don't know the name or even if it exists I show my code here from fpdf import…
0
votes
1 answer

Mute python fpdf.multi_cell in console

There's code part like: for j, row in enumerate(data): for datum in row: line_height = lh_list[j] # choose right height for current row if datum is row[0]: pdf.set_font("Times", 'B', size=8) …
0
votes
1 answer

How to save subplot as PDF using FPDF and Streamlit

I have a subplot that I want to save in a PDF. I am trying to do this inside a Streamlit app and to create the PDF I am using FPDF library. The subplot is working without any problems. The problem is that I can't save it as PDF because an error is…
Tiago
  • 15
  • 4
0
votes
0 answers

Pyfpdf euro Character in Python

It seems that its not possible to write the euro symbol with pyfpdf. I really need to add the euro symbol to my report as I'm working with prices. I'm getting the following error and I don't know how to solve it : "UnicodeEncodeError: 'latin-1'…
Denhag
  • 7
  • 2
0
votes
1 answer

Can't add custom font to python with fpdf on linux

I developed a software on my windows machine with fpdf2 for python. It worked perfectly, but now I have to install this program on a Red Hat Linux server and when I try to add custom font to pdf it throws an error: cannot instantiate 'WindowsPath'…
Eqzt111
  • 487
  • 6
  • 17
0
votes
1 answer

Is there a way to fill up a (multi)cell's remaining space with dots using pyfpdf2?

I'm currently working on a Django project in which the client needs to print reports where remaining spaces are filled up with dots up to the end of the line dynamically. I'm using the PyFpdf2 library for PDF reports. The outputs should look like…
Abdoulaye
  • 23
  • 3
0
votes
1 answer

PYFPDF: Adjust cell height with a multicell

i have a problem for adjust the height of cell depending on height of multicell, this multicell changes its height by the number of words and width.My code that I am testing is the following. datos = ["hola","Esto es el texto que determina el…
0
votes
1 answer

Python fpdf is not giving correct output

When using fpdf module, problem is with usage of special characters like 'ć,č,š,đ,ž... I tried simple code like this: from fpdf import FPDF pdf = FPDF() pdf.add_page() pdf.set_font("Arial", size=15) f = open("data.txt", "r") for x in f: …
Thyrus
  • 458
  • 2
  • 13
0
votes
1 answer

Default permissions for files that are automatically created in a Linux directory

I have a problem with an application developed in python using the django framework, it uses the FPDF library to export a file which is then used by the application to attach it to an automated email. When this app exports the PDF and saves it to…
0
votes
1 answer

My python program can't find the path to insert a .ttf

I am using the FPDF library in python to create a report, it contains the Arial font, and it needs a .ttf to work correctly when generating the report. pdf = PDF(orientation = 'L', unit = 'mm', format = 'A4') pdf.add_font('Arial', '',…
0
votes
1 answer

PDF data stream with python

Context: My code fetches a set of coordinates from some png documents and later on performs some redaction in certain fields (it uses these coordinates for drawing rectangles in certain areas). I want my final output to be a pdf with each redacted…
Andoni
  • 89
  • 10
0
votes
1 answer

Adding pdf page for each record in dataframe. Python PDF reporting

I trying to iterate through pandas table and add PDF page for each row using FPDF library. The script only adds the very last record in the table and generates one page. I'm trying to figure out how to add a page for each record import pandas as…
0
votes
1 answer

How to use superscript characters (Latex?) with fpdf2 python?

I hope you are well. I'm trying to write the following to a pdf using the fpdf2 library: GHI (kWh $m^-2 day^{-1}$) But I'm not getting the expected result, the text is written in the pdf in the same way as the code, that is: GHI (kWh $m^-2…
0
votes
0 answers

Inherited FPDF class (python) just gets the first page of two correct, second goes all white

I am constructing a class to produce automated pdf reports. (Using FPDF) In my class I have so far defined two functions. One that renders the first page(front) and one that renders a second page(page_two). These two functions produces each what I…
Henri
  • 1,077
  • 10
  • 24
0
votes
1 answer

Testcomplete: how to get captured screenshot from 'Picture' panel in logs

I'm generating own log export to pdf by using fpdf. I'm trying to get captured screenshot after click from 'Picture' panel in 'Test Log'. I could get name and status from 'Log Items'. I've tried to check 'Picture' panel's DataType, but it returns…
Areke
  • 56
  • 1
  • 7