We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Images in rtf disappearing in the word doc

Hi. I have a problem with DocIO. I am loading an rtf string which contains an embedded image. It displays fine in the rtf viewer I am using but when converting it into docx the image disappears. I have attached a zip file with the rtf and the resulting docx. This is the code I am using for the conversion:

Using WordDocument = New WordDocument(rtffile, FormatType.Rtf)
WordDocument.Save(Dfile, FormatType.Docx)
WordDocument.Close()
End Using

Obviously rtffile and Dfile contain file names and paths


Thanks, Ralph Baer


Attachment: Sample.txt_61fa730b.zip


3 Replies

AN Anto Nihil Sahaya Raj Syncfusion Team March 23, 2023 11:22 AM UTC

Hi Ralph,

Please find the details below,

Issue

Detail

We have reproduced the reported problem “Image is missing while converting an RTF to Word document” in our end, and we suspect it to be a defect. We will validate this issue and update you with more details on 27th March 2023.


Regards,
Anto Nihil S



RA Ralph March 23, 2023 11:42 AM UTC

Yaay!! I found another bug for you!!

I celebrate because in our product every-time a customer of ours finds a bug that we can squash, it's one less for the future so we celebrate! I hope you do too!

Thanks for your prompt reply and I wait with 'bated breath!

Best regards, Ralph



AN Anto Nihil Sahaya Raj Syncfusion Team March 27, 2023 07:55 PM UTC

Ralph, on further validating, we found that the document is plain text but the extension is .rtf. So we copied that content in the input document and pasted in a new RTF document. In that RTF document, we have found that the reported issue is due to the unsupported images present in the RTF document.

In the input RTF document, the image is in dibitmap type (device-independent bitmap *.bmp or *.dib). When opening the given RTF document in the Microsoft Word application, it automatically converts that dibitmap image into .png image format in the file level, to preserve properly in visual appearance. DocIO doesn’t support this type of image conversion.

As a workaround, we suggest you open and save that new RTF document using Microsoft Word application and then open using DocIO. We have modified the document according to this and it can be downloaded from the below link,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Modified-79018992.zip


Also, find the plain text document containing the modified RTF structure below.,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Modified_RTF1124266998.zip


Loader.
Live Chat Icon For mobile
Up arrow icon