fpdf

How to choose where to save the PDF file generated (Python and FPDF)

How to choose where to save the PDF file generated (Python and FPDF) Question: I am working on a project that requires this function to save a previous processed text as a PDF. And it has been successful. Though, i want to prompt a "save as…" for the user to pick where can he save …

Total answers: 1

PDF is not saving in locally in flask server

PDF is not saving in locally in flask server Question: im running a script that converts images to a pdf file and saves the pdf locally, it works on my windows machine, but on my flask server they arent saving. here is the code from cmath import e from os import link from pickle import …

Total answers: 1

If conditional from df to write predeterminated text with FPDF

If conditional from df to write predeterminated text with FPDF Question: I’m using FPDF to generate reports with charts so I was thinking about using conditionals to use predeterminated text depending on the results from the df[‘COLUMN’].value_counts() with something like this: This is a df, with multi-index generated using a for with value.counts() for each …

Total answers: 1

How to print Arabic and English text together using Python's fpdf library

How to print Arabic and English text together using Python's fpdf library Question: pdf.multi_cell(w=150, h=5, txt="تمانتمانتمانتمانتم English Letters") "English Letters" is rendered as a row of rectangles in the output: I also tried using arabic_reshaper Example code snippet: import arabic_reshaper from bidi.algorithm import get_display reshaped_text = arabic_reshaper.reshape(text) bidi_text = get_display(reshaped_text) pdf.set_xy(9, 132) pdf.multi_cell(w=150, h=5, txt=bidi_text) …

Total answers: 1

Bangla words are broken while writing in a PDF file

Bangla words are broken while writing in a PDF file Question: I am generating a PDF file from CSV file. While I tried to write BANGLA language it just broke the words. Here is my code: from fpdf import FPDF pdf = FPDF(orientation=’L’, unit=’mm’, format=’A5′) pdf.add_page() pdf.add_font(‘kalpurush’,”,’fileLocation/kalpurush.ttf’, uni=True) pdf.set_font(‘kalpurush’,”,18) pdf.set_xy(10,10) pdf.set_text_color(0, 0, 0) pdf.cell(w = …

Total answers: 1

How to make inline bold text using PyFPDF?

How to make inline bold text using PyFPDF? Question: from fpdf import FPDF pdf1 = FPDF pdf1.multi_cell(0, 5, ‘This is my disclaimer. THESE WORDS NEED TO BE BOLD. These words do not need to be bold.’, 0, 0, ‘L’) pdf1.output(“sample.pdf”) Asked By: vivek || Source Answers: I use fpdf for php and had the same …

Total answers: 2

PyFPDF internal link

PyFPDF internal link Question: How should internal linking be done? I try to link from page 1 to page 2. That works ok. But from page to page 2 doesn’t work. What is wrong. from fpdf import FPDF pdf = FPDF() pdf.add_page() pdf.set_font(‘Arial’, ‘B’, 16) to_page_2 = pdf.add_link() pdf.cell(40, 10, ‘Page 1’, border=1, ln=0, align=”, …

Total answers: 1