Plain Text To PNG

Posted by CAB 08, 09-22-2008, 06:33 AM
Hey, does anyone know a piece of code that can transform plain text that's been styled with HTML or CSS into an email? I would like to do this with my email address on different websites to prevent spam bots, any ideas?

Posted by beow, 09-22-2008, 07:06 AM
I'm not sure about proper understanding of your question. You can just make a picture with your email address and place it at your page. If you want to get it from HTML just make it there, open it in your browser, make screenshot, crop it and save it as picture.

Posted by mod_webhosting, 09-22-2008, 07:34 AM
This code will create an image from a given text. There are lots of possibilities to continue with. Alpha blending, saving file to disk instead of sending it to the browser, smart sizing the image, etc.

Posted by nixwebo, 09-22-2008, 08:15 AM
If you are going to go to the trouble of using a code to try to get around spam mail bots, you may try a code that does not include your email address. http://forum.massivelinks.com/showth...6724#post66724 This is a link to a great forum post showing how to do this.

Posted by JustinSmall, 09-22-2008, 09:14 AM
I would use AKKAI's way... It won't be styled via XHTML/CSS, it will be styled via PHP GD... but it's your best bet. php gd: http://us.php.net/gd

Posted by CAB 08, 09-22-2008, 09:44 AM
This code looks like it should do what I want but I don't understand what the 'imagestring' line means in terms of value, and how would I format the next based off CSS. The closest thing to what I want is what Facebook do with their email addresses on profiles, hope that helps.

Posted by vibrokatana, 09-22-2008, 09:57 AM
You wont get CSS styling when drawing images. At least I haven't ever seen anything like that. However you can replicate most of the text styling of CSS.

Posted by CAB 08, 09-22-2008, 12:03 PM
Sorry meant more along the lines that the styling of the original txt is retained and just turned in an image. The article above I will look into soon, thanks.

Posted by mod_webhosting, 09-23-2008, 06:17 AM
If the generic font produced by imagestring function is not satisfactory, you can use imagettftext function instead and use any TrueType font in any size you want and apply styles (italic or bold). I'm afraid I don't use Facebook so don't know how the emails are rendered on the profile pages. Although you can not achieve exactly what you wanted in the first place (seamlessly format text using CSS), I too think using these PHP functions would be your best bet.

Hjälpte svaret dig?

 Skriv ut denna artikeln

Läs även

When blog works forums stops working and viceversa

Posted by sash_007, 03-10-2010, 08:47 PMHello friends, I am having a weird problem my problem is...

How to automaticaly download all files in a folder via FTP?

Posted by viettechorg, 05-07-2007, 03:41 AMHello there, I am having trouble with moving my files...

Question for Nameserver

Posted by tinhnho, 07-16-2007, 11:57 PMHi everyone, I installed DA, and setup my ip...

ereg allow space? Simple for those who understand it

Posted by lexington, 09-21-2008, 10:46 PMI do not think I will ever fully understand ereg, eregi,...

Domain parking with Win2k3 DNS??

Posted by bloodsport, 08-03-2007, 09:47 AMHi, i have about 8 different domains i'd like to point...