22 questions
0
votes
1
answer
50
views
How to align adjacent cells to the top when one cell has dynamic multi-line text?
I am generating a real estate liquidation report using fpdf2 in Python. I have a table where one column ("Details") contains long descriptions that wrap into multiple lines using multi_cell.
...
0
votes
1
answer
104
views
fpdf and fpdf2 don't have the table attribute
I'm using version 2.8.4 of fpdf2 and version 1.7.2 of fpdf with python 3.13.6 on Windows 11.
When I run the following code:
from fpdf import FPDF
TABLE_DATA = (
("First name", "...
-1
votes
1
answer
125
views
My fpdf2 PDF is blank when I try to download it from the browser after passing it to the front end
I cannot for the life of me figure out why this PDF won't display. I'm using fpdf2 to create a PDF that looks good when saving it from the Python script. However, something must be going wrong when ...
0
votes
1
answer
57
views
Empty PDF attachment using fpdf2 with boto3 sesv2
I'm facing an issue with empty PDF attachments sent with boto3 SESv2 client using Templated Email type.
I think this is something related to encoding or specific boto3 send_email rules that I'm not ...
1
vote
2
answers
90
views
Sorting axis in pandas plot
How can I sort the axis in descending order? I tried the following and it did not work:
from io import BytesIO
from fpdf import FPDF
import pandas as pd
import matplotlib.pyplot as plt
import io
DATA ...
-3
votes
1
answer
5k
views
Fpdf header and background
I need to create a pdf with header, footer and background color. Tge following code is generating all 3, but it seems the footer is getting behind the pdf rect
from fpdf import FPDF
class PDF(FPDF):
...
1
vote
0
answers
84
views
FPDF2 render_toc spans multiple pages it writes over page headers
Basically if my table of contents exceeds one-page then it the contents of the 2nd page overlaps with the document header.
I tried adding
self.set_y(15)
at the end of the header function. However ...
0
votes
1
answer
238
views
My python code works fine but gives exception after pyinstaller
Traceback (most recent call last):
File "Ish.py", line 1, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
File "...
-1
votes
1
answer
151
views
How get PDF/A compliance with fpdf2
I am able to generate a pdf with fpdf2 but I want it to show up with the PDF/A compliance tag in Adobe Acrobat Reader. Basically i want the below text to appear when the PDF is opened.
Do I need to ...
0
votes
1
answer
92
views
Delimit max width of write_html() function FPDF2
How to set max width of a write_html()? I have a string with html tags and i need print the text formatted inside of a rectangle background. But the texts leak to the edge of the page.
How can i ...
-1
votes
1
answer
301
views
Can't set X axis for pdf.table position FPDF2
I can't set X axis position for display pdf.table, only Y axis works using set_y(). When i use set_x() nothing happens or set_xy() only Y axis parameter works.
Theres a way to position a table in any ...
0
votes
1
answer
271
views
FPDF2 Template multiline space between text like a newline
If I'm using a FlexTemplate and feed multiline text into it. It displays the lines like it does a newline between each line break.
I tried the same text content with a normal multi_cell() and it is ...
0
votes
0
answers
249
views
How to fix: Unsupported font file extension: {ext}. add_font() used to accept .pkl file as input, but for security reasons
I have a python google cloud function that should create a pdf when triggered, but the code seems to breakdown, seemingly because of the font, see below.
I tested the workflow with my local ...
0
votes
1
answer
212
views
FPDF2 breaking url links that span multiple lines
When I convert text documents to pdfs in Python using the FPDF2 library it breaks apart urls that span multiple lines by adding a space or a newline (I'm not sure which one).
I use the following code ...
1
vote
1
answer
538
views
FPDF2 issue importing svg with text
I have a problem to load the SVG (created by QBill) to the FPDF2 library. The shapes are adopted without any problems, but the text is missing everywhere from the SVG. Here is the code:
import fpdf
...