Solved

FPDF PDF Generator Help

Posted on 2010-08-25
2
420 Views
Last Modified: 2013-12-13
I am using FPDF to automatically create a PDF.

http://www.fpdf.org/

I need to do the following.

Get the Y axis coordinate then if the position is more than 200mm from the top of the page, add a new page.

$pdf->AddPage();

Can you please help me write this code? Thanks
0
Comment
Question by:petewinter
2 Comments
 
LVL 1

Accepted Solution

by:
mugane earned 500 total points
ID: 33521980

require('fpdf.php');

$pdf=new FPDF('P','mm','letter'); // instantiate with units=mm, paper size=letter (use 'A4' if non-US)

$pdf->AddPage();



// ... your content/loop/whatever here ...

if($pdf->GetY()>200)$pdf->AddPage(); // add page if Y>20cm from top left corner



$pdf->Output();

Open in new window

0
 

Author Closing Comment

by:petewinter
ID: 33522609
Perfect. Many thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now