Questions tagged [fpdf]

A PHP class which allows developers to generate PDF files with pure PHP instead of the PDFlib library.

Home page of FPDF

FPDF is a PHP class which allows developers to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

FPDF has other advantages: high level functions. Here is a list of its main features:

  • Choice of measure unit, page format and margins
  • Page header and footer management
  • Automatic page break
  • Automatic line break and text justification
  • Image support (JPEG, PNG and GIF)
  • Colors
  • Links
  • TrueType, Type1 and encoding support
  • Page compression

FPDF requires no extension (except zlib to activate compression and GD for GIF support). It works with PHP 4 and PHP 5

2301 questions
0
votes
0 answers

Html form data to pdf-Html tags get missing

I have form when i submit form post values should convert to pdf usinf fpdf My function $pdf = new PDF(); $pdf->AddPage(); $pdf->SetFont('Arial', '', 12); $html = ' …
Ezra
  • 247
  • 1
  • 13
0
votes
0 answers

PyFPDF returning blank page - Python 2.7

I'm trying out the PyFPDF library in python 2.7 using Flask. I installed pyFPDF via pip. However, it's not returning a pdf, instead it it's just returning a blank page. I'm not receiving any errors. Am I missing something with the font? I'm just…
Kakedis
  • 172
  • 8
0
votes
1 answer

Generate PDF from php

I have a problem using FPDF for generate PDF File, this is my code foreach($result as $row) { $pdf->Ln(); $pdf->Image("../img/ss/".$row['nama_foto'],10,30,-150); $pdf->Cell(5,150,$row['subject_ticket'],0,0,'L'); …
0
votes
1 answer

PHP FPDF Multiple Multicell height adjusting

Im trying to make the height of my multicell and other cells adjust to the highest height of a multicell. this is what my pdf looks like now using the code below. the only problem is i cannot adjust the description column to align with the highest…
Raymond
  • 137
  • 1
  • 12
0
votes
1 answer

I want to increase a specific column width using fpdf

There are three columns in my query and the first one if overextending. So I want to modify the function Calcwidths such that the second column width decreases. Or modify the entire table such that it adjusts according to the cell content. Please…
spandna28
  • 3
  • 1
0
votes
0 answers

Creating multi column and multi page pdfs with FPDF

I am trying to utilize the FPDF module with Laravel (crabbly/fpdf-laravel) The need is to create a 1+ page 3-column documents. In the essence, I have a list of pairs TERM:DESCRIPTION that I need to output one after another. I am struggling with the…
Andrew
  • 7,619
  • 13
  • 63
  • 117
0
votes
1 answer

how to add dynamically generated qrcodes to pdf for labels using fpdf and pdf_label

I have some records stored on a database. I would like to print them onto some Avery labels. I can use FPDF to create a pdf document. I can use PDF_Label which extends FPDF to easily position the information to align with Avery labels. So far so…
0
votes
1 answer

PHP - preg_match or equivalent on multiple HTML Lines Object to create array

I'm using a piece a code which looks like this (from fpdf to create an array with the html tag attribute as key then the value) //Extract attributes $a2=explode('…
NGWarren
  • 1
  • 1
0
votes
0 answers

FPDF - Line break inside cell with text from SQL

I'm trying to generating a PDF-file with data from SQL with PHP using FPDF. But when I'm trying to make a line breaks with "\n" in the text from the SQL, that just show the text "\n" in the output. If I write the text directly in the MultiCell it…
Gizmo
  • 31
  • 4
0
votes
2 answers

Converting a TXT file to an encrypted PDF file

I am trying to convert a text file(.txt) to an encrypted PDF file but I get an error: TypeError: a bytes-like object is required, not 'str' Inside the text file(.txt) is Chinese text and the code I am using is below: import PyPDF2 from fpdf import…
Leo Hsu
  • 23
  • 3
0
votes
0 answers

How to Split Database Table into Pages in TCPDF

I am making a small PDF generation tool for my client. I am using TCPDF because the we need arabic font to be used in it. I am getting result from database. Now client requirement is 20 result per page. I searched alot on internet. But there is…
Abdullah
  • 175
  • 3
  • 13
0
votes
1 answer

Overwrite FPDF output

I'm using fpdf in php to generate a pdf and output it to a directory. $pdf->Output("/home/file/path/uploads/"."test_pdf.pdf", "F"); If there is already a file at this location called test_pdf.pdf, will fpdf overwrite it? If not, how can I make it?
Alex
  • 19
  • 5
0
votes
2 answers

How to display decimal value in PHP FPDF?

This is my code : $no=1; while($item = mysqli_fetch_array($query)){ $pdf->Cell(10 ,5,$no++,1,0); $pdf->Cell(100 ,5,$item['naran'],1,0); //add thousand separator using number_format function $pdf->Cell(25 ,5,number_format (…
atoy amsal
  • 11
  • 3
0
votes
1 answer

FPDF FPDI How to import a page from different FPDF class?

I have a class that creates a FPDF document. And I would like to include that document in a different FPDF class. // Document/Class 1 $pdf->new MyFirstDocument(); $pdf->output // Document/Class 2 class MySecondDocument extends…
0
votes
1 answer

FPDF add-on "Write-Html-Tables" with multicell support / line breaks in cell

I use the FPDF add-on "write-html-tables". The add-on works really good with HTML tables. http://fpdf.de/downloads/add-ons/write-html-tables.html But I have a problem with line breaks. If the content of a cell is too long, I can't make a line break…
Joe
  • 11
  • 3
Company Name: