Solved

FPDF PDF Generator Help

Posted on 2010-08-25
2
427 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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…
The viewer will learn how to count occurrences of each item in an array.

828 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