WKWebview is not rendering .docx file accurately, docx contains logos in header and watermarks, which are not displayed

Getting the document data from a server using JSON encoded to Base64.

WKWebView is not rendering .docx file accurately. The docx file has logos in header and watermark at the background which is not displayed correctly to the user.

Steps taken to load the docx file in WKWebview:

  • Stored the document data on app documents directory.
  • Displaying the document file in WKWebView on mobile app with help of local document directory file path.

Below is the code that renders the docx file:

let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]

let filePath = String(format: "%@/%@", documentsPath, "file.docx")
                
let fileURL = URL(fileURLWithPath: filePath)
docWebView.loadFileURL(fileURL, allowingReadAccessTo: fileURL)

Has anyone encountered this issue? Please provide some assistance to resolve this issue.

Dear All

I have already raised a ticket last week(Friday) with Apple Support, I am not receiving any confirmation nor have I received any emails. I am requesting your response on the ticket raised earlier for this issue.

Ticket ID#: 102242932873 102238105199

Any help would be appreciated, as we are awaiting response. Thank you Sameer

Hello All,

Anyone have the any resolution on this issue, requesting your response as early as possible.

I have already raised a ticket with Apple Support, till date not received any response.

Ticket ID#: 102242932873 102238105199

Any help would be appreciated, as we are awaiting response.

Thank you

WKWebview is not rendering .docx file accurately, docx contains logos in header and watermarks, which are not displayed
 
 
Q