Skip to main content

How do I get the width and height of a doc generated with FPDF



How can I get height and width of a document in FPDF.





For example, I've next line:







$this->Cell(200,5,'ATHLETIC DE COLOMBIA S.A.',1,1,'C',1);







But, I want to do something like:







// $x = width of page

$this->Cell($x,5,'ATHLETIC DE COLOMBIA S.A.',1,1,'C',1);




Comments

  1. As far as I remember you can't do it with vanilla FPDF. You can either extend it to have a method that would return this value for you, or just store the width as a public property of fpdf object.

    ReplyDelete

Post a Comment

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.