RadFixedDocument-Block-Image from database.

2 posts, 0 answers
  1. jaipal
    jaipal avatar
    10 posts
    Member since:
    Mar 2018

    Posted 03 Jan 2019 Link to this post

    Hi All,

     

    I need to write custom code for generating the PDF,  where i am getting the image in binary format some thing like below. from database. 

    <img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATYAAACxCAYAAABOfp...........................

     

    The Image needs to be inserted into BLOCK of RadFixedDocument. I do have the functions like the following , but my question is how to convert the above image format to any one of the parameters below.

    block.InsertImage(imageSource);
    block.InsertImage(stream);
    block.InsertImage(imageSource, size);
    block.InsertImage(stream, size);
    block.InsertImage(imageSource, width, height);
    block.InsertImage(stream, width, height);

     

    Regards,

    JP.

     

     

  2. Martin
    Admin
    Martin avatar
    160 posts

    Posted 08 Jan 2019 Link to this post

    Hi JP,

    To convert the data to a stream, you can take a look at this StackOverflow article. After that, you can use the constructor which accepts a Stream object. Also, you can take a look at our ImageSource article for a reference.


    Regards,
    Martin
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top