Base64 to Image Conundrum

I have a webapp that will send an image that has been base64 encoded. Is there anyway to take the byte[] array from the base64 string / thing and get a nice healthy image ?
Sincerely,
Chem E

Try [_this_|http://www.lmgtfy.com/?q=java+base64+decode].
db

Similar Messages

  • Display base64 encoded image in flash

    how to decode the base 64 representation of the image?

    Has any played around with the bitmapdata classes to see if
    there are any undocumented was to convert the decoded base64 (now
    binary) into pixel data? Until we migrate to as3 (huge
    undertaking), I really need a way to use the base64 strings from a
    web service as images in flash. I'm going to keep playing and
    digging, but in the meantime, if someone can shed some light here
    on how to do this with AS2, I would bow to your "sherlock
    holmes-ness".
    Thanks

  • Need help loading base64 encoded image.

    I've got an applet that saves an image into a database by posting a base64 encoded version of the image to an ASP page. Basically, I convert the image to an array of bytes, then encode it and post it to the page. Now, my problem occurs after I read the base64 string from the database and try to display it. When the application is started up, it is supposed to read the image and load it into the canvas of the applet, but I get a NullPointerException when I call displayImage because the fgImage has -1 width and height. If anyone has done this before and has any hints or tips, that would be great. Otherwise, take a look at my code and see if you can find something wrong. Thanks!
    public void loadBase64Image(int[] newPixels) {
    System.out.println("loading new image...");
    try {
    if (newPixels == null) {
    byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
    URL loadURL = new URL(fgImgURL);
    URLConnection imageCon = loadURL.openConnection();
    imageCon.setDoOutput( true );
    imageCon.setUseCaches(false);
    DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
    BASE64Decoder decodedImage = new BASE64Decoder();
    imgPixels = decodedImage.decodeBuffer(imageIn);
    imageIn.close();
    int w = this.getWidth();
    int h = this.getHeight();
    int imgPix[] = new int[w * h];
    int index = 0;
    for(int y=0; y<imgPix.length;y++){
    imgPix[y] = imgPixels[4*y]
    | (imgPixels[4*y + 1] >> 8)
    | (imgPixels[4*y + 2] >> 16)
    | (imgPixels[4*y + 3] >> 24);
    imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
    else
    imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
    // Update the fgImage to the current OSC.
    if (fgImage != null) fgImage.flush();
    fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
    displayImage(fgImage, this.getWidth(), this.getHeight());
    catch (Exception e){
    System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

    Docs for URLConnection
    "A URL connection can be used for input and/or output. Set the DoInput flag to true if you intend to use the URL connection for input, false if not. The default is true unless DoOutput is explicitly set to true, in which case DoInput defaults to false."
    You have setDoOutput(true), so doInput is by default set to false according to the docs. I would make the change to also setDoInput(true) as well and see if it works.
    public void loadBase64Image(int[] newPixels) {
       System.out.println("loading new image...");
       try {
          if (newPixels == null) {
             byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
             URL loadURL = new URL(fgImgURL);
             URLConnection imageCon = loadURL.openConnection();
             imageCon.setDoOutput( true );
             imageCon.setDoInput( true ); // Make sure you add this line
             imageCon.setUseCaches(false);
             DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
             BASE64Decoder decodedImage = new BASE64Decoder();
             imgPixels = decodedImage.decodeBuffer(imageIn);
             imageIn.close();
             int w = this.getWidth();
             int h = this.getHeight();
             int imgPix[] = new int[w * h];
             int index = 0;
             for(int y=0; y<imgPix.length;y++){
                imgPix[y] = imgPixels[4*y] | (imgPixels[4*y + 1] >> 8) | (imgPixels[4*y + 2] >> 16) | (imgPixels[4*y + 3] >> 24);
             imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
          else
             imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
          // Update the fgImage to the current OSC.
          if (fgImage != null)
             fgImage.flush();
          fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
          displayImage(fgImage, this.getWidth(), this.getHeight());
       catch (Exception e){
          System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

  • Managed vs referenced images conundrum

    Hello all,
    I have started using the Aperture 3 trial for about a week and my head is already swimming over the choices to make over managed vs. referenced images. I've read the manual, the "exploring" doc and several posts with respect to this topic and sometimes feel like I'm off to the races, only to then get stuck in the mud. I'm guessing that my case is not all that unusual and hope that someone who has gone down this road can offer up the solution that worked for them and why. I've worked with Aperture on a small set of photos and would not like to import the rest to use it in earnest. Prior to Aperture, I imported about 7000 photos using the camera manufacturer's software, Canon Image Browser, then also Nikon ViewNX. I previously "organized" these by creating a separate folder for each full CF card, which I named with the camera model and the date range, eg. S70-100907-110112. Once I had enough, I burned a CD as backup.
    I have a copy of this organization on my laptop, my desktop and the backup CDs, so for some reason I feel slightly attached to it, though it does not provide much information. For this reason and to more easily be able to see which files I have or have not imported into Aperture (somewhat worried I'll leave something behind), I thought I would use referenced images. I also thought referenced images would allow me to utilize my stack of old 20 - 80 GB hard drives as on & off site backups. I also have a 1 TB OWC external drive that I bought for this purpose and possibly Time Machine (yet another issue to plan out). While copying over the files from the Nikon, I realized that the camera was re-using file names after each upload emptied the CF card. Nikon ViewNX creates a new folder for each upload, so there's no conflict, but I think Aperture may see them as duplicates. I have since asked the camera to use persistent serial numbers for naming files.
    I intend to rate all my images, delete the bad ones, then keyword and improve the good ones. Can anyone who has waded through this type of problem share how they came to whatever scheme worked for them?
    Thanks,
    Scott

    3) How to partition external disks to use with vaults and Time Machine.
    With Disk Utility
    I know you could not tell from the way I worded it, but I want to know how much of the 1 TB external disk to partition for Time Machine, how much for Aperture Vaults. I know to use Disk Utility for partitioning disks.
    A Vault for a Managed Library is a complete back up of the Library. A Vault for a Referenced Library is not much of a back up as you also need a back of the referenced files. Actual saved disk space? Zero.
    I was not suggesting that referenced masters saved any space, just that it made it easier to back up those masters in whatever sized chunks one chooses. I believe that a vault cannot be spread across multiple disks, right? Assuming that is the case, then a large library of managed masters will require a single large partition for the vault. With referenced masters, you can save one set of files/folders to one disk, another set to another disk. One rebuttal to this is that my collection of 20 to 80 GB drives can still be used for archives since the Masters can be read from the Terminal, and therefore backed up using rsync.
    You can only have one Library open at a times. So, go to search for something and sure as eggs it'll be in the other one... It's also unnecessary. You can do a simple keyword to separate the two kinds: 'Snap' and 'Art'. Now you can restrict your searches to either.
    A good point. Also importing files to 2 different libraries becomes a huge hassle. Do I put it in the Art or the Snap library? Did I already? Is it in both? Did I miss it?
    I think one of the best arguments I came up with for managed masters is related to vault maintenance. Deleting bad pictures is a big part of organization. If you delete a managed master, that delete will be carried into subsequent vault backups. If you delete a referenced master, you will need to manually carry that delete forward into your self-maintained backups. This is taken care of if you use rsync with the --delete option, but most people don't use rsync.
    Yes, I'm over-thinking it, probably because of the assumption that once it is done, it's a pain to change.
    Thanks,
    Scott

  • How to convert base64 data to an image

    Hello, my enterprise application is receiving base64 enocoded image data in an xml file. Now I need to convert it to a native image formats like jpeg/jpg/tiff/pdf etc. Does anybody know if there are any Java apis (both free/paid) which let you do this. Actually I would not have any idea of what type of image it was when it was initially encoded to base64 format. I am looking for an API/technique that can convert base64 data to any image depending on what I want at runtime.
    Thanks a lot in advance.
    R

    Hi there,
    I've had to deal with exactly the same problem myself. The images I had to deal with were all TIFF files, and that was okay, I'd say one of your first steps would be to find out what format these images are in.
    I used a SAX Content Handler to pull the base 64 image data out of the XML into a String, and then converted the Base 64 String into a byte array. From there I could either simply write the byte array to a file, or if I wanted use ImageIO to create an Image object, work with the metadata or even save it in a different format, though I never actually did that.
    Anyway, here is some code I whipped up to convert the String to a byte array, then write the byte array to disk. Let us know how you get along!
          * Writes a byte array to a file.
          * @param result          String containing base64 image data     
          * @param fileName     File name to write the converted image to
         public static void writeTiff(byte[] result, String fileName) throws IOException {          
              FileOutputStream out = new FileOutputStream(fileName, true);
              out.write(result);
              out.close();
          * Converts a String of base 64 image data, captured from XML, into a byte array.
          * @param      image     A Base 64 String          
          * @return      byte[]          
         public static byte[] convertTiff(String image) throws IOException {          
              byte[] result = new sun.misc.BASE64Decoder().decodeBuffer(image);
              return result;
         }

  • Extracting Base64 images embeded inside XML and Convert it into PDF using Biztalk

    Hi,
    I'm presently working in a scenario, where we will be getting huge XML Files containing Base64 encoded images. The scenario goes like this :-
    1) Client will dump the XML files with embedded Base64 images in a sFTP location.
    1) Firstly, we have to extract Base64 encoded images and the metadata from the XML file.
    3) Secondly, we need to convert the extracted Base64 encoded image into multiple pdf.
    4) Then merge the PDF's into a single file.
    5) Then the merge pdf will store to a particular location.
    5) It is presume that, the file will be of very big in size ~ 1 GB XML file, so we need to take care of the performance as well.
    The sample xml looks like:-
    <ns0:tran xmlns:ns0="http://Sample.Schemas.Record_XML">
      <tranheader>
      </tranheader>
      <item>
        <image>
          <frontimage>
            <frontimage> image 1 part 1</frontimage>
          </frontimage>
          <rearimage>
            <rearimage>image 1 part 2</rearimage>
          </rearimage>
          <frontimage>
            <frontimage> image 2 part 1</frontimage>
          </frontimage>
          <rearimage>
            <rearimage>image 2 part 2</rearimage>
          </rearimage>
          <frontimage>
            <frontimage> image 3 part 1</frontimage>
          </frontimage>
          <rearimage>
            <rearimage>image 3 part 2</rearimage>
          </rearimage>
        </image>
      </item>
      <trantrailer>
      </trantrailer>
    </ns0:tran>
    Thanks & Regards

    Do you really need to use BizTalk for this requirement? This can be done better with standard .NET code through a Windows service/schedule task/ if you want to poll,
    you can implement file watcher class and poll the file as when it arrive to SFTP folder and convert the image in base64 to PDFs.
    Another point, I don’t know why you want to “convert the extracted Base64 encoded
    image into multiple pdf” (Point-3) and “Then merge the PDF's into a single file”-
    point4. You can create a single PDF file (unless I don’t know the reason for creating separate PDF file and merge it again as single PDF file)
    Anyway, if you still need to use BizTalk, you have somes options in general:
    Option1:
    Receive the message using BizTalk receive location using passthrouhg pipeline at receive end
    Create a send port with filter for receive portname. In the send port use a custom send pipeline. In the send pipeline use a custom pipeline component which will extract the base64 content from
    the XML file, convert the base64 encoded image as PDF and send the PDF file in the send port level.
    Option 2 – this options works better if you have some process based on your
    <tranheader> record:
    Receive the message using BizTalk receive location using a custom pipeline strip off, decode and store the base64
    encoded document in a temporary store (file system). So when the message is published in message box db, the message doesn’t contain the heafty encoded64 data part, message will be light weight when its published into message box.
    Process the XML message (without bae64 encoded document) with or without orchestration where you will do processing based on your
    <tranheader> record.
    In send last moment –at send port level, retrieve the stored file from the
    temporary store (file system), convert the image to PDF (i,e, hefty processing like creation of PDFs/merging) can be done at the send pipeline level and send the PDF file
    to destination.
    Following are the guidelines you should keep in mind if you need to achieve this process in BizTalk:
    Try to avoid publishing the hefty message to message box.
    Conversion of base64 to PDF can be done only using a .NET code. So your options to do this conversion in BizTalk are either in Receive pipeline/send pipeline/ .NET helper in orchestration.
    Try not to use Orchestration as much as possible, because of heavy processing and message transmission is already involved.
    Following articles shall help you in this context:
    Dealing with base64 encoded XML documents in BizTalk
    To convert Base64 to PDF/JPEG using C# code:
    TechNet-Wiki Code: Converting Base64 strings
    to Bitmap images
    Convert Image to Base64 String and Base64
    String to Image
    Base64 encoding and decoding in .NET
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Showing dynamic images in BI Publisher PDF report

    I defined a RTF report layout in BI Publisher. Almost done, but one requirement missing...
    I should be able to include a dynamic image (so every "object" on the report has it's own image).
    At first I embedded the base64 converted image in the XML output, but then I am running into the 32K limit. (Small pictures render fine).
    Although Marc Sewtz sort of promised in June 2008 (!) : "One issue, which we'll address in the next version of Application Express, is the 32k limit on report columns." on his blogpost http://marcsewtz.blogspot.com/2008/06/one-question-about-pdf-printing-feature.html , it still not addressed.
    So I tried to embed the image in the report using a trick described on the forum (and BIP documentation), by embedding a dummy picture and set the "Alt-text" of the picture to
    (as an example) : url:{'http://www.oracleimg.com/us/assets/oralogo-small.gif'}.
    The strange thing is, that works fine for HTML Output and Excel output, but not for Word and PDF (why it does work for Excel and not for Word is very mysterious....). And of course I need a PDF output.
    I also tried to embed a FO snippet:
    <fo:block>
    <fo:external-graphic src="url:{'http://www.oracleimg.com/us/assets/oralogo-small.gif'}" />
    </fo:block>
    But that doesn't (seem to) work on any output...
    But
    <fo:block>
    <fo:external-graphic src="D:\Users\rhartman\Documents\PrintScreen Files\Screenshot004.jpg" />
    </fo:block>
    does produce the image on the PDF output.
    So who has an idea how to solve this issue?? You'll be rewarded with a lot of pionts ;-)
    TIA
    Roel

    Hi Carsten
    That was exactly* I was looking for. Maybe I should Google more in German ;-)
    The main problem was that I defined my image outside the first repeating group (that doesn't repeat, it's always just one object) - the first group is followed by 7 more.
    Just like the "Name" (that's positioned outside the group in the document header), I positioned the image above the table representing the group.
    Doing that, the "Name" is filled correctly, the Image only when the Output Format is Excel or HTML - not Word or PDF ... makes no sense but that's tje way it is.
    After moving the image inside the group....it works great!
    (One more thing...the image size is fixed to the image you use as "dummy". Is there any way to make that more flexible, because now some scaling happens...)???
    @Trent: That was the way we initially did it, but when the size of the row exceeds 32K...you know what happens.. And even with a small image the 32K limit is hit easily
    The way I use it now (very similar to Carsten's description) there is no limit....
    Thank you all!
    Roel

  • How to attach an image in xls report

    Hi, does anyone knows how to insert an image in excel report?..
    We'd been working this for so long and it seems that the report cannot locate/render the image properly ..
    I hope someone can give me some tips and help..
    Thanks ..
    --original sql code  TEXT format                               
    OWA_UTIL.MIME_HEADER('application/vnd.ms-excel', TRUE, 'MaGiC_KeY');
    HTP.P('Content-Disposition: attachment; filename="' || V_RPT_TITLE_NO_SPACE || '.xls"');
    OWA_UTIL.HTTP_HEADER_CLOSE;
    --end of original sql code
    --begin DEV mode Insert Image - Logo
    --OWA_UTIL.MIME_HEADER('application/vnd.ms-excel', TRUE, 'MaGiC_KeY');
    owa_util.mime_header( 'application/octet-stream', FALSE );
    htp.p('Content-Type: application/ms-excel');
    HTP.P('Content-Type: multipart/related; boundary="----=_NextPart_01CA74F8.C8882F00"');
    HTP.P('------=_NextPart_01CA74F8.C8882F00');
    htp.p('Content-Disposition: attachment; filename="filename.xls"');
    -owa_util.http_header_close;
    --end DEV mode
    base64 code (image)
    HTP.P('------=_NextPart_01CA74F8.C8882F00
    Content-Location: file:image001.jpg
    Content-Transfer-Encoding: base64
    Content-Type: image/jpeg
    /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAUAAA/+4ADkFkb2JlAGTAAAAAAf/b
    AIQAAgICAgICAgICAgMCAgIDBAMCAgMEBQQEBAQEBQYFBQUFBQUGBgcHCAcHBg.....')

    Two thoughts.
    The first is to ask Microsoft since it is their software.
    The second is to throw Excel away and get a real report writer like Business Objects or Cognos or one of the many report creating projects Oracle provides.
    Excel, by definition, is a violation of audit trail rules.

  • How to display the archive link image in third party tool TSLImage viewer.

    Currently in our workflow scenario we are displaying the archivelink image in objects & Attachment, using SAP document viewer.  But the new requirement is, the attachment in workitem should be displayed using a thrid pary tool, EASY TSL IMAGE VIEWER. I have maintained the ARCHIVELINK Basic setting(OAG1),  Call Internet Browser. 
    The viewing of the document MUST use the TSLImageViewer web application which is hosted on rte-ben-ez2 for the test system u2013 NOT the SAP web document viewer. I think there must be an option in SAP Workflow that specifies that the standard OLE viewing is used for the work item attachments rather than the EDM viewing that I am getting.
    The authorising of the document MUST use the TSLImageAuth web application which is also hosted on rte-ben-ez2 for the test
    system. The url that are putting into the email needs to have this format:
                    http://rte-ben-ez2/TSLImageAuth?docid=$(%23SAPLEVEL1)\ECC6ARC1\00000153.001&logarch=E1.
    E1 is the content repository used for displaying.
    Can anybody tell me in further workflow settings where to mention the viewer settings as use thrid party viewer.
    Thanks in advance
    Shivani
    Edited by: shivani kolluru on Sep 27, 2008 12:33 PM
    Edited by: shivani kolluru on Sep 27, 2008 12:36 PM

    hey
    i need to display the an image.
    I am using apache commons codec for encoding and decoding.
    I have base64 encoded image data, i am decoding this and trying to create an image icon object by passing decoded byte array.
    That encoded and decoded byte array is BMP formatted data.
    or Is it possible to convert BMP data to any other format like png, jpg ....
    thanks

  • Remote image not resizing

    I have created a web service that pulls images (gif) from the
    database and base64 it for sending across the wire. The flex
    application then decodes and renders the image. The Image is not
    being scaled correctly. If I embed the image into the application
    everything works correctly. But if the image is decoded then sizing
    goes out the window.
    The image overflows the Image box and takes up the full size
    of the image. Zoom, rotation, etc. do nothing to the image.
    Any help is appreciated...
    Example Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="onLoad(event);">
    <mx:Script>
    <![CDATA[
    import mx.utils.Base64Decoder;
    public function onLoad(event:Event):void {
    // Decode image - Base64 gif image (500 x 776)
    var base64:String = "R0lGOD..."; // Get base64 from web
    service call
    var decoder:Base64Decoder = new Base64Decoder();
    decoder.decode(base64);
    // Load image into container
    var loader:Loader = new Loader();
    loader.loadBytes(decoder.flush());
    image2.addChild(loader);
    ]]>
    </mx:Script>
    <mx:HBox id="mainBox">
    <!-- Should render a 100 x 100 box but instead the image
    is full size -->
    <mx:Image id="image2" width="100" height="100" />
    </mx:HBox>
    </mx:Application>

    The simplest way to fill a liquid division is to make a small image tile and repeat it in background with CSS code:
    Example:
    body {
    background: url (my-bg-img.jpg) repeat;
    More on backgrounds:
    http://alt-web.com/Backgrounds.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • Image loaded with Loader doesn't render

    I have created a web service that pulls images (gif,jpg) from
    the database and base64 it for sending across the wire. The flex
    application then decodes and renders the image. The Image is not
    being scaled correctly. IT will not adhere to the dimensions of the
    ImageBox but rather stays at the original fixed size. If I embed
    the image into the application everything works correctly. But if
    the image is decoded then sizing goes out the window.
    The image overflows the Image box and takes up the full size
    of the image. Zoom, rotation, etc. do nothing to the image.
    Any help is appreciated...
    Example Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="onLoad(event);">
    <mx:Script>
    <![CDATA[
    import mx.utils.Base64Decoder;
    public function onLoad(event:Event):void {
    // Decode image - Base64 gif image (500 x 776)
    var base64:String = "R0lGOD..."; // Get base64 from web
    service call
    var decoder:Base64Decoder = new Base64Decoder();
    decoder.decode(base64);
    // Load image into container
    var loader:Loader = new Loader();
    loader.loadBytes(decoder.flush());
    image2.addChild(loader);
    ]]>
    </mx:Script>
    <mx:HBox id="mainBox">
    <!-- Should render a 100 x 100 box but instead the image
    is full size -->
    <mx:Image id="image2" width="100" height="100" />
    </mx:HBox>
    </mx:Application>

    Hi Dmitri,
    Thank you for the prompt reply, your question about the jpeg content was a helpful pointer.
    I solved the problem, it had nothing to do with flex, it was all on the java side. The image was obtained from converting a TIFF to a JPEG, the conversion was failing and the flex loader was receiveing a tiff and it did not know how to display it.
    The java problem was kind of interesting, I'll post it here as an FYI in case anybody cares :
    On my server the first writer returned by ImageIO was an instance of JPEGImageWriter and on the other servers was CLibJPEGImageWriter. And it happens that  only JPEGImageWrite can write the type of TIFF that we are having.
    The fix was to iterate through all the writers and pick the instace of JPEGImageWrite, instead of the first one found.
    Lumi

  • How to display BMP image.

    Hai
    I have a problem in displaying bmp image and I came to know that BMP format is not supported by java se 1.4.
    How can i display the image?
    OR
    Is there any third party tool (open source) that can solve my problem
    Thank you

    hey
    i need to display the an image.
    I am using apache commons codec for encoding and decoding.
    I have base64 encoded image data, i am decoding this and trying to create an image icon object by passing decoded byte array.
    That encoded and decoded byte array is BMP formatted data.
    or Is it possible to convert BMP data to any other format like png, jpg ....
    thanks

  • Strip off the base64 content from an XML and saving the rest in streaming fashion using XML Reader Class.

    Hi,
    I'm presently working in a scenario, where i need to read an XML (having base64 encoded images) using XmlReader class in a streaming fashion (considering the performance) .
    1) I have to strip offs the base64 encoded contents from the xml (front & back image node).
    2) Than saving the remaining XML (without base64 content) . 
    Sample XML:-
    <?xml version="1.0" encoding="utf-8"?>
    <tran>
      <tranheader>
     <feild1></feild1>
      </tranheader>
      <item>
    <fields></fields>
        <image>
          <frontimage>base64_content</frontimage>
          <rearimage>base64_content</rearimage>
        </image>
      </item>
      <item>
        <fields></fields>
        <image>
          <frontimage>base64_content</frontimage>
          <rearimage>base64_content</rearimage>
        </image>
      </item>
      <trantrailer>
        <feild1></feild1>
      </trantrailer>
    </tran>
    Please guide.
    Thanks & Regards

    E.g. a simplified skeleton:
    namespace ConsoleCS
    using System;
    using System.IO;
    using System.Xml;
    using System.Xml.Linq;
    class Program
    static void Main(string[] args)
    XDocument xdocument = XDocument.Parse(@"
    <Items>
    <Item>Test with a child element <more/> stuff</Item>
    <Item>Test with a CDATA section <![CDATA[<456>]]> def</Item>
    <Item>Test with a char entity: &#65;</Item>
    <SkipItem>Item to skip.</SkipItem>
    <!-- Fourteen chars in this element.-->
    <Item>1234567890ABCD</Item>
    </Items>");
    StringReader stringReader = new StringReader(xdocument.ToString());
    XmlReader xmlReader = XmlReader.Create(stringReader);
    xmlReader.MoveToContent();
    while (xmlReader.Read())
    switch (xmlReader.NodeType)
    case XmlNodeType.Element:
    if (xmlReader.Name == "SkipItem")
    Console.WriteLine("Skipping..");
    else
    Console.WriteLine("Pushing to output ({0}).", xmlReader.Name);
    break;
    Console.WriteLine("Done.");
    Console.ReadLine();

  • Encoded string to an image

    Hi all,
    I have a image library which can access using  
    http://myurl/imagebank/1
    http://myurl/imageban/25    etc  . 
    and that returns base64 encoded image string, and i wanted to load this in to  <img  src=" />     etc. 
    could some one please let me know how do we do this using java script ? 
    thanks 

    If you already know how to access the image element and how to download the string using JavaScript or JQuery, then, according to “data” protocol (https://msdn.microsoft.com/en-us/library/cc848897(v=vs.85).aspx),
    assign a special value to src attribute, for example:
        myImageElement.src = "data:image/png;base64," + downloadedString;
    Also consider returning the binary image directly instead of a longer string (if the library is made by you). In this case you will just have:
        myImageElement.src = "http://myurl/imagebank/" + imageNumber;

  • How to set thumbnailUrl and/or thumbnailLocation?

    Hi...
    I have now been struggling how to set the URL or location for the thumbnail, when packaging a book...
    PS. The thumbnail is already uploaded to a location I know the path to:
    This is my XML request (bolded text are examples):
    [thumbnailLocation attempt]:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
              <package xmlns="http://ns.adobe.com/adept">
              <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
                             <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">testTitle</dc:title>
                             <dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">testPublisher</dc:publisher>
                             <dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">testCreator</dc:creator>
                             <dc:language xmlns:dc="http://purl.org/dc/elements/1.1/">da</dc:language>
                             <dc:description xmlns:dc="http://purl.org/dc/elements/1.1/">testDescr</dc:description>
                             <dc:identifier xmlns:dc="http://purl.org/dc/elements/1.1/">urn:uuid:UUID</dc:identifier>
              </metadata>
              <thumbnailLocation>C:\path\to\thumbnail\00c6429e-ea9e-4656-acaf-4de3c37de8d3.jpg</thumbnailLocation>
              <dataPath>C:\path\to\book\00c6429e-ea9e-4656-acaf-4de3c37de8d3.epub</dataPath>
    </package>
    [thumbnailURL attempt]:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <package xmlns="http://ns.adobe.com/adept">
      <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
            <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">testTitle</dc:title>
            <dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">testPublisher</dc:publisher>
            <dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">testCreator</dc:creator>
            <dc:language xmlns:dc="http://purl.org/dc/elements/1.1/">da</dc:language>
            <dc:description xmlns:dc="http://purl.org/dc/elements/1.1/">testDescr</dc:description>
            <dc:identifier xmlns:dc="http://purl.org/dc/elements/1.1/">urn:uuid:UUID</dc:identifier>
            <thumbnailURL>C:\path\to\thumbnail\00c6429e-ea9e-4656-acaf-4de3c37de8d3.jpg</thumbnailURL>
      </metadata>
      <dataPath>C:\path\to\book\00c6429e-ea9e-4656-acaf-4de3c37de8d3.epub</dataPath>
    </package>
    In the response I can see that it completely ignores the thumbnailURL tag, but does not ignore thumbnailLocation - it merely just doesn't do anything with it.
    Any idea?

    Thanks for the answer!
    However, I have tried with both file://c/path/to/... and http://www.myserver.com/thumbnails/filename.jpg  for the <thumbnailLocation> tag, and same for the <thumbnailURL>.
    The packaging service still keeps ignoring those tags, and when I go look in the admin console (http://localhost:8080/admin/console) the book that was posted, has no thumbnail URL.
    I also tried using a base64 encoded image as <thumbnailData> together with <thumbnailLocation>... But in vain...
    PS. This Adobe Content Server has VERY LOUSY technical references. There's no code examples to find, and the tags / xml-requests/responses has very poor detailed explanation. Example:
    The detailed information about the thumbnailLocation tag is like this:
         thumbnailLocation - Upload location for the thumbnail
    Oh really...
    Long story short:
    When I package a book, I already have an uploaded thumbnail image on the server. All I want is to refer to that image, when I package a book... How hard can it be?

Maybe you are looking for

  • If I deauthorize all computers will I loose all my music?

    I have recently purchased a new mac computer - I have 4 computers with itunes on it, all macs, and I can't authorize my new one as it says I can only have 5.  If I deathorize all computers and start again will I loose everything on my itunes?  Also,

  • Sending Email with current IP address in it

    I have done scripting in LotusScript for Lotus Notes. When I was younger, I did BASIC, Pascal, Assembler. I am trying to figure out Applescript and how it relates with each application. Currently, I am trying to create an Applescript which will, upon

  • Exception:oracle.stellent.ridc.protocol.ServiceException: Unable to display

    Hi All, While i excute the RIDC code to retrieve the information using the COLLECTION_INFO service. i got the following error. Error: Event generated by user 'weblogic' at host 'CIS'. Unable to display virtual folder information. Unable to open folde

  • Need to download Photoshop elements 6

    I have Photoshop Elments 6 but cant find the cd.  I have the serial number I just need to download Photoshop elements 6.  How do I do that?

  • Character string in sapscript

    pls explain the following code for barcode in scripts: barcode in sapscript: using character string /: <BC> &VBAK-WERKS& </> Is it another way of achieving barcode apart from character format in scripts?