Archive for the ‘Web Programming’ Category

How to convert from pixels to millimeters

Wednesday, July 2nd, 2008

I am working with PHP and FPDF to generate a PDF invoice. The designers have created a couple of very helpful documents, there are three total. The first is a mockup of the invoice. The second shows fonts, font sizes, and font colors. The last document show the positioning of all elements on the invoice. My only problem, is that the document was made with pixels at a resolution of 300 DPI rather than in millimeters. Anyone that is familiar with FPDF will know that PDF’s created with FPDF can not be generated with pixels in mind. PDF documents in FPDF can only use point (pt), millimeteres (mm), centimeters (cm), or inches (in). (more…)

Rounding to the nearest half dollor (or quarter dollar)

Wednesday, June 18th, 2008

One of my recent projects required that I round the price I was calculating to the nearest half dollar. This started out at a pain. Rounding to the floor, or to the ceiling, or normal rounding is quite easy. But I have never had to round to the nearest half dollar. (or quarter dollar) After a little bit of time thinking about it, I came up with a solution. (more…)

Microsoft AlphaImageLoader crashing IE 6

Tuesday, May 20th, 2008

I’ve been developing a website for a local group that supports the arts (www.scera.org). The client called my place of work and mentioned that some of their users were having difficulties with IE 6 locking up. After spending several hours on the issue, I discovered that Microsoft has a bug, that causes the filter to no work properly when the images are preloaded. So to fix this issue I had to do the following: (more…)


Switch to our mobile site