RTF to DOCX missing header image

The RTF that our billing program exports has a LOGO in the header.

When I use DOCIO to convert to a Word Document, this image is missing.

Any suggestions ?


6 Replies

SB Suriya Balamurugan Syncfusion Team September 23, 2022 06:55 AM UTC

Hi Craig,

We have tried to reproduce the reported problem using the given details, but we unable to reproduce the mentioned issue at our end.

We suspect that the problem might be due to the contents in the input Word document which used at your end. So, could you please provide us the input Word document from your end, which will be helpful to reproduce the exact issue at our end.

Based on the above details, we will proceed further to reproduce the same problem and will provide you appropriate solution at the earliest.

Note: If you have any confidential data in your Word document, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face.

Regards,
Suriya Balamurugan.



CR Craig Reilly September 23, 2022 12:51 PM UTC

I tried to strip the confidential information out of the rtf - but when I save it in word - the conversion then works fine. I’m going to try and create a dummy invoice using ourselves as a customer. I’ll get back to you. 



CR Craig Reilly September 23, 2022 04:46 PM UTC

Here is a file that will not convert properly.



Attachment: 200127.1__Copy.rtf_8e5c36dc.zip


SB Suriya Balamurugan Syncfusion Team September 26, 2022 10:21 AM UTC

Hi Craig,

We have reproduced the reported problem with “Image not preserved properly while saving RTF document to DOCX” in our end, and we suspect it to be a defect. We will validate this issue and update you with more details on 28th September 2022.

Regards,
Suriya Balamurugan.



AN Anto Nihil Sahaya Raj Syncfusion Team September 28, 2022 03:05 PM UTC

Hi Craig,

From the investigation, we have found that the given RTF document doesn’t have the proper file structure. We have found that the RTF document level structure of is table row starts which is followed by the font table, color table, theme data and image.


Please refer to the below screenshot,


Thus while resaving in DocIO library, the image is placed inside the table. While opening this Word document in Microsoft Word viewer application, it autocorrects these improper file structures and preserves the content properly in the visual appearance. This kind of auto correction algorithm is not handled by DocIO library. So, it rises problem in DocIO generated document. And also, to handle these invalid file structures it is need to change the whole RTF parsing architecture of DocIO library and it is not feasible at our end.

We suspect that this RTF document is created using some other third-party tool at your side. If yes, we suggest you to generate RTF document with valid file structure to preserve the contents properly.

To resolve this issue, we suggest you to open that RTF document and save using Microsoft Word application, so it corrects the invalid structure and rewrites the file with valid structure. Then, open that document using DocIO library to perform manipulations and conversions.

Please find the attached Microsoft resaved RTF document from below,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/200127.1_MS_Resaved195186547.zip

Regards,
Anto Nihil S



CR Craig Reilly replied to Anto Nihil Sahaya Raj September 28, 2022 03:34 PM UTC

That is indeed what we are doing now - is opening with word to convert from rtf to doc, then manipulating.

Unfortunately, we have little control of the program that creates the RTF. We can adjust the way the form looks, and where the field are, but that is it.


Thanks for your time. Maybe I can consider the form without the logo, and add the logo during conversion using DocIO.



 


Loader.
Up arrow icon