Exporting the content of a rich text box - InfoPath Dev
in

InfoPath Dev

Exporting the content of a rich text box

Last post 12-06-2012 04:36 AM by torp999. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-05-2012 03:59 AM

    Exporting the content of a rich text box

    I'm trying to export the content of a rich text box to a html file, but apparently the images are not recognized by IE 7 Anyone tried this or have a suggestion ? I need that information to be exported to any file type, i just thought HTML would be the easiest way Here is the code: it has 2 lines of text and a embedded image http://pastebin.com/kQdYc4bk - The html,head and body i generated myself. Rest are the exact output of infopath node.xml
    Filed under: ,
  • 12-05-2012 07:58 AM In reply to

    Re: Exporting the content of a rich text box

    I believe that InfoPath's way of representing images in rich text is exclusive to InfoPath and won't work as-is in any browser.

     What you need to do is iterate through all of the <img> tags and replace the value of the src="" attribute with a value like the following:

    data:image/extension;base64value

    Extension can be determined based on the first three characters of the base64 value:

    R0lG - gif

    /9j/ - jpg

    iVBO - png

    SUkq - tif

    (other) - bmp

    And once you've retrieved the base64 value from the xd:inline attribute, I'd suggest removing the xd:inline attribute in order to minimize the size of the HTML file.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-06-2012 04:36 AM In reply to

    Re: Exporting the content of a rich text box

    NOTE: don't know why enter is not taking into consideration... the post looks horrible Thank you for your reply Unfortunately .. IE seems not to support embedded images Tried also to select the node and copy it value, by hoping to paste it in a word document and save that. With these methods: View.SelectNodes Method (XPathNavigator) http://msdn.microsoft.com/en-us/library/aa946814(v=office.14).aspx View.ExecuteAction Method (ActionType) http://msdn.microsoft.com/en-us/library/aa942991(v=office.14).aspx But i need to get the data from multiple values and there is a restriction to selectNodes: The SelectNodes method requires that the specified nodes be structurally selectable in the view. Another solution would if i could access the richtextbox controle because it has a method to save it's content as a rtf, but that's not possible either Working with infopath is horrible :(
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.