I have no experience with PDF generation in PHP at all, but I can make some observations...

1. When dealing with the page size, you're probably dealing with a unit of measurement other than pixels -- my guess is either inches, centimetres or millimetres.

2. Then you have an image, which is measured in pixels.

3. To determine how big that image will be on the PDF, you need to have a resolution (pixels per inch for example) in mind for the image.


Here's some examples:

A 1000x1000px image at 200dpi will be 5 inches square
A 1000x1000px image at 72dpi will be 13 inches square
A 1000x1000px image at 300dpi will be 3.333 inches square

If you're working with millimetres, you'll need to convert from inches to mm.


So, a rough idea of the equation you might need is something like:

printsize(inches) = pixelsize / dotsperinch OR
printsize(mm) = pixelsize / dotspermm


Hope that helps!


Justin



On 30/08/2004, at 12:37 PM, Brent Clements wrote:

I have a pdf class that has a function that allows you to add an image to the pdf your creating. The problem is that the function requires that the height and width of the image be specified in page units. Well I know what the pixel height and width are of my image, how do I convert it over to page units so that the image displays correctly on the pdf?

I just need the equation if you guys can think of one.

THanks
Brent
---
Justin French
http://indent.com.au

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to