Embeding image into XML document

Hi,
I am in need to embed image into XML file so that when somebody else uses the XML file, the image is still there. Is there any way to do this? Is it possible? Please give me some suggestions if you know about.
Thanks a lot.

well, the blowup in size from 3MB to 5MB is expected when you do the text encoding, cause you are taking binary data and converting it to a small range of characters. there are alternate algorithms which result in less of a blowup than base64 (like ascii85), see:
http://en.wikipedia.org/wiki/Category:Binary-to-text_encoding_formats
most image files use some sort of compression algorithm, which is why your file is much smaller than the image byte[]. you could just stick the file byte[] in the xml, but you might need to add additional attributes to indicate the image encoding (e.g. "gif" or "jpg").
but, basically, you aren't doing anything "wrong".
Edited by: jtahlborn on Feb 26, 2008 2:31 PM

Similar Messages

  • How to insert embedded image into TextArea htmlText (and add IOErrorEvent.IO_ERROR listener).

    I unsuccessfully tried to find way to insert embedded image into TextArea via <img> tag. Can you point me out how to do this?
    Also, please, tell me how to handle IOErrorEvent from TextArea because adding IOErrorEvent.IO_ERROR listener to TextArea doesn't cause any effect when image url of img tag has not been found.
    Thanks

    i 've successfully inserted the image into the database... here is my code
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package PMS;
    import java.io.File;
    import java.io.FileInputStream;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    public class Browse_java
    static Connection con=null;
    public static void main(String args[])
    try{
    System.out.println("(browse.java) just entered in to the class");
    con = new PMS.DbConnection().getConnection();
    System.out.println("(browse.java) connection string is"+con);
    PreparedStatement ps = con.prepareStatement("INSERT INTO img_exp VALUES(?,?)");
    System.out.println("(browse.java) prepare statement object is"+ps);
    File file =new File("C:/Documents and Settings/Administrator/Desktop/Leader.jpg");
    FileInputStream fs = new FileInputStream(file);
    byte blob[]=new byte[(byte)file.length()];
    fs.read(blob);
    ps.setString(1,"C:/Documents and Settings/Administrator/Desktop/Leader.jpg");
    ps.setBytes(2, blob);
    System.out.println("(browse.java)length of picture is"+fs.available());
    int i = ps.executeUpdate();
    System.out.println("image inserted successfully"+i);
    catch(Exception e)
    e.printStackTrace();
    finally
    try {
    con.close();
    } catch (SQLException ex) {
    ex.printStackTrace();
    }

  • Using Pages 5.2.2: When I drag an image into my document, I lose the related text.  I can crop the image, make it smaller, but it is surrounded by blankness that overrides the text.  Help?!

    Using Pages 5.2.2, MacBook Pro, OSX 10.9.5:  I cannot drag an image into my document without it obliterating the text.  Even after re-sizing,  the image just becomes small inside a larger blank area that appears to cover the saved text.  Help?

    Using Pages 5.2.2, MacBook Pro, OSX 10.9.5:  I cannot drag an image into my document without it obliterating the text.  Even after re-sizing,  the image just becomes small inside a larger blank area that appears to cover the saved text.  Help?

  • Transform Java Beans into XML documents?

    Hi,
    I have standard Java Beans (which are not generated out of XML documents), can I transform them into
    XML documents even if they are not generated out of XML documents originally?
    If not, is there any toll which can do that?
    regards,

    Looks like the java.beans.XMLEncoder class is where you should start.

  • Convert binary data (TIFF image) into XML - how ?

    Hi,
    I have the following requirement:
    1. A document is scanned and a TIFF image is saved in a directory
    2. The File adapter picks up the image file and sends into XI
    3. The binary data is converted into XML so a Web Service can be called (this web service will store the image in a database application)
    <b>The part I am struggling with is the convert of the incoming binary data into a XML format document which will allow the Web Service to be called.</b>
    Graphical mapping cannot be used therefore I am left with 3 options:
    1. XSLT mapping
    2. Java mapping
    3. ABAP mapping
    Can anyone suggest the best option to use in these circumstances and provide some sample snippet of code on how to do it.
    I am alright at XSLT mapping but this is beyond me and Java mapping is completely new to me as I have very limited Java knowledge.
    Thanks for your help
    Colin.

    Hi Colin
    Look for the below link
    https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    <b>***Reward point if helpfull</b>
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b</a>

  • How do I get a 300dpi image into a document as required by CreateSpace.

    I need to submit 300 dpi photos in my exported .pdf file to CreateSpace to render sharp clear images when printed on paper. This was no problem in Pages '09. But now dragging, importing, or pasting a 122.9 MB 4800 x 6400 pixel  2000 pixel per inch photo into an iPages 5.0 document yields a 77 KB, 173x231 72 pixel per inch photo in the document. This is an extreme example but all photos seem to have been downsampled to 72 pixels per inch. I understand some of the complexities of translating DPI to PPI and back but throwing away 122.823 MB of data has got to hurt rendering.  Is this a new iPages "Feature" or should I be using a different approach? I'm using Preview to check the image DPI and size.

    I created my document in pages. Dragged photos, that I had resized and resampled in Preview to make sure they were 300DPI at least, into the document.  I then export the document to .pdf using BEST image quality.
    The exported document was flagged by CreateSpace for 72DPI rather than 300DPI images. When I checked the document I found when I selected an image, copied it, and brought it up in Preview as New From Clip board, it was indeed 72DPI and much smaller than the original that I drug into the document.
    I then found that this happens immediately when it is copied from a folder and pasted into Pages. Copy a 1 MB image and paste it to both Preview and Pages.  Then go into pages, select the image, copy it, and paste it into Preview. Show inspector on the two images I've gone from 1.4MB to 300DPI .tiff file to 44KB 72DPI .png file.
    The same happens on .jpg files.

  • Embedding XSL in XML document

    Hi
    I am new to this particular forum. I had some query regarding embedding XSL .
    Can we embedd the XSL stylesheet in the XML document itself.
    I searched this forum and got some similar queries but the output isn't working. Can anyone put a working example.
    I have got the following XSL stylesheet:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <body>
    <table border="1" width="100%" cellpadding="1">
    <tr bgcolor="#FFFF99">
    <th style="font-family:arial unicode ms;font-size:100%" align="center">Serial number </th>
    <th style="font-family:arial unicode ms;font-size:100%" align="center">Site number </th>
    </tr>
    <xsl:for-each select="Master/RECORD">
    <xsl:if test="SR_NO &gt; 0">
    <tr>
    <td style="font-family:arial unicode ms;font-size:80%" align="right"><xsl:value-of select="SR_NO"/></td>
    <td style="font-family:arial unicode ms;font-size:80%" align="right"><xsl:value-of select="ACR_SNO"/></td>
    </tr>
    </xsl:if>
    </xsl:for-each>
    </table>
    </body>
    </xsl:template>
    </xsl:stylesheet>
    The XML document is as below:
    <?xml version="1.0" encoding="utf-8"?>
    <?xml-stylesheet type="text/xsl" href="archivingmaster.xsl"?>
    <Master>
    <RECORD>
    <SR_NO>1</SR_NO>
    <ACRSNO>1</ACR_SNO>
    </RECORD>
    <RECORD>
    <SR_NO>2</SR_NO>
    <ACRSNO>2</ACR_SNO>
    </RECORD>
    </Master>
    Thanks in advance
    Ameya.

    I have already gone through that link and searched for this on the net. But it doesn't seem to work on my Mozilla Firefox browser.
    Can anybody put a working example if possible.
    Thanks
    Ameya.

  • Embedding images into connector.

    I've created a custom component that will pop-up to display errors when my connector has problems.  After working around some styling limitations within the SDK, I've managed to get everything laid out and working great.  Now I'm at the last hurtle.
    I've embedded images that will be displayed.  For example, an image to represent an error.  Now during debugging in Flex Builder, obviously, the image displays.  I compile and package up my component and head off to Xcelsius.  Now this is when it gets weird.
    I'm using Xcelsius Enterprise 5.3.0.0, Build No. 12,3,0,670
    I add in my connector to a dashboard, and then press "Preview" (no configuration needed, as i just display a test message for now).
    The dashboard comes up, the test message is displayed, but no image is present.
    Now i click on "Preview" again to get back into the designer.  Then i press preview again without making any other clicks or changes to the dashboard.  Now i'm presented with a dashboard, the message pops up, and my image is clearly visible.
    The image is consistently not displayed on the very first preview of the dashboard.  And it's consistently displayed in the second and any future previews of the dashboard.

    Hi
    That is a bug actually. you can follow
    Problem with button Icons
    Hope helps
    Rush-me

  • Embedded images in Word documents are incorrect on one computer but show up fine on another computer

    I've not been able to find the root of the problem, but I use an application on my laptop that generates images in a document, and the document can be saved either with docx or htm/html extensions. On the laptop, I see the correct images. When I transfer
    the document to my workstation either over the network or by a flash drive, the incorrect images pop up - images from a project that I was working on last summer. If I save the documents as a doc on my laptop, the correct images show up on my desktop. This
    happens on many documents that I use, but I do have a document I use as a template. I'd prefer not to create another one, because it is quite involved.
    When the incorrect images show up on my workstation, I can save the document to a flash drive (you would think with the incorrect images also being saved), but the correct images show up on my laptop.
    This is frustrating to always have to work around this, but I've searched Google and really haven't found anyone else having a problem very close to this. Does anyone have any ideas?
    Thanks

    Hi,
    I'm actually thinking whether the issue is related to Office version. What are the versions of Office on your laptop and workstation?
    Based on the description, the issue doesn't occur if the document is saved as .doc, it only occurs if the document is saved as .docx, so basically we can say your workstation doesn't support .docx well. Is it a version prior to Office 2007?
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • BLOB ibfo into XML document

    Hi forumers,
    I've been asked to build a table to keep some data in XML format. Actually this data resides in a relational table and one of the columns is BLOB.
    Can I store BLOB in a XML document ? (for the other columns I'm using XMLFOREST()).
    If this is possible and if I want to "extract" this BLOB information from XML document how can I do this ?
    Best Regards,
    Helena

    Correction made on the subject

  • How can I insert an Image into PDF document programmatically?

    I am trying to work with a pdf programmatically through FoxPro using objects:
    createObject(”AcroExch.App”)
    createObject(”AcroExch.AvDoc”)
    createObject(”AcroExch.PDDoc”)
    I am able to open acrobat, add / delete pages, fill in some fields with the “AFormAut.App” object. and finally print the pdf.
    I print Hundreds of books for students in our college, each student gets a book specificaly tailered for the student.
    Everything goes programmatically.
    Now I want to insert images into the pdf, also programmatically.
    I cant find a which object to work with?
    I wish there was a way to do it just as I did with the things i mentioned above.
    Any help would be greatly appreciated.

    Thanks,
    So where do I goet the plugins or how do I know which plugin would enable me
    to work with images?
    Now I got to another thing that I need, I need to flatten pdf
    programmatically, and don't know how.

  • Import an image into a document

    I see this asked on other posts but I don't see an answer so I'm going to ask again...
    I'm using Designer 7.0, windows XP pro on a Dell D600 laptop with 1 gig of RAM.
    I want to import an image into a docement and the image doesn't appear to be supported. I've tried jpg and tif. Some images will work and others won't. Is there a solution for this?
    Thanks

    Irv,
    Thanks for the reply. The images that didn't work were CMYK. When I converted to RGB they worked.
    The images that didn't work were coming up with random grey scale colors.
    Thanks again,
    Kurt

  • Inserting Image Into XML Publisher Report

    I have a problem to insert an JPG Image(Dynamique Logo depending on setid ) into My XMLPublisher report.
    My Image is stored in database. My query return the field image
    I Use this syntaxe:
    <fo:instream-foreign-object content-type="image/jpg">
    <xsl:value-of select=".//IMAGE"/>
    </fo:instream-foreign-object>
    where IMAGE is the image field name of my query.
    But this does'nt work ; any Help please ?

    Make sure this parameter is set false:
    http://blogs.oracle.com/xmlpublisher/2008/03/secure_your_io.html
    Also follow along this guideline:
    http://blogs.oracle.com/xmlpublisher/2006/05/inserting_blobs_into_your_repo.html
    There you can even find an example
    Cheers
    Jorge
    ps. If this answers your question then please grant the points and close the thread

  • Problems embedding HTML into XML with CVIXMLSetElementValue - unwanted &lt and &gt

    I'm using the CVI XML functions. When I try to insert some pre-exsting HTML as the element value with CVIXMLSetElementValue, it dutifuly converts all the HTMLangle brackets into &lt and &gt, which is NOT what I want.
    (I can protect the XML integrity by wrapping it in [CDATA[ ....]] but that does not solve the conversion issue here.)
    Any suggestions?
    Thanks,
    Ian
    Solved!
    Go to Solution.

    To explain a bit further, below is a code snippet and the unwanted result that I see. Does this behavior - even with CDATA - make good design sense?
    From my perspective CVIXMLSetElementValue should respect CDATA elements. Am I right? Or just biased?
    stat = CVIXMLSetElementValue (test1_element, "Hello");
    stat = CVIXMLSetElementValue (test2_element, "<p>Hello</p>");
    stat = CVIXMLSetElementValue (test3_element, "<! [CDATA[<p>Hello</p>]] >");
    // Problematic Output:
    // <?xml version="1.0"?>
    // <root>
    // <test1>Hello</test1>
    // <test2>&lt;p&gt;Hello&lt;/p&gt;</test1>
    // <test3>&lt;! [CDATA[&lt;p&gt;Hello&lt;/p&gt;]] &gt;</test1>
    // </root>

  • AcroExch missing when embedding PDF into Word document

    When I try to embed a pdf into a word document, the well known message "The program used to create this object is AcroExch.  That program is not installed on your computer...".
    I'm working with on Windows 7, Office 2010 and Adobe Acrobat XI  (all 64Bit, patch level up to date).
    downgrading to Acrobat 9.5 would solve the problem, but does not match to our company policy.
    Any help, how to solve the problem with current versions?

    You want the Acrobat Forum

Maybe you are looking for