irwan
irwan

Reputation: 333

Setting paper size in FPDF

i want to seting paper size in fpdf to a half of letter size, it's approximately 8.5x5.5 inc. How can i do that?
My fpdf function in php language is

$pdf = new FPDF('P','mm','?????');

is there any solution? Thank's before for your help..

Upvotes: 28

Views: 145062

Answers (2)

kuba
kuba

Reputation: 7389

They say it right there in the documentation for the FPDF constructor:

FPDF([string orientation [, string unit [, mixed size]]])

This is the class constructor. It allows to set up the page size, the orientation and the unit of measure used in all methods (except for font sizes). Parameters ...

size

The size used for pages. It can be either one of the following values (case insensitive):

A3 A4 A5 Letter Legal

or an array containing the width and the height (expressed in the unit given by unit).

They even give an example with custom size:

Example with a custom 100x150 mm page size:

$pdf = new FPDF('P','mm',array(100,150));

Upvotes: 72

user1325759
user1325759

Reputation:

/*$mpdf = new mPDF('',    // mode - default ''
 '',    // format - A4, for example, default ''
 0,     // font size - default 0
 '',    // default font family
 15,    // margin_left
 15,    // margin right
 16,     // margin top
 16,    // margin bottom
 9,     // margin header
 9,     // margin footer
 'L');  // L - landscape, P - portrait*/

Upvotes: -1

Related Questions