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
1 answer

FPDF variable row height for mysql report

I want to use FPDF for repots from database. $srg=mysql_query("select * from musteriler order by olusturmatarih"); $sira=0; while($m=mysql_fetch_assoc($srg)){ $sira++; …
sipdorus
  • 963
  • 1
  • 12
  • 28
0
votes
0 answers

FPDF error Missing or incorrect image file

I am using this code to take an image as input and print it on a pdf using FPDF but I am getting error while adding any image format like jpeg,jpg,png,gif. Error: Warning: getimagesize(arc.jpg): failed to open stream: No such file or directory in…
0
votes
1 answer

Search PDF for strings and get their position on the page

I would like to add nameddests to locations of an existing PDF which are specified by some string (say: put a nameddest on the first occurence of the string "Chapter 1"). Then I would like to be able to jump to those nameddests using JS events. What…
Photon
  • 287
  • 1
  • 2
  • 11
0
votes
2 answers

ExtJS: Get file from Ajax post request response

I try to make a way to generate pdf files from my extjs application. When my export button is clicked this Ajax request is fired Ext.Ajax.request({ url: 'data/apppdf.php?class=Export&action=composerCSV', method: 'POST', timeout:…
RomAZE
  • 27
  • 2
  • 12
0
votes
0 answers

FPDF autosize cells

I use FPDF to make a pdf document which will contain the data I want to export. I have an array of strings with sometime long ones $columns = array( "Traitement", "Nom / Référence", "Date de création", "Date…
RomAZE
  • 27
  • 2
  • 12
0
votes
0 answers

PHP FPDF output with F option

I am using the FPDF and FPDM classes. I have built a pretty large application form which when submitted the data is taken and pushed to a PDF. $fields = array(); foreach ($_SESSION['arr'] as $key => $val){ $fields[$key] = $val; } $pdf = new…
Kyle
  • 667
  • 6
  • 28
0
votes
1 answer

Creating an FPDF to then send via PHPMailer or Print

So I'm trying to create a PDF invoice for a garage and I have the below currently (I know the variables are missing but they had personnel info in for the testing on localhost as well as some of the blank text in cells). So anyway a few things! I…
Mattex
  • 11
  • 3
0
votes
1 answer

Cannot save PDF to a folder on server using FPDF

I have successfully created a PDF document using FPDF but cannot get it to save to a folder on the server. I am able to output the PDF document to the browser. I have also allowed permission to write to this folder…
eddy123
  • 43
  • 11
0
votes
1 answer

FPDI Template not found error

I'm trying to apply a watermark to an existing pdf using FPDI library, which is included in my project using composer package "setasign\fpdi-fpdf". Everytime I run the script I get "Template not Found" Exception. Here is the code: $pdf =…
user3101803
  • 35
  • 1
  • 7
0
votes
1 answer

how to display data in a table column using fpdf

My piece of code is: for ( $i=2060; $i< $FINAL; $i++ ) { $pdf->Cell( 36, 12, ( '05/' .number_format( $dataRow[$i] ) ), 1, 0, 'C', $fill ); } expected pdf output as a column of cells using fpdf is: 05/2060 05/2061 05/2062 05/2063 05/2064 please…
0
votes
1 answer

ODBC_result_all bad print

I'm actually working on a database SQL Server on Windows. I access it with ODBC in PHP. I use FPDF because I want to print mySQL answer on a PDF who's generate when I launch my code. That's a bit of my code: $rs=odbc_exec ($connection,…
Romain
  • 5
  • 7
0
votes
1 answer

Can I use less isset lines to loop through array keys?

Is there a way to "DRY" (don't repeat yourself) this code, or do I need all these "isset" lines? I have lots of items to process just like this one, only IF they are selected. I am using FPDF. I would really like to shorten the processor code if…
Bigfootbud
  • 103
  • 1
  • 10
0
votes
1 answer

Undefined variable: pdf in FPDF

$query = mysqli_query($con,"select * from s_users where s_id = '".$_GET['s_id']."'"); $row = mysqli_fetch_array($query); if ($row['status'] == 1) { //1 $pdf = new PDF_Code128('P','mm','A4'); $pdf->AddPage(); …
mike
  • 21
  • 5
0
votes
1 answer

fpdf: multiple dynamic links with dynamic varnames

I've been playing with fpdf for a few days, it's nice :) But I'm now trying to code something a little more advanced: Simple links with AddLink and SetLink is ok, but if I try to do the same into a foreach loop: //Page2: $index=0; foreach…
Pim92
  • 99
  • 1
  • 5
  • 15
0
votes
0 answers

FPDF + FPDI together?

I am using FPDF to generate PDF contracts, however people in office often forgets to print ToS file with them and they want me to add ToS into every contract, but when I try to use both FPDF and FPDI it shows me err 500, I've never worked with those…
S. Lucas
  • 1
  • 4
1 2 3
99
100