0

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

Edited by mangel.murti: n/a

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by mangel.murti
0

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.)

Edited by fxm: n/a

Attachments check.gif 21.18 KB
0

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

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.