xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carter, Will" <WCar...@envestnetpmc.com>
Subject RE: transcode with javascript problem?
Date Thu, 02 Jan 2003 17:49:17 GMT
thanks, I can see how to set the onload hint. but is this possible?

it doesn't seem to understand the getComputedTextLength method, i get this when I try it with
the rasterizer application:

Enclosed Exception:
!!! SVGOMTextContentElement.getComputedTextLength()

if I use a static value for Rect1XCoor it works. 

here is what I am trying to do.  I have a dynamic text label and a rectangle that is a legend
for the text label.  I am trying to center the label with the rectangle to move dynamically
to the left of it.

any ideas would be appreciated.
will

<script type="text/ecmascript">
<![CDATA[
  function horizontalRelocate(evt,svgWidth)
    {
	var svgDoc = evt.getTarget().getOwnerDocument();
	var svgobjtext= svgDoc.getElementById("label");
	var svgobjtextWidth = svgobjtext.getComputedTextLength();
	var svgobjRect1= svgDoc.getElementById("Rect01");
	var Rect1XCoor = (.5*svgWidth) - (.5*svgobjtextWidth) - 25;
	svgobjRect1.setAttribute("x",Rect1XCoor);
    }
]]>
</script>

<svg:g onload="horizontalRelocate(evt,700)">
  <svg:rect id="Rect01" x="0" y="100" width="20.0" height="5.0"/>
  <svg:text id="label" style="text-anchor:middle;" x="350" y="100">Label Name</svg:text>
</svg:g>

-----Original Message-----
From: Vincent Hardy [mailto:vincent.hardy@sun.com]
Sent: Monday, December 30, 2002 4:51 AM
To: Batik Users
Subject: Re: transcode with javascript problem?


Hello Carter,

Depending on the method you use:

- rasterizer application. You'll need to use the '-onload' option. See 
the http://xml.apache.org/batik/svgrasterizer.html doc:

   >> # -onload Controls if the source SVG files must be rasterize after
   >> dispatching the 'onload' event.

- transcoding API. There is a transcoding hint for dispatching 'onload': 
KEY_EXECUTE_ONLOAD. If you set it to Boolean(true), this will do what 
you want.

Good luck,
Vincent.

Carter, Will wrote:
> can't figure out why the rectangle resulting created jpg doesn't move by 350...
> when I view the svg, it works, but the converted jpeg is wrong.
> 
> any help would be appreciated.
> will
> 
> <script type="text/ecmascript">
> <![CDATA[
>   function horizontalRelocate(evt,svgWidth)
> 	{
> 	var svgDoc = evt.getTarget().getOwnerDocument()
> 	var svgobjRect1= svgDoc.getElementById("Rect01")
> 	var Rect1XCoor = (.5*svgWidth);
> 	svgobjRect1.setAttribute("x",Rect1XCoor)
> 	}
> ]]>
> </script>
> 
> <svg:g onload="horizontalRelocate(evt,700)">
>    <svg:rect id="Rect01" stroke-width="1pt" x="0" y="100" width="20.0" height="5.0"/>
> </svg:g>
> Disclaimer - 12/23/2002
> This information in this email is confidential and may be legally privileged. It is intended
solely for batik-users@xml.apache.org.  Access to this Internet email by anyone else is unauthorized.
> 
> EnvestnetPMC, Inc. does not accept time-sensitive transactional messages, including orders
to buy and sell securities, account allocation instructions, or any other instructions affecting
a client account, via e-mail.  
> 
> If you are not the intended recipient of this email, any disclosure, copying, or distribution
of it is prohibited and may be unlawful.  If you have received this email in error, please
notify the sender and immediately and permanently delete it and destroy any copies of it that
were printed out.  When addressed to our clients, any opinions or advice contained in this
email is subject to the terms and conditions expressed in any applicable governing EnvestnetPMC
terms of business or agreements.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

Disclaimer - 01/02/2003
This information in this email is confidential and may be legally privileged. It is intended
solely for Batik Users.  Access to this Internet email by anyone else is unauthorized.

EnvestnetPMC, Inc. does not accept time-sensitive transactional messages, including orders
to buy and sell securities, account allocation instructions, or any other instructions affecting
a client account, via e-mail.  

If you are not the intended recipient of this email, any disclosure, copying, or distribution
of it is prohibited and may be unlawful.  If you have received this email in error, please
notify the sender and immediately and permanently delete it and destroy any copies of it that
were printed out.  When addressed to our clients, any opinions or advice contained in this
email is subject to the terms and conditions expressed in any applicable governing EnvestnetPMC
terms of business or agreements.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message