Print text with image background


Recommended Posts

Good luck from the command line... :blink:

Somehow I think this one goes beyond the use-emacs-for-everything reply...

umm, fire up X and load some image software, methinks.

Link to comment
Share on other sites

Good luck from the command line... :blink:

Somehow I think this one goes beyond the use-emacs-for-everything reply...

umm, fire up X and load some image software, methinks.

can't do it. I have to create final file with image as bg and text over it then print it out.

The big problem how to create such file.

Link to comment
Share on other sites

Print text? On what? Printer, screen, webpage, bootup screen, open shell in GUI?

Give us a bit more to go on! :yes:

Link to comment
Share on other sites

Print text?  On what?  Printer, screen, webpage, bootup screen, open shell in GUI?

Give us a bit more to go on!  :yes:

I've got image file & text. So, using console tools I want to make output file, which will have image as a background (like whatermark) and text over it on full page.

Then just print it to printer.

The big challenge is how to combine image & text (no graphic edit is usefull here).

Thanks for ideas.

Link to comment
Share on other sites

I've got image file & text. So, using console tools I want to make output file, which will have image as a background (like whatermark) and text over it on full page.

Then just print it to printer.

The big challenge is how to combine image & text (no graphic edit is usefull here).

Thanks for ideas.

I know that PHP has tools to do this through code. Never used it, though...

Link to comment
Share on other sites

I wrote you a quick program. It's written in Java. Place the class somewhere and from that directory run:

java TxtToImg somefile.png sometext.txt

The picture can be either a png, jpg, or gif. The text is just placed in somefile. The resulting image is placed where the program tell you. The text is written with Times New Roman size 12. You can change that by editing te source yourself. Needless to say you have to have that font installed. Otherwise change it to a more appropriate font. I hope it works for you.

TxtToImg.class

Edited by Mr. Static Void
Link to comment
Share on other sites

If you have ImageMagick available on the machine in question, you could easily do this with the tools it provides as well.

It would look something like this:

# convert -font helvetica -fill white -pointsize 36 -draw 'text 10,50 "Your text here"' input.jpg output.jpg

You can find more info on ImageMagick at their website.

Link to comment
Share on other sites

I wrote you a quick program. It's written in Java. Place the class somewhere and from that directory run:

java TxtToImg somefile.png sometext.txt

The picture can be either a png, jpg, or gif. The text is just placed in somefile. The resulting image is placed where the program tell you. The text is written with Times New Roman size 12. You can change that by editing te source yourself. Needless to say you have to have that font installed. Otherwise change it to a more appropriate font. I hope it works for you.

nice and its even multiplatform ! :D

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.