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
1
vote
2 answers

How to use PyFPDF data as a PDF without having to export (output) it as a PDF?

I am using PyFPDF to create custom PDF documents automatically when a user registers using my custom-built Django application. The PDFs contain information about that persons registration. For each person that registers, I do not want to save their…
CoopDaddio
  • 577
  • 1
  • 5
  • 20
1
vote
0 answers

Create new pdf with captured .msg file contents

print (msg.SenderName) print (msg.SenderEmailAddress) print (msg.SentOn) print (msg.To) print (msg.CC) print (msg.BCC) print (msg.Subject) print (msg.Body) I am simply trying to take the above, and write the contents into a newly created .PDF…
Dr Upvote
  • 8,023
  • 24
  • 91
  • 204
0
votes
1 answer

FPDF object has no attribute 'epw'

I want to create a table using the 'FPDF' library, but python gives me an error 'CreateTablePDF' object has no attribute 'epw' There is my code: import pathlib from os.path import join from fpdf import FPDF class CreateTablePDF(FPDF): def…
0
votes
2 answers

How to generate and return a PDF file from in-memory buffer using FastAPI?

I generate a PDF file using PyFPDF library and would like to return this in-memory buffer without writing it to local disk. @app.post("/pdf") def generate_report(id_worker: int = Form(...), start_date: date = Form(...), end_date: date =…
Ukhu
  • 19
  • 3
0
votes
0 answers

Is there a way to modify the fpdf output, so the name can be changed according to input by user?

I am writing a program that takes input from a user in a variable called client_name; the method output() of the class FPDF does not allow me to change the file name of the PDF according to the client_name entered. I've got the following code line…
0
votes
1 answer

pyFPDF: autopagebreak causes, that only one row is per page

I am in struggle with FPDF - when I am looping over a dataframe and I want to put in the data in the page, the FPDF adds a new page, when the first page is full, and this is good - but then on the other pages, there are only one row per page,…
Lukas Fürst
  • 81
  • 11
0
votes
1 answer

Calculate the number of rows filled by a string in a multi_cell of the library PyFPDF

I'm using the method multicell() of the class FPDF (library PyFPDF) and, to manage it in my real application, I have to use the method get_string_width(). Description of my code The code below creates a PDF file called multi_cell.pdf. Inside the…
frankfalse
  • 1,553
  • 1
  • 4
  • 17
0
votes
1 answer

FPDF looks for a font at a path I have now removed

On one machine, I created and tested code using FPDF in Python, generating a PDF with custom fonts. Then I used Git to push that code to another machine which doesn't have the fonts. I changed the path to the new font (direct to the .tty file…
Ben Pickering
  • 79
  • 1
  • 10
0
votes
1 answer

Cant place an image at the bottom of a pdf file using fpdf python

I am using Python and I'm trying to place three images that cover the entire page. The last image creats and jumps to the next page, I think beacuse of the 'footer'. How can I disable this footer or overcome it? from PIL import Image from fpdf…
0
votes
0 answers

Create HTML file of a generated PDF file (fpdf2) using Python

I am trying to create an HTML file of a PDF output generated by fpdf2 using Python packages. My code for creating the PDF is the following, which saves the PDF in my local disk: from fpdf import FPDF pdf = FPDF() ####my code for putting content…
Debayan Paul
  • 95
  • 2
  • 9
0
votes
0 answers

How to inline bold a text for a pdf generated with FPDF in Python using a font that supports Unicode UTF-8

I am making a Python script to generate a PDF document with FPDF2, I have a problem when rendering this document, in one of the paragraphs some words and phrases must be in bold, I had managed to solve this problem using multi-cell and activating…
0
votes
0 answers

FPDF referencing old path

I wrote a database form using tkinter and I'm using FPDF to generate labels. I get an errno2 when trying to save the label I just made. The path it is reference is on my lab PC but not the PC I'm running the script from. Knowing this I use…
dsonnen
  • 3
  • 1
0
votes
0 answers

How to write Pandas Dataframe as a table to PDF using fpdf python

I want to create a pdf that contains customized tables. For that I have converted a text file into dataframe using pandas as this text file contains some string and numerical data ( abc = 1234 format). with open(input2_filename,"rt") as ip1: …
0
votes
0 answers

fpdf python converting apostrophe to question mark ,whenever I paste those charater in frontend input box

after pasting any character consisting apostrophe, fpdf converts it to a question mark I research a lot online and I came up with the following solution but it only works when a user is typing this value, but not work when the user paste the…
0
votes
0 answers

how to set indent (with absolute units: px, inch... ) for multicell parapgraph of PyFPDF?

How to set an indent for a paragraph with absolute units which is to be made pdf by PyFPDF lib? When using textwrap as follows indent can't be set with absolute units and indent differs depending on the following paragraph self.thetext =…