简体   繁体   中英

When embedding RTF file into DOCX file using OpenXML, embedded contents don't display in some viewers

Using the technique in this answer I was successfully embedding the contents of an RTF file into an existing Word DOCX file, using OpenXML 2.5. Or so I thought.

We've now discovered that while the created file works fine in MS Word and Word Online, the document displays without the RTF content on other viewers such as:

  • Google Docs preview functionality
  • Windows Phone 8.1 (which has Office functionality built in)
  • Various iOS and Android viewers

In all cases, the document displays completely correctly except that the RTF content is just missing.

I did think it might be an issue in the viewers rather than the DOCX file, but for several tools to have the same issue makes me suspect it is a bug in our code.

It's a bit of an obscure case so trying to figure out the problem is proving difficult.

The technique you used (altChunk) relies on the viewer to convert the RTF content into WordML.

As you've discovered many don't do this.

To avoid this issue, you've really gotta convert the RTF content in your own code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM