xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Unfried <funfr...@zebra.com>
Subject Re: embedding a png image in the svg document
Date Wed, 16 Jun 2010 15:49:52 GMT
It seems that the path to your png file isn't correct, you could try to use the full path,
e. g.:

my_image.setAttributeNS(XLINK_NAMESPACE_URI, "xlink:href", "/home/USERNAME/image/my.png");

or

my_image.setAttributeNS(XLINK_NAMESPACE_URI, "xlink:href", "D:/images/my.png");

Or you try to use the relative path from the directory your application is running, I guess
(didn't test it).

E.g. your application is running in D:\program files\myApp\ and your image is in D:\images\
you should try this:

my_image.setAttributeNS(XLINK_NAMESPACE_URI, "xlink:href", "../../images/my.png");


Regards,
Fabian


Am 16.06.2010 um 17:29 schrieb Anjello:

>
> Hello everyone,
>
> I am new here. I am working on a java project for which I am using Batik. I
> need to include a png file in my svg document. This is the coding I used
>
> Element my_image = document.createElementNS(svgNS, "image");
> my_image.setAttributeNS(XLINK_NAMESPACE_URI, "xlink:href", "test_png.PNG");
>
> but all I see on the JSVGCanvas is an image which is similar to a broken
> link icon. Can someone please help me with this?
>
> Thanks in advance.
> --
> View this message in context: http://old.nabble.com/embedding-a-png-image-in-the-svg-document-tp28904142p28904142.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>


- CONFIDENTIAL-

This email and any files transmitted with it are confidential, and may also be legally privileged.
 If you are not the intended recipient, you may not review, use, copy, or distribute this
message. If you receive this email in error, please notify the sender immediately by reply
email and then delete this email.

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


Mime
View raw message