hi all,

if i have to print some text over a image in particular location of image can i do it with javascript
actually i have a check(image) but i want to print name , amount over that image but i want it be in write place of check image

thnx in adv

The code

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
    <title></title>
  </head>
	<style>
	body {font-family:monospace; font-size:10pt}
	</style>
  <body>
    <img style="position:absolute" src='check.gif'>
    <div id='nam' style="position:absolute; top:.85in; left:.85in"></div>
    <div id='amt' style="position:absolute; top:.85in; left:4.35in"></div>
	<script type="text/javascript">
		document.getElementById('nam').innerHTML = "~~~~~~ Your name here ~~~~~"
		document.getElementById('amt').innerHTML = "~~$1,000.00"
	</script>
  </body>
</html>

is basically simple (and was tested here with the attached image).

Using absolute measurements with a monospace font of a specified size should minimize cross-browser placement issues (although you will have to measure your check very precisely and will still have to test carefully).

Provided that you control the length of the 'nam' string and the format of the 'amt' string it should look presentable. (If the background of the check is dark or 'busy', you may want to make the font bold.)

BTW: writing an elegant routine to print the amount in words in the available space is a moderately challenging task for a quiet morning.

The code

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
    <title></title>
  </head>
	<style>
	body {font-family:monospace; font-size:10pt}
	</style>
  <body>
    <img style="position:absolute" src='check.gif'>
    <div id='nam' style="position:absolute; top:.85in; left:.85in"></div>
    <div id='amt' style="position:absolute; top:.85in; left:4.35in"></div>
	<script type="text/javascript">
		document.getElementById('nam').innerHTML = "~~~~~~ Your name here ~~~~~"
		document.getElementById('amt').innerHTML = "~~$1,000.00"
	</script>
  </body>
</html>

is basically simple (and was tested here with the attached image).

Using absolute measurements with a monospace font of a specified size should minimize cross-browser placement issues (although you will have to measure your check very precisely and will still have to test carefully).

Provided that you control the length of the 'nam' string and the format of the 'amt' string it should look presentable. (If the background of the check is dark or 'busy', you may want to make the font bold.)

yes it's working for me.
thankyou.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.