Hello Fabian, Thank you so much for your response..! Honestly the problem has been with the parameter that I passed. Batik accepts only URI paths!
so now the things seem to work well. I will require your help further in my project. Thank you again. Anjello. Fabian Unfried-3 wrote: > > 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: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > - 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: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://old.nabble.com/embedding-a-png-image-in-the-svg-document-tp28904142p28907814.html Sent from the Batik - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
