Create 100+ Buttons from Text-Database

AS
Posted By
Adrian Schmitt
Sep 25, 2006
Views
799
Replies
4
Status
Closed
Hi,

I have a database with more than 100 text-entries (and they keep changing) and I would like to generate buttones from an existing empty jpg-button with the texts printed centered on them and named the files according to the text-entries.

How can I e.g. import lines from a text-file and print each line on the button-template and save it under the according name? I know something about ps-batch-programming but not how to handle the text-issue. I have found quite a lot buttonmaker-tools or photoshop tutorials, but not with this functionality.

If not possible in photoshop I would be very interested in a free windows tool for the same functionality. (Printing text from a list onto a graphical button template and name the resulting image-files accordingly)

Any help is highly appreciated
Thank You 🙂
Adrian

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

S
Stephen
Sep 25, 2006
On 25 Sep 2006 02:41:25 -0700, Adrian Schmitt in
comp.graphics.apps.photoshop wrote:

Hi,

I have a database with more than 100 text-entries (and they keep changing) and I would like to generate buttones from an existing empty jpg-button with the texts printed centered on them and named the files according to the text-entries.

How can I e.g. import lines from a text-file and print each line on the button-template and save it under the according name? I know something about ps-batch-programming but not how to handle the text-issue. I have found quite a lot buttonmaker-tools or photoshop tutorials, but not with this functionality.

Is this for the web ? If so, I’d do this dynamically and forget about using Photoshop for that type of work.

There are some image libraries available in PHP (ASP.NET and ColdFusion have their own I’m sure) that will do this as a trivial task. Look at ImageMagick(1), it comes with excellent documentation(2).

(1)<http://www.imagemagick.org/script/index.php>
(2)<http://www.cit.gu.edu.au/~anthony/graphics/imagick6/>

HTH
K
Kingdom
Sep 25, 2006
"Adrian Schmitt" wrote in
news::

Hi,

I have a database with more than 100 text-entries (and they keep changing) and I would like to generate buttones from an existing empty jpg-button with the texts printed centered on them and named the files according to the text-entries.

How can I e.g. import lines from a text-file and print each line on
the
button-template and save it under the according name? I know something about ps-batch-programming but not how to handle the text-issue. I
have
found quite a lot buttonmaker-tools or photoshop tutorials, but not with this functionality.

If not possible in photoshop I would be very interested in a free windows tool for the same functionality. (Printing text from a list onto a graphical button template and name the resulting image-files accordingly)

Any help is highly appreciated
Thank You 🙂
Adrian

Its very probably possible using scripts but you will need to investigate further unless anyone here has more script info.

here is a starter
http://www.photoshopsupport.com/tutorials/jennifer/photoshop – scripts.html


———————————————————— ———— Learning is not attained by chance, it must be sought for with ardor and attended to with diligence.
———————————————————— ————
J
j
Sep 26, 2006
Adrian Schmitt wrote:
Hi,

I have a database with more than 100 text-entries (and they keep changing) and I would like to generate buttones from an existing empty jpg-button with the texts printed centered on them and named the files according to the text-entries.

That’s something Photoshop CS2 does, and so does earlier versions of ImageReady. Look into Data-Driven graphics.

I put up a couple posts about it here last year.
AS
Adrian Schmitt
Oct 18, 2006
Adrian Schmitt wrote:
Hi,

I have a database with more than 100 text-entries (and they keep changing) and I would like to generate buttones from an existing empty jpg-button with the texts printed centered on them and named the files

Thank you for the answers, "Kingdom" and "j". In the end I gave up and solved it on the web server.

The buttons are now generated with a php library that loads the empty image live and writes the text centered onto it each time a button graphics is requested.

In case anyone is interested, this is my livebutton.php:

<?
header("Content-type: image/png");
$t = $_GET[‘text_for_button’];
$slen = strlen($t);
$im = imagecreatefrompng("empty.png");
$textcolor = imagecolorallocate($im, 9, 39, 111);
$font = 3;
$pxd = 6;
$px = $pxd + (imagesx($im) – (7.5 * $slen)) / 2;
$py = 7;
imagestring($im, $font, $px, $py, $t, $textcolor);
imagepng($im);
imagedestroy($im);
?>

Images are defined like this in html now:

< img src = " livebutton.php?text_for_button=Home " >

(The example may contain errors but it works this way or similar)

Cheers
Adrian

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections