This looks like a go. Imagemagic will convert ps files and resize them for you. Imagemagic can be run from a shell call or from PHP.
"man convert" will get you started. Something like: convert -size 250x200 input-file.ps output-file.png The output file can be almost any format you can think of. On Fri, 27 Feb 2009 11:39:56 +1300 Came this utterance formulated by Aaron Cooper to my mailbox: > Thanks Aaron, > > I did think of this class too, but decided to leave it as a last > resort as I was sure there was an easier way. I might have to hit this > now as the online services are either too slow, or simply don't seem > to work. > > Cheers > Aaron > ----- Original Message ----- > From: Aaron Fulton > To: [email protected] > Sent: Friday, February 27, 2009 12:01 PM > Subject: [phpug] Re: HTML (URL) to Image > > > Hi Aaron > > I've played with html2pdf/html2ps > (http://www.tufat.com/s_html2ps_html2pdf.htm) It does quite a good > job at rendering the html correctly. You might be able to craft > this pdf or ps into a jpg. > > > regards > > Aaron > > Aaron Cooper wrote: > Howdy all, > > I really don't think this will be possible with PHP without some > server-side software additions but just checking to see if there > are other methods or if someone has done something similar. > > We have a email marketing system, where we load HTML email > templates into customer accounts. This HTML code is stored in the > DB and loaded into a WYSIWYG editor for each mail out. > > At the moment, we take screenshots of parsed output for this HTML, > resize in PS, and load into the system so that our users can see a > thumbnail snapshot of their HTML template when they are selecting > which template to use for a campaign. > > It's getting to the stage that we are adding a template a day and > this is becoming a bit tedious, and now have a need to automate > the thumbnail generation process if possible. > > The ideal situation is for us to: > 1. Click a button to generate thumbnail after loading the template > HTML 2. A script (or external service) is given the URL to the > HTML output page on the server, with the template ID. This will > simply output and render the HTML in the DB. 3. Script takes > snapshot of HTML 4. Resize snapshot to suit interface (250x200) > 5. Saves thumbnail to a statically named directory, with a > dynamically named filename. > > I assume that this is going to require a browser on the server. > We're running on Debian here (shell only), and I'm no *Nix guru > either. > > Thoughts? > > Aaron > > > > --------------------------------------------------------------------- > ------- > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.0.237 / Virus Database: 270.11.3/1974 - Release Date: > 02/26/09 14:51:00 > > > > > > > -- Michael All shall be well, and all shall be well, and all manner of things shall be well - Julian of Norwich 1342 - 1416 --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
